Skip to content

Commit f1ee958

Browse files
committed
add dependencies for tests, so tests won't fail if 'make' wasn't run before 'make test'
1 parent 5d78a32 commit f1ee958

File tree

4 files changed

+29
-7
lines changed

4 files changed

+29
-7
lines changed

src/exp2cxx/test/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
set(unitary_dir ${SC_SOURCE_DIR}/test/unitary_schemas)
44

5+
add_test(NAME build_exp2cxx
6+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
7+
COMMAND ${CMAKE_COMMAND} --build .
8+
--target exp2cxx
9+
--config $<CONFIGURATION>
10+
)
11+
512
add_test(NAME test_exp2cxx_unique_qualifiers
613
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
714
COMMAND ${CMAKE_COMMAND} -DEXE=$<TARGET_FILE:exp2cxx>
@@ -15,7 +22,7 @@ add_test(NAME test_exp2cxx_inverse_qualifiers
1522
-DINFILE=${unitary_dir}/inverse_qualifiers.exp
1623
-P ${CMAKE_CURRENT_SOURCE_DIR}/inverse_qualifiers.cmake
1724
)
18-
set_tests_properties(test_exp2cxx_unique_qualifiers test_exp2cxx_inverse_qualifiers PROPERTIES DEPENDS exp2cxx)
25+
set_tests_properties(test_exp2cxx_unique_qualifiers test_exp2cxx_inverse_qualifiers PROPERTIES DEPENDS build_exp2cxx)
1926

2027
# Local Variables:
2128
# tab-width: 8

src/exppp/test/CMakeLists.txt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,21 @@ set(breakLongStr_SRCS
66
../exppp.c
77
)
88

9+
add_test(NAME build_exppp
10+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
11+
COMMAND ${CMAKE_COMMAND} --build .
12+
--target exppp
13+
--config $<CONFIGURATION>
14+
)
15+
916
# this executable doesn't really check the results, just ensures no segfaults. ought to improve it...
1017
SC_ADDEXEC(tst_breakLongStr "${breakLongStr_SRCS}" "express;base" "TESTABLE")
1118
add_test(NAME build_tst_breakLongStr
12-
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
13-
COMMAND ${CMAKE_COMMAND} --build .
14-
--target tst_breakLongStr
15-
--config $<CONFIGURATION>)
19+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
20+
COMMAND ${CMAKE_COMMAND} --build .
21+
--target tst_breakLongStr
22+
--config $<CONFIGURATION>
23+
)
1624
add_test(test_breakLongStr ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tst_breakLongStr)
1725
set_tests_properties(test_breakLongStr PROPERTIES DEPENDS build_tst_breakLongStr)
1826

@@ -50,7 +58,7 @@ add_test(NAME test_exppp_div_slash
5058
-P ${CMAKE_CURRENT_SOURCE_DIR}/exppp_div_slash.cmake
5159
)
5260

53-
set_tests_properties(test_exppp_unique_qualifiers test_exppp_inverse_qualifiers test_exppp_lost_var test_exppp_div_slash PROPERTIES DEPENDS exppp)
61+
set_tests_properties(test_exppp_unique_qualifiers test_exppp_inverse_qualifiers test_exppp_lost_var test_exppp_div_slash PROPERTIES DEPENDS build_exppp)
5462

5563
# Local Variables:
5664
# tab-width: 8

src/express/test/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
include_directories(..)
22

3+
add_test(NAME build_check_express
4+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
5+
COMMAND ${CMAKE_COMMAND} --build .
6+
--target check-express
7+
--config $<CONFIGURATION>
8+
)
9+
310
sc_addexec(print_schemas "../fedex.c;print_schemas.c" "express;base")
411
sc_addexec(print_attrs "../fedex.c;print_attrs.c" "express;base")
512

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ foreach(UNITARY_SCHEMA ${UNITARY_SCHEMAS})
66
get_filename_component(SCHEMA_NAME ${UNITARY_SCHEMA} NAME_WE)
77
set(TEST_NAME test_unit_${SCHEMA_NAME})
88
add_test(${TEST_NAME} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/check-express ${UNITARY_SCHEMA})
9-
set_tests_properties( ${TEST_NAME} PROPERTIES LABELS unitary_schemas )
9+
set_tests_properties( ${TEST_NAME} PROPERTIES LABELS unitary_schemas DEPENDS build_check_express )
1010
#if the file name begins with fail_, then testing it should result in an error.
1111
if( UNITARY_SCHEMA MATCHES "fail_.*" )
1212
set_tests_properties( ${TEST_NAME} PROPERTIES WILL_FAIL true )

0 commit comments

Comments
 (0)