disable simulation in ctest by default

This commit is contained in:
Markus Pilman 2021-07-27 11:17:55 -06:00
parent 4395d46ee8
commit 91e5498357
4 changed files with 9 additions and 2 deletions

View File

@ -39,6 +39,9 @@ function(configure_testing)
endfunction() endfunction()
function(verify_testing) function(verify_testing)
if(NOT ENABLE_SIMULATION_TESTS)
return()
endif()
foreach(test_file IN LISTS fdb_test_files) foreach(test_file IN LISTS fdb_test_files)
message(SEND_ERROR "${test_file} found but it is not associated with a test") message(SEND_ERROR "${test_file} found but it is not associated with a test")
endforeach() endforeach()
@ -59,6 +62,9 @@ function(add_fdb_test)
set(options UNIT IGNORE) set(options UNIT IGNORE)
set(oneValueArgs TEST_NAME TIMEOUT) set(oneValueArgs TEST_NAME TIMEOUT)
set(multiValueArgs TEST_FILES) set(multiValueArgs TEST_FILES)
if (NOT ENABLE_SIMULATION_TESTS)
return()
endif()
cmake_parse_arguments(ADD_FDB_TEST "${options}" "${oneValueArgs}" "${multiValueArgs}" "${ARGN}") cmake_parse_arguments(ADD_FDB_TEST "${options}" "${oneValueArgs}" "${multiValueArgs}" "${ARGN}")
set(this_test_timeout ${ADD_FDB_TEST_TIMEOUT}) set(this_test_timeout ${ADD_FDB_TEST_TIMEOUT})
if(NOT this_test_timeout) if(NOT this_test_timeout)

View File

@ -2,6 +2,7 @@ include(AddFdbTest)
# We need some variables to configure the test setup # We need some variables to configure the test setup
set(ENABLE_BUGGIFY ON CACHE BOOL "Enable buggify for tests") set(ENABLE_BUGGIFY ON CACHE BOOL "Enable buggify for tests")
set(ENABLE_SIMULATION_TESTS OFF CACHE BOOL "Enable simulation tests (useful if you can't run Joshua)")
set(RUN_IGNORED_TESTS OFF CACHE BOOL "Run tests that are marked for ignore") set(RUN_IGNORED_TESTS OFF CACHE BOOL "Run tests that are marked for ignore")
set(TEST_KEEP_LOGS "FAILED" CACHE STRING "Which logs to keep (NONE, FAILED, ALL)") set(TEST_KEEP_LOGS "FAILED" CACHE STRING "Which logs to keep (NONE, FAILED, ALL)")
set(TEST_KEEP_SIMDIR "NONE" CACHE STRING "Which simfdb directories to keep (NONE, FAILED, ALL)") set(TEST_KEEP_SIMDIR "NONE" CACHE STRING "Which simfdb directories to keep (NONE, FAILED, ALL)")
@ -29,7 +30,7 @@ if(WITH_PYTHON)
set(TestRunner "${PROJECT_SOURCE_DIR}/tests/TestRunner/TestRunner.py") set(TestRunner "${PROJECT_SOURCE_DIR}/tests/TestRunner/TestRunner.py")
configure_file(${PROJECT_SOURCE_DIR}/tests/CTestCustom.ctest ${PROJECT_BINARY_DIR}/CTestCustom.ctest @ONLY) configure_file(${PROJECT_SOURCE_DIR}/tests/CTestCustom.ctest.cmake ${PROJECT_BINARY_DIR}/CTestCustom.ctest @ONLY)
configure_testing(TEST_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" configure_testing(TEST_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
ERROR_ON_ADDITIONAL_FILES ERROR_ON_ADDITIONAL_FILES

View File

@ -1 +0,0 @@
set(CTEST_CUSTOM_PRE_TEST ${CTEST_CUSTOM_PRE_TEST} "@PROJECT_SOURCE_DIR@/tests/TestRunner/TestDirectory.py @PROJECT_BINARY_DIR@")

View File

@ -0,0 +1 @@
set(CTEST_CUSTOM_PRE_TEST ${CTEST_CUSTOM_PRE_TEST} "@Python_EXECUTABLE@ @PROJECT_SOURCE_DIR@/tests/TestRunner/TestDirectory.py @PROJECT_BINARY_DIR@")