Skip to content

Commit

Permalink
extra problem set in ctest OK
Browse files Browse the repository at this point in the history
  • Loading branch information
galabovaa committed Oct 15, 2024
1 parent 31e21e6 commit 612dedb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,16 @@ include(CMakeDependentOption)
CMAKE_DEPENDENT_OPTION(ALL_TESTS "Build all tests" OFF "BUILD_TESTING;BUILD_CXX" OFF)
message(STATUS "Build all tests: ${ALL_TESTS}")

CMAKE_DEPENDENT_OPTION(BUILD_EXTRA_UNIT_TESTS "Build extra unit tests" OFF "BUILD_TESTING;BUILD_CXX;ALL_TESTS" OFF)
CMAKE_DEPENDENT_OPTION(BUILD_EXTRA_UNIT_TESTS "Build extra unit tests" OFF "ALL_TESTS" OFF)
if (BUILD_EXTRA_UNIT_TESTS)
message(STATUS "Build extra unit tests: ON")
endif()

CMAKE_DEPENDENT_OPTION(BUILD_EXTRA_PROBLEM_SET "Build extra instance tests" OFF "BUILD_TESTING" OFF)
if (BUILD_EXTRA_PROBLEM_SET)
message(STATUS "Build extra instance tests: ON")
endif()

option(ZLIB "ZLIB" ON)
message(STATUS "ZLIB: ${ZLIB}")
if (PYTHON_BUILD_SETUP)
Expand Down
22 changes: 15 additions & 7 deletions check/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,16 @@ if (NOT FAST_BUILD OR ALL_TESTS)
set(TEST_SOURCES ${TEST_SOURCES} TestSpecialLps.cpp TestLpSolvers.cpp TestMipSolver.cpp)
endif()

add_executable(unit_tests ${TEST_SOURCES})
if (BUILD_EXTRA_UNIT_TESTS)
list(APPEND CMAKE_MODULE_PATH "${HIGHS_SOURCE_DIR}/check/highs-unit-tests")
message(STATUS "${HIGHS_SOURCE_DIR}/check/highs-unit-tests")
include(highs-unit-tests)

if (BUILD_EXTRA_UNIT_TESTS)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/highs-unit-tests")
include(extra-tests)
message(STATUS "EXTRA TESTS: ${HIGHS_EXTRA_UNIT_TESTS}")
set(TEST_SOURCES ${HIGHS_EXTRA_UNIT_TESTS})
endif()
set(TEST_SOURCES ${TEST_SOURCES} ${HIGHS_EXTRA_UNIT_TESTS})
message(STATUS ${TEST_SOURCES})
endif()

add_executable(unit_tests ${TEST_SOURCES})

if (UNIX)
target_compile_options(unit_tests PRIVATE "-Wno-unused-variable")
Expand Down Expand Up @@ -331,3 +333,9 @@ if (NOT FAST_BUILD OR ALL_TESTS)
endforeach()

endif()

if (BUILD_EXTRA_PROBLEM_SET)
list(APPEND CMAKE_MODULE_PATH "${HIGHS_SOURCE_DIR}/check/highs-problem-set")
message(STATUS "${HIGHS_SOURCE_DIR}/check/highs-problem-set")
include(highs-problem-set)
endif()

0 comments on commit 612dedb

Please sign in to comment.