Skip to content

Commit

Permalink
enable all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
galabovaa committed Oct 29, 2024
1 parent fe4dcdf commit e93d20c
Showing 1 changed file with 44 additions and 45 deletions.
89 changes: 44 additions & 45 deletions check/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -263,7 +263,7 @@ if (NOT FAST_BUILD OR ALL_TESTS)
"standgub\; 1.2576994998\;"
)
endif()

set(pdlpMacArmInstances
"25fv47\; 5.50184589\;"
"adlittle\; 2.254949631\;"
Expand Down Expand Up @@ -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 $<TARGET_FILE:highs-bin> ${setting}
# --options_file ${CMAKE_BINARY_DIR}/testoptions.txt ${inst})
# else()
# add_test(NAME ${name}${setting} COMMAND $<TARGET_FILE:highs> ${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 $<TARGET_FILE:highs-bin> ${setting}
--options_file ${CMAKE_BINARY_DIR}/testoptions.txt ${inst})
else()
add_test(NAME ${name}${setting} COMMAND $<TARGET_FILE:highs> ${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})
Expand Down

0 comments on commit e93d20c

Please sign in to comment.