Skip to content

Commit

Permalink
add dependencies for tests, so tests won't fail if 'make' wasn't run …
Browse files Browse the repository at this point in the history
…before 'make test'
  • Loading branch information
mpictor committed Mar 1, 2014
1 parent 5d78a32 commit f1ee958
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
9 changes: 8 additions & 1 deletion src/exp2cxx/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

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

add_test(NAME build_exp2cxx
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} --build .
--target exp2cxx
--config $<CONFIGURATION>
)

add_test(NAME test_exp2cxx_unique_qualifiers
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -DEXE=$<TARGET_FILE:exp2cxx>
Expand All @@ -15,7 +22,7 @@ add_test(NAME test_exp2cxx_inverse_qualifiers
-DINFILE=${unitary_dir}/inverse_qualifiers.exp
-P ${CMAKE_CURRENT_SOURCE_DIR}/inverse_qualifiers.cmake
)
set_tests_properties(test_exp2cxx_unique_qualifiers test_exp2cxx_inverse_qualifiers PROPERTIES DEPENDS exp2cxx)
set_tests_properties(test_exp2cxx_unique_qualifiers test_exp2cxx_inverse_qualifiers PROPERTIES DEPENDS build_exp2cxx)

# Local Variables:
# tab-width: 8
Expand Down
18 changes: 13 additions & 5 deletions src/exppp/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,21 @@ set(breakLongStr_SRCS
../exppp.c
)

add_test(NAME build_exppp
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} --build .
--target exppp
--config $<CONFIGURATION>
)

# this executable doesn't really check the results, just ensures no segfaults. ought to improve it...
SC_ADDEXEC(tst_breakLongStr "${breakLongStr_SRCS}" "express;base" "TESTABLE")
add_test(NAME build_tst_breakLongStr
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} --build .
--target tst_breakLongStr
--config $<CONFIGURATION>)
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} --build .
--target tst_breakLongStr
--config $<CONFIGURATION>
)
add_test(test_breakLongStr ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tst_breakLongStr)
set_tests_properties(test_breakLongStr PROPERTIES DEPENDS build_tst_breakLongStr)

Expand Down Expand Up @@ -50,7 +58,7 @@ add_test(NAME test_exppp_div_slash
-P ${CMAKE_CURRENT_SOURCE_DIR}/exppp_div_slash.cmake
)

set_tests_properties(test_exppp_unique_qualifiers test_exppp_inverse_qualifiers test_exppp_lost_var test_exppp_div_slash PROPERTIES DEPENDS exppp)
set_tests_properties(test_exppp_unique_qualifiers test_exppp_inverse_qualifiers test_exppp_lost_var test_exppp_div_slash PROPERTIES DEPENDS build_exppp)

# Local Variables:
# tab-width: 8
Expand Down
7 changes: 7 additions & 0 deletions src/express/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
include_directories(..)

add_test(NAME build_check_express
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} --build .
--target check-express
--config $<CONFIGURATION>
)

sc_addexec(print_schemas "../fedex.c;print_schemas.c" "express;base")
sc_addexec(print_attrs "../fedex.c;print_attrs.c" "express;base")

Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ foreach(UNITARY_SCHEMA ${UNITARY_SCHEMAS})
get_filename_component(SCHEMA_NAME ${UNITARY_SCHEMA} NAME_WE)
set(TEST_NAME test_unit_${SCHEMA_NAME})
add_test(${TEST_NAME} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/check-express ${UNITARY_SCHEMA})
set_tests_properties( ${TEST_NAME} PROPERTIES LABELS unitary_schemas )
set_tests_properties( ${TEST_NAME} PROPERTIES LABELS unitary_schemas DEPENDS build_check_express )
#if the file name begins with fail_, then testing it should result in an error.
if( UNITARY_SCHEMA MATCHES "fail_.*" )
set_tests_properties( ${TEST_NAME} PROPERTIES WILL_FAIL true )
Expand Down

0 comments on commit f1ee958

Please sign in to comment.