|
| 1 | +file(GLOB_RECURSE api_sources "../src/libcprover-cpp/*.cpp" "../src/libcprover-cpp/*.h") |
| 2 | + |
| 3 | +# This step builds a binary driving the API (to be used for testing) |
| 4 | +add_executable(api-binary-driver call_bmc.cpp ${api_sources}) |
| 5 | +cprover_default_properties(api-binary-driver) |
| 6 | +target_include_directories(api-binary-driver |
| 7 | + PUBLIC |
| 8 | + ${CBMC_BINARY_DIR} |
| 9 | + ${CBMC_SOURCE_DIR} |
| 10 | + # TODO: Should be fixed for the proper include form. |
| 11 | + ${CMAKE_CURRENT_SOURCE_DIR}/../src/libcprover-cpp/) |
| 12 | +target_link_libraries(api-binary-driver goto-programs util langapi ansi-c cprover-api-cpp) |
| 13 | + |
| 14 | +# Enable test running |
| 15 | +set(test_pl_path "${CBMC_SOURCE_DIR}/../regression/test.pl") |
| 16 | + |
| 17 | +macro(add_test_pl_profile name cmdline flag profile) |
| 18 | + add_test( |
| 19 | + NAME "${name}-${profile}" |
| 20 | + COMMAND perl ${test_pl_path} -e -p -c "${cmdline}" ${flag} ${ARGN} |
| 21 | + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" |
| 22 | + ) |
| 23 | + set_tests_properties("${name}-${profile}" PROPERTIES |
| 24 | + LABELS "${profile};CBMC" |
| 25 | + ) |
| 26 | +endmacro(add_test_pl_profile) |
| 27 | + |
| 28 | +macro(add_test_pl_tests cmdline) |
| 29 | + get_filename_component(TEST_DIR_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME) |
| 30 | + message(STATUS "Adding tests in directory: ${TEST_DIR_NAME}") |
| 31 | + add_test_pl_profile("${TEST_DIR_NAME}" "${cmdline}" -C CORE ${ARGN}) |
| 32 | + add_test_pl_profile("${TEST_DIR_NAME}" "${cmdline}" -T THOROUGH ${ARGN}) |
| 33 | + add_test_pl_profile("${TEST_DIR_NAME}" "${cmdline}" -F FUTURE ${ARGN}) |
| 34 | + add_test_pl_profile("${TEST_DIR_NAME}" "${cmdline}" -K KNOWNBUG ${ARGN}) |
| 35 | +endmacro(add_test_pl_tests) |
| 36 | + |
| 37 | +# For the best possible utilisation of multiple cores when |
| 38 | +# running tests in parallel, it is important that these directories are |
| 39 | +# listed with decreasing runtimes (i.e. longest running at the top) |
| 40 | +add_subdirectory(model_loading) |
0 commit comments