Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split tests into unit tests and functional tests #87

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,18 @@ file(GLOB UNO_SOURCE_FILES

# unit test source files
file(GLOB TESTS_UNO_SOURCE_FILES
unotest/unotest.cpp
unotest/CollectionAdapterTests.cpp
unotest/ConcatenationTests.cpp
unotest/COOSparseStorageTests.cpp
unotest/CSCSparseStorageTests.cpp
unotest/MatrixVectorProductTests.cpp
unotest/RangeTests.cpp
unotest/ScalarMultipleTests.cpp
unotest/SparseVectorTests.cpp
unotest/SumTests.cpp
unotest/VectorTests.cpp
unotest/VectorViewTests.cpp
unotest/unit_tests/unotest.cpp
unotest/unit_tests/CollectionAdapterTests.cpp
unotest/unit_tests/ConcatenationTests.cpp
unotest/unit_tests/COOSparseStorageTests.cpp
unotest/unit_tests/CSCSparseStorageTests.cpp
unotest/unit_tests/MatrixVectorProductTests.cpp
unotest/unit_tests/RangeTests.cpp
unotest/unit_tests/ScalarMultipleTests.cpp
unotest/unit_tests/SparseVectorTests.cpp
unotest/unit_tests/SumTests.cpp
unotest/unit_tests/VectorTests.cpp
unotest/unit_tests/VectorViewTests.cpp
)

#########################
Expand Down Expand Up @@ -110,7 +110,7 @@ else()
endif()
if(HSL OR MA57)
list(APPEND UNO_SOURCE_FILES uno/solvers/MA57/MA57Solver.cpp)
list(APPEND TESTS_UNO_SOURCE_FILES unotest/MA57SolverTests.cpp)
list(APPEND TESTS_UNO_SOURCE_FILES unotest/functional_tests/MA57SolverTests.cpp)

find_package(BLAS REQUIRED)
list(APPEND LIBRARIES ${BLAS_LIBRARIES})
Expand Down Expand Up @@ -139,7 +139,7 @@ if(NOT HIGHS)
message(WARNING "Optional library HiGHS was not found.")
else()
list(APPEND UNO_SOURCE_FILES uno/solvers/HiGHS/HiGHSSolver.cpp)
list(APPEND TESTS_UNO_SOURCE_FILES unotest/HiGHSSolverTests.cpp)
list(APPEND TESTS_UNO_SOURCE_FILES unotest/functional_tests/HiGHSSolverTests.cpp)
link_to_uno(highs ${HIGHS})
list(APPEND LIBRARIES highs::highs)
endif()
Expand All @@ -150,7 +150,7 @@ if(NOT MUMPS_LIBRARY)
message(WARNING "Optional library MUMPS was not found.")
else()
list(APPEND UNO_SOURCE_FILES uno/solvers/MUMPS/MUMPSSolver.cpp)
list(APPEND TESTS_UNO_SOURCE_FILES unotest/MUMPSSolverTests.cpp)
list(APPEND TESTS_UNO_SOURCE_FILES unotest/functional_tests/MUMPSSolverTests.cpp)
list(APPEND LIBRARIES ${MUMPS_LIBRARY} ${MUMPS_COMMON_LIBRARY} ${MUMPS_PORD_LIBRARY})

list(APPEND DIRECTORIES ${MUMPS_INCLUDE_DIR})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ TEST(HiGHSSolver, DocumentationLP) {
highs_solver.solve_LP(number_variables, number_constraints, variables_lower_bounds, variables_upper_bounds, constraints_lower_bounds,
constraints_upper_bounds, linear_objective, constraint_jacobian, initial_point, direction, warmstart_information);

ASSERT_EQ(direction.status, SubproblemStatus::OPTIMAL);

const double tolerance = 1e-8;
// check primals
const std::vector<double> primals_reference{0.5, 2.25};
Expand All @@ -69,4 +71,4 @@ TEST(HiGHSSolver, DocumentationLP) {
EXPECT_NEAR(direction.multipliers.lower_bounds[index], lower_bound_duals_reference[index], tolerance);
EXPECT_NEAR(direction.multipliers.upper_bounds[index], upper_bound_duals_reference[index], tolerance);
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading