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

update catch2 v2 to catch2 v3 #328

Merged
merged 3 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,8 @@ if(SINGULARITY_BUILD_TESTS)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
# MAUNEYC: On my side, this version works. The ones pinned onto upstream
# codes do not like to play with clang and/or newer compilers.
GIT_TAG v2.13.7)
# or later is fine too
GIT_TAG v3.0.1)
FetchContent_MakeAvailable(Catch2)
list(APPEND CMAKE_MODULE_PATH ${Catch2_SOURCE_DIR}/contrib)
endif()
Expand Down
3 changes: 2 additions & 1 deletion spack-repo/packages/singularity-eos/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ class SingularityEos(CMakePackage, CudaPackage):

# building/testing/docs
depends_on("[email protected]:")
depends_on("[email protected]", when="+tests")
depends_on("[email protected]:", when="@main +tests")
depends_on("[email protected]", when="@:1.8.0 +tests")
depends_on("python@3:", when="+python")
depends_on("py-numpy", when="+python+tests")
depends_on("[email protected]:", when="+python")
Expand Down
5 changes: 4 additions & 1 deletion spack-repo/packages/spiner/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@ class Spiner(CMakePackage, CudaPackage):

variant("python", default=False, description="Python, Numpy & Matplotlib Support")

variant("test", default=False, description="Build tests")

depends_on("[email protected]:", when="@:1.5.1")
depends_on("[email protected]:", when="@1.6.0:")
depends_on("[email protected]:2.13.9")
depends_on("[email protected]:", when="@main +test")
depends_on("[email protected]:2.13.9", when="@:1.6.2 +test")
depends_on("[email protected]:", when="@:1.5.1")
depends_on("[email protected]:", when="@1.6.0:")
depends_on("ports-of-call@main", when="@main")
Expand Down
7 changes: 1 addition & 6 deletions test/catch2_define.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,9 @@
// publicly and display publicly, and to permit others to do so.
//------------------------------------------------------------------------------

#include <catch2/catch_session.hpp>
#include <ports-of-call/portability.hpp>

#ifndef CATCH_CONFIG_RUNNER
#define CATCH_CONFIG_RUNNER
#define CATCH_CONFIG_FAST_COMPILE
#include "catch2/catch.hpp"
#endif

