summaryrefslogtreecommitdiff
path: root/src/test/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Winter <allen.winter@kdab.com>2022-06-01 17:31:03 -0400
committerAllen Winter <allen.winter@kdab.com>2022-06-01 17:32:28 -0400
commitacf22732a262139e1710330bb102bb7fe54c3fe1 (patch)
treea1254be9ba2b6d5ec6ad87969b9d14ffafed1dc2 /src/test/CMakeLists.txt
parentab8c10c88b987e756e746b63f1a7b29668a338bd (diff)
downloadlibical-git-acf22732a262139e1710330bb102bb7fe54c3fe1.tar.gz
CMake files - cmake-linting
Diffstat (limited to 'src/test/CMakeLists.txt')
-rw-r--r--src/test/CMakeLists.txt13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt
index 8bba8747..77b85a9a 100644
--- a/src/test/CMakeLists.txt
+++ b/src/test/CMakeLists.txt
@@ -20,6 +20,7 @@ set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
set(TEST_DATADIR "\"${CMAKE_SOURCE_DIR}/test-data\"")
add_definitions(-DTEST_DATADIR=${TEST_DATADIR} -DTEST_ZONEDIR="${CMAKE_SOURCE_DIR}/zoneinfo")
+# Set properties for the test
macro(setprops _name)
if(UNIX)
set_tests_properties(${_name} PROPERTIES
@@ -72,6 +73,7 @@ macro(buildme _name _srcs)
endif()
endmacro()
+# Build the test and add the test, making sure the test properties are set
macro(testme _name _srcs)
buildme(${_name} "${_srcs}")
add_test(NAME ${_name} COMMAND ${_name})
@@ -112,10 +114,10 @@ set(parser_SRCS icaltestparser.c)
buildme(parser "${parser_SRCS}")
file(GLOB TEST_FILES ${CMAKE_SOURCE_DIR}/test-data/*.ics)
-foreach(TEST_FILE ${TEST_FILES})
- get_filename_component(TEST_NAME ${TEST_FILE} NAME_WE)
- add_test(NAME parser-${TEST_NAME} COMMAND parser ${TEST_FILE})
- setprops(parser-${TEST_NAME})
+foreach(test_file ${TEST_FILES})
+ get_filename_component(test_name ${test_file} NAME_WE)
+ add_test(NAME parser-${test_name} COMMAND parser ${test_file})
+ setprops(parser-${test_name})
endforeach()
########### next target ###############
@@ -181,7 +183,8 @@ if(NOT ${CMAKE_VERSION} VERSION_LESS 3.14)
set(CMAKE_COMPARE_FILES_IGNORE_EOL TRUE)
endif()
if(NOT WIN32 OR CMAKE_COMPARE_FILES_IGNORE_EOL)
- if(NOT CYGWIN AND NOT USE_32BIT_TIME_T) #ignore_eol doesn't work on Cygwin. tests for years greater than 2037 will fail
+ #ignore_eol doesn't work on Cygwin. testing years greater than 2037 will fail
+ if(NOT CYGWIN AND NOT USE_32BIT_TIME_T)
set(icalrecurtest_SRCS icalrecur_test.c)
add_executable(icalrecurtest ${icalrecurtest_SRCS})
target_link_libraries(icalrecurtest ical icalss icalvcal)