forked from modelica/ModelicaStandardLibrary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.cmake
28 lines (27 loc) · 986 Bytes
/
test.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
include(CTest)
if(BUILD_TESTING)
set(MODELICA_TEST_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../../../../.CI/Test")
get_filename_component(ABSOLUTE_MODELICA_TEST_SOURCE_DIR "${MODELICA_TEST_SOURCE_DIR}" ABSOLUTE)
if(EXISTS "${ABSOLUTE_MODELICA_TEST_SOURCE_DIR}")
set(MODELICA_TESTS
FileSystem
ModelicaStrings
Streams
Tables
TablesFromCsvFile
TablesFromMatFile
TablesFromTxtFile
TablesNoUsertab
)
foreach(TEST ${MODELICA_TESTS})
add_executable(Test${TEST} "${ABSOLUTE_MODELICA_TEST_SOURCE_DIR}/${TEST}.c")
target_link_libraries(Test${TEST} ModelicaExternalC ModelicaStandardTables ModelicaIO ModelicaMatIO zlib)
add_test(NAME Test${TEST} COMMAND Test${TEST} WORKING_DIRECTORY "${ABSOLUTE_MODELICA_TEST_SOURCE_DIR}")
endforeach()
else()
message(WARNING
" Testsuite not found in \"${ABSOLUTE_MODELICA_TEST_SOURCE_DIR}\"."
" Set BUILD_TESTING to OFF to silence this warning."
)
endif()
endif()