Debian Codegraph @

cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/tests/CMakeLists.txt

raw
1 #
2 # Create a test executable b_test that only depends on package's man libs
3 #
4
5 tribits_add_executable( b_test SOURCES b_test.cpp
6 ADDED_EXE_TARGET_NAME_OUT b_test_TARGET_NAME )
7
8 tribits_verbose_print_var(b_test_TARGET_NAME)
9
10 # Example of setting a property on an executable
11 set_target_properties(${b_test_TARGET_NAME}
12 PROPERTIES LINKER_LANGUAGE CXX ) # Don't really need to set this!
13
14 #
15 # Create a test-only b_mixed_lang lib which uses the optional test dependent
16 # MixedLang package
17 #
18
19 add_subdirectory(testlib)
20
21 #
22 # Test b_test
23 #
24
25 tribits_add_advanced_test( test_of_b
26 OVERALL_NUM_MPI_PROCS 1
27 TEST_0 EXEC b_test
28 PASS_REGULAR_EXPRESSION_ALL
29 "B label is: B"
30 "B deps are: ${EXPECTED_B_DEPS}"
31 ADDED_TEST_NAME_OUT test_of_b_TEST_NAME
32 )
33
34 tribits_verbose_print_var(test_of_b_TEST_NAME)
35
36 # Example of changing CTest property on advanced test
37 if (test_of_b_TEST_NAME)
38 set_tests_properties( ${test_of_b_TEST_NAME}
39 PROPERTIES TIMEOUT 12.0 )
40 endif()
41
42 #
43 # Define a test involving the optional dependent MixedLang package
44 #
45
46 assert_defined(${PACKAGE_NAME}_ENABLE_MixedLang)
47 if (${PACKAGE_NAME}_ENABLE_MixedLang)
48
49 include(${CMAKE_CURRENT_LIST_DIR}/ShowLibErrors.cmake)
50
51 tribits_add_executable_and_test( test_of_b_mixed_lang
52 SOURCES b_mixed_lang_test.cpp
53 NUM_MPI_PROCS 1
54 PASS_REGULAR_EXPRESSION "B Mixed Language Hello World"
55 TESTONLYLIBS b_test_utils b_mixed_lang
56 ${TAEAT_EXTRALIB_ARGS} # Used for testing and to demonstrate errors
57 )
58
59 endif()