int main(int argc, char *argv[]) {

#ifdef PORTABILITY_STRATEGY_KOKKOS
Expand Down
2 changes: 1 addition & 1 deletion test/eos_unit_test_helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#ifndef CATCH_CONFIG_FAST_COMPILE
#define CATCH_CONFIG_FAST_COMPILE
#include "catch2/catch.hpp"
#include <catch2/catch_test_macros.hpp>
#endif
#include <cmath>
#include <cstdio>
Expand Down
6 changes: 2 additions & 4 deletions test/test_eos_gruneisen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <limits>
#ifndef CATCH_CONFIG_FAST_COMPILE
#define CATCH_CONFIG_FAST_COMPILE
#include "catch2/catch.hpp"
#include <catch2/catch_test_macros.hpp>
#endif

#include <singularity-eos/base/constants.hpp>
Expand Down Expand Up @@ -56,9 +56,7 @@ SCENARIO("Gruneisen EOS entropy is disabled", "[GruneisenEOS][Entropy]") {
EOS host_eos = Gruneisen(C0, S1, S2, S3, Gamma0, b, rho0, T0, P0, Cv);
EOS eos = host_eos.GetOnDevice();
THEN("A call to the entropy should throw an exception") {
using Catch::Matchers::Contains;
auto msg_matcher = Contains("Entropy is not enabled");
REQUIRE_THROWS_WITH(eos.EntropyFromDensityTemperature(1.0, 1.0), msg_matcher);
REQUIRE_THROWS(eos.EntropyFromDensityTemperature(1.0, 1.0));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/test_eos_helmholtz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#ifndef CATCH_CONFIG_FAST_COMPILE
#define CATCH_CONFIG_FAST_COMPILE
#include "catch2/catch.hpp"
#include <catch2/catch_test_macros.hpp>
#endif

#include <ports-of-call/portability.hpp>
Expand Down
2 changes: 1 addition & 1 deletion test/test_eos_ideal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#ifndef CATCH_CONFIG_FAST_COMPILE
#define CATCH_CONFIG_FAST_COMPILE
#include "catch2/catch.hpp"
#include <catch2/catch_test_macros.hpp>
#endif

#include <test/eos_unit_test_helpers.hpp>
Expand Down
2 changes: 1 addition & 1 deletion test/test_eos_modifiers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#ifndef CATCH_CONFIG_FAST_COMPILE
#define CATCH_CONFIG_FAST_COMPILE
#include "catch2/catch.hpp"
#include <catch2/catch_test_macros.hpp>
#endif

#include <test/eos_unit_test_helpers.hpp>
Expand Down
2 changes: 1 addition & 1 deletion test/test_eos_noble_abel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <limits>
#ifndef CATCH_CONFIG_FAST_COMPILE
#define CATCH_CONFIG_FAST_COMPILE
#include "catch2/catch.hpp"
#include <catch2/catch_test_macros.hpp>
#endif

#include <singularity-eos/base/constants.hpp>
Expand Down
2 changes: 1 addition & 1 deletion test/test_eos_sap_polynomial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <limits>
#ifndef CATCH_CONFIG_FAST_COMPILE
#define CATCH_CONFIG_FAST_COMPILE
#include "catch2/catch.hpp"
#include <catch2/catch_test_macros.hpp>
#endif

#include <singularity-eos/base/constants.hpp>
Expand Down
2 changes: 1 addition & 1 deletion test/test_eos_stellar_collapse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#ifndef CATCH_CONFIG_FAST_COMPILE
#define CATCH_CONFIG_FAST_COMPILE
#include "catch2/catch.hpp"
#include <catch2/catch_test_macros.hpp>
#endif

#include <test/eos_unit_test_helpers.hpp>
Expand Down
2 changes: 1 addition & 1 deletion test/test_eos_stiff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <cstdlib>
#ifndef CATCH_CONFIG_FAST_COMPILE
#define CATCH_CONFIG_FAST_COMPILE
#include "catch2/catch.hpp"
#include <catch2/catch_test_macros.hpp>
#endif

#include <singularity-eos/base/constants.hpp>
Expand Down
2 changes: 1 addition & 1 deletion test/test_eos_tabulated.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#ifndef CATCH_CONFIG_FAST_COMPILE
#define CATCH_CONFIG_FAST_COMPILE
#include "catch2/catch.hpp"
#include <catch2/catch_test_macros.hpp>
#endif

#include <test/eos_unit_test_helpers.hpp>
Expand Down
2 changes: 1 addition & 1 deletion test/test_eos_vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#ifndef CATCH_CONFIG_FAST_COMPILE
#define CATCH_CONFIG_FAST_COMPILE
#include "catch2/catch.hpp"
#include <catch2/catch_test_macros.hpp>
#endif

#include <test/eos_unit_test_helpers.hpp>
Expand Down
2 changes: 1 addition & 1 deletion test/test_eos_vinet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <cstdlib>
#ifndef CATCH_CONFIG_FAST_COMPILE
#define CATCH_CONFIG_FAST_COMPILE
#include "catch2/catch.hpp"
#include <catch2/catch_test_macros.hpp>
#endif

#include <ports-of-call/portability.hpp>
Expand Down
2 changes: 1 addition & 1 deletion test/test_math_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#ifndef CATCH_CONFIG_FAST_COMPILE
#define CATCH_CONFIG_FAST_COMPILE
#include "catch2/catch.hpp"
#include <catch2/catch_test_macros.hpp>
#endif

#include <test/eos_unit_test_helpers.hpp>
Expand Down
2 changes: 1 addition & 1 deletion test/test_variadic_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#ifndef CATCH_CONFIG_FAST_COMPILE
#define CATCH_CONFIG_FAST_COMPILE
#include "catch2/catch.hpp"
#include <catch2/catch_test_macros.hpp>
#endif

using singularity::Gruneisen;
Expand Down
Loading