diff --git a/check/CMakeLists.txt b/check/CMakeLists.txt index 356cfd9f6f..a8255c74db 100644 --- a/check/CMakeLists.txt +++ b/check/CMakeLists.txt @@ -137,11 +137,11 @@ if (NOT FAST_BUILD OR ALL_TESTS) RESOURCE_LOCK unittestbin) # create a binary running all the tests in the executable -# add_test(NAME unit_tests_all COMMAND unit_tests --success) -# set_tests_properties(unit_tests_all -# PROPERTIES -# DEPENDS unit-test-build) -# set_tests_properties(unit_tests_all PROPERTIES TIMEOUT 10000) + add_test(NAME unit_tests_all COMMAND unit_tests --success) + set_tests_properties(unit_tests_all + PROPERTIES + DEPENDS unit-test-build) + set_tests_properties(unit_tests_all PROPERTIES TIMEOUT 10000) # An individual test can be added with the command below but the approach # above with a single add_test for all the unit tests automatically detects all @@ -263,7 +263,7 @@ if (NOT FAST_BUILD OR ALL_TESTS) "standgub\; 1.2576994998\;" ) endif() - + set(pdlpMacArmInstances "25fv47\; 5.50184589\;" "adlittle\; 2.254949631\;" @@ -335,45 +335,44 @@ if (NOT FAST_BUILD OR ALL_TESTS) endforeach(instance) endmacro(add_instancetests) -# # add tests for success and fail instances -# if (APPLE AND (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm64")) -# add_instancetests(successMacArmInstances "Optimal") -# else() -# add_instancetests(successInstances "Optimal") -# endif() - -# add_instancetests(failInstances "Fail") -# add_instancetests(infeasibleInstances "Infeasible") - -# add_instancetests(unboundedInstances "Unbounded") - - -# foreach(instance ${mipInstances}) -# list(GET instance 0 name) -# list(GET instance 1 optval) -# # specify the instance and the settings load command -# set(inst "${HIGHS_SOURCE_DIR}/check/instances/${name}.mps") - -# foreach(setting ${settings}) -# if (FAST_BUILD) -# add_test(NAME ${name}${setting} COMMAND $ ${setting} -# --options_file ${CMAKE_BINARY_DIR}/testoptions.txt ${inst}) -# else() -# add_test(NAME ${name}${setting} COMMAND $ ${setting} -# --options_file ${CMAKE_BINARY_DIR}/testoptions.txt ${inst}) -# endif() - -# set_tests_properties (${name}${setting} PROPERTIES -# DEPENDS unit_tests_all) - -# set_tests_properties (${name}${setting} PROPERTIES -# PASS_REGULAR_EXPRESSION -# "Status Optimal\n Primal bound ${optval}.*\n Dual bound ${optval}.*\n Solution status feasible\n ${optval}.* \\(objective\\)" -# FAIL_REGULAR_EXPRESSION -# "Solution status infeasible") - -# endforeach(setting) -# endforeach(instance) + # add tests for success and fail instances + if (APPLE AND (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm64")) + add_instancetests(successMacArmInstances "Optimal") + else() + add_instancetests(successInstances "Optimal") + endif() + + add_instancetests(failInstances "Fail") + add_instancetests(infeasibleInstances "Infeasible") + add_instancetests(unboundedInstances "Unbounded") + + + foreach(instance ${mipInstances}) + list(GET instance 0 name) + list(GET instance 1 optval) + # specify the instance and the settings load command + set(inst "${HIGHS_SOURCE_DIR}/check/instances/${name}.mps") + + foreach(setting ${settings}) + if (FAST_BUILD) + add_test(NAME ${name}${setting} COMMAND $ ${setting} + --options_file ${CMAKE_BINARY_DIR}/testoptions.txt ${inst}) + else() + add_test(NAME ${name}${setting} COMMAND $ ${setting} + --options_file ${CMAKE_BINARY_DIR}/testoptions.txt ${inst}) + endif() + + set_tests_properties (${name}${setting} PROPERTIES + DEPENDS unit_tests_all) + + set_tests_properties (${name}${setting} PROPERTIES + PASS_REGULAR_EXPRESSION + "Status Optimal\n Primal bound ${optval}.*\n Dual bound ${optval}.*\n Solution status feasible\n ${optval}.* \\(objective\\)" + FAIL_REGULAR_EXPRESSION + "Solution status infeasible") + + endforeach(setting) + endforeach(instance) if(FAST_BUILD AND NOT APPLE) foreach(instance_pdlp ${pdlpInstances})