summaryrefslogtreecommitdiff
path: root/test/CMakeLists.txt
blob: 28da55e89769f7a575866bbf6da1306c5af8ad37 (plain)
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
29
30
31
32
33
34
35
36

set(CXXTEST_SOURCES
    test.cc
    test_exception.cc
    test_guard.cc
    test_typeinfo.cc
   )


add_executable(cxxrt-test-static ${CXXTEST_SOURCES})
set_property(TARGET cxxrt-test-static PROPERTY LINK_FLAGS -nodefaultlibs)
target_link_libraries(cxxrt-test-static cxxrt-static gcc_s pthread dl c)

add_executable(cxxrt-test-shared ${CXXTEST_SOURCES})
set_property(TARGET cxxrt-test-shared PROPERTY LINK_FLAGS -nodefaultlibs)
target_link_libraries(cxxrt-test-shared cxxrt-shared pthread dl c)

add_executable(system-test ${CXXTEST_SOURCES})

# Generating excpected output with system-test
add_custom_target(test-expected-output ALL
                  COMMAND system-test > ${CMAKE_CURRENT_BINARY_DIR}/expected_output.log 2>&1
                  DEPENDS system-test)


add_test(cxxrt-test-static-test
         ${CMAKE_CURRENT_SOURCE_DIR}/run_test.sh
         ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/cxxrt-test-static
         ${CMAKE_CURRENT_BINARY_DIR}/expected_output.log)

add_test(cxxrt-test-shared-test
         ${CMAKE_CURRENT_SOURCE_DIR}/run_test.sh
         ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/cxxrt-test-shared
         ${CMAKE_CURRENT_BINARY_DIR}/expected_output.log)