diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 734f6a896..943441b35 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,7 @@ variables: GIT_SUBMODULE_STRATEGY: recursive SPINER_GCC_VERSION: "9.3.0" SPINER_CUDA_VERSION: "11.6.0" - SPINER_SPACK_SPEC: "spiner@main+python%gcc@${SPINER_GCC_VERSION}" + SPINER_SPACK_SPEC: "spiner@main+python+test%gcc@${SPINER_GCC_VERSION}" COLOR_CYAN: "\e[1;36m" COLOR_PLAIN: "\e[0m" # set to different spack upstream for testing diff --git a/spack-repo/packages/spiner/package.py b/spack-repo/packages/spiner/package.py index e34fd43fb..b6f730fb5 100644 --- a/spack-repo/packages/spiner/package.py +++ b/spack-repo/packages/spiner/package.py @@ -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("cmake@3.12:", when="@:1.5.1") depends_on("cmake@3.19:", when="@1.6.0:") - depends_on("catch2@2.13.4:2.13.9") + depends_on("catch2@3.0.1:", when="@main +test") + depends_on("catch2@2.13.4:2.13.9", when="@:1.6.2 +test") depends_on("ports-of-call@1.2.0:", when="@:1.5.1") depends_on("ports-of-call@1.5.1:", when="@1.6.0:") depends_on("ports-of-call@main", when="@main") diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index bb84c5c5e..efb63dd6e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -12,7 +12,8 @@ spiner_content_declare(Catch2 GIT_REPO https://github.com/catchorg/Catch2.git - GIT_TAG v2.13.7 + GIT_TAG v3.0.1 # or any later release + EXPECTED_TARGETS Catch2::Catch2 NAMESPACE spinerTest ) diff --git a/test/test.cpp b/test/test.cpp index f6b8edb62..d6c28a990 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -29,8 +29,8 @@ #include "hdf5_hl.h" #endif -#define CATCH_CONFIG_RUNNER -#include "catch2/catch.hpp" +#include +#include using DataBox = Spiner::DataBox; using Spiner::IndexType;