From b70726f4c026375f87cf70153ca14386841f0db7 Mon Sep 17 00:00:00 2001 From: Jan Breuer Date: Thu, 12 Dec 2024 11:10:14 +0100 Subject: [PATCH] Add testrunner to CI and CI flags to tests --- .github/workflows/ci.yml | 8 ++++++-- test/BesselZeros.cpp | 2 +- test/DinisExpansion.cpp | 4 ++-- test/DurbinsMethod.cpp | 4 ++-- test/EstimateTests.cpp | 28 ++++++++++++++-------------- test/ExpInt.cpp | 2 +- test/GRM2D.cpp | 4 ++-- test/SystemTests.cpp | 8 ++++---- 8 files changed, 32 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1bbee8d..827e897 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ on: type: string jobs: - build: + ubuntu-latest: runs-on: ubuntu-latest steps: @@ -53,7 +53,7 @@ jobs: -DCMAKE_CXX_COMPILER=g++ \ -DCMAKE_C_COMPILER=gcc \ -DUSE_FADBAD=ON \ - -DENABLE_TESTS=OFF \ + -DENABLE_TESTS=ON \ .. - name: Build @@ -67,3 +67,7 @@ jobs: - name: Verify installation run: | ./build/install/bin/casema-cli --version + + - name: Run the tests + run: | + ./build/test/testRunner [CI] diff --git a/test/BesselZeros.cpp b/test/BesselZeros.cpp index c62a67f..49a9358 100644 --- a/test/BesselZeros.cpp +++ b/test/BesselZeros.cpp @@ -28,7 +28,7 @@ namespace } } -TEST_CASE("Bessel zeros", "[Bessel]") +TEST_CASE("Bessel zeros", "[Bessel],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(100)); diff --git a/test/DinisExpansion.cpp b/test/DinisExpansion.cpp index a50e416..1c9a9a1 100644 --- a/test/DinisExpansion.cpp +++ b/test/DinisExpansion.cpp @@ -44,7 +44,7 @@ namespace } } -TEST_CASE("Dini's expansion (r^2)", "[Bessel]") +TEST_CASE("Dini's expansion (r^2)", "[Bessel],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(64)); @@ -69,7 +69,7 @@ TEST_CASE("Dini's expansion (r^2)", "[Bessel]") } } -TEST_CASE("Dini's expansion (1-r^2)^-1", "[Bessel]") +TEST_CASE("Dini's expansion (1-r^2)^-1", "[Bessel],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(64)); diff --git a/test/DurbinsMethod.cpp b/test/DurbinsMethod.cpp index 6dc8e72..1fc5c09 100644 --- a/test/DurbinsMethod.cpp +++ b/test/DurbinsMethod.cpp @@ -19,7 +19,7 @@ #include -TEST_CASE("Inverse Laplace exp(-2 * sqrt(s)) single", "[Durbin]") +TEST_CASE("Inverse Laplace exp(-2 * sqrt(s)) single", "[Durbin],[CI]") { const std::size_t precision = 50; mpfr::mpreal::set_default_prec(mpfr::digits2bits(precision)); @@ -76,7 +76,7 @@ TEST_CASE("Inverse Laplace exp(-2 * sqrt(s)) single", "[Durbin]") } } -TEST_CASE("Inverse Laplace exp(-2 * sqrt(s)) two outlets", "[Durbin]") +TEST_CASE("Inverse Laplace exp(-2 * sqrt(s)) two outlets", "[Durbin],[CI]") { const std::size_t precision = 50; mpfr::mpreal::set_default_prec(mpfr::digits2bits(precision)); diff --git a/test/EstimateTests.cpp b/test/EstimateTests.cpp index 9b9afd2..8156b78 100644 --- a/test/EstimateTests.cpp +++ b/test/EstimateTests.cpp @@ -216,7 +216,7 @@ namespace } } -TEST_CASE("Time domain upper bound linear chain GRM", "[Estimate]") +TEST_CASE("Time domain upper bound linear chain GRM", "[Estimate],[GRM],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(20)); @@ -239,7 +239,7 @@ TEST_CASE("Time domain upper bound linear chain GRM", "[Estimate]") CHECK(sys->timeDomainUpperBound() == cIn); } -TEST_CASE("Time domain upper bound linear chain 2xGRM", "[Estimate]") +TEST_CASE("Time domain upper bound linear chain 2xGRM", "[Estimate],[GRM],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(20)); @@ -266,7 +266,7 @@ TEST_CASE("Time domain upper bound linear chain 2xGRM", "[Estimate]") CHECK(sys->timeDomainUpperBound() == cIn); } -TEST_CASE("Time domain upper bound DAG GRM", "[Estimate]") +TEST_CASE("Time domain upper bound DAG GRM", "[Estimate],[GRM],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(20)); @@ -301,7 +301,7 @@ TEST_CASE("Time domain upper bound DAG GRM", "[Estimate]") CHECK(abs(sys->timeDomainUpperBound() - std::max(cIn, cIn2)) <= mpfr::mpreal("1e-10")); } -TEST_CASE("Time domain upper bound DAG CSTR", "[Estimate]") +TEST_CASE("Time domain upper bound DAG CSTR", "[Estimate],[GRM],[CSTR],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(20)); @@ -336,7 +336,7 @@ TEST_CASE("Time domain upper bound DAG CSTR", "[Estimate]") CHECK(abs(sys->timeDomainUpperBound() - std::max(cIn, cIn2)) <= mpfr::mpreal("1e-10")); } -TEST_CASE("Estimate vs inverse GRM", "[Estimate][Unit]") +TEST_CASE("Estimate vs inverse GRM", "[Estimate],[Unit],[GRM],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(40)); @@ -376,7 +376,7 @@ TEST_CASE("Estimate vs inverse GRM", "[Estimate][Unit]") } } -TEST_CASE("Estimate vs inverse CSTR", "[Estimate][Unit]") +TEST_CASE("Estimate vs inverse CSTR", "[Estimate],[Unit],[CSTR],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(40)); @@ -416,7 +416,7 @@ TEST_CASE("Estimate vs inverse CSTR", "[Estimate][Unit]") } } -TEST_CASE("Truncation error DAG GRM", "[Estimate]") +TEST_CASE("Truncation error DAG GRM", "[Estimate],[GRM],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(20)); @@ -471,7 +471,7 @@ TEST_CASE("Truncation error DAG GRM", "[Estimate]") CHECK(abs((truncErr - ref) / ref) <= mpfr::mpreal("1e-16")); } -TEST_CASE("Truncation error DAG CSTR", "[Estimate]") +TEST_CASE("Truncation error DAG CSTR", "[Estimate],[CSTR],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(20)); @@ -526,7 +526,7 @@ TEST_CASE("Truncation error DAG CSTR", "[Estimate]") CHECK(abs((truncErr - ref) / ref) <= mpfr::mpreal("1e-16")); } -TEST_CASE("Truncation error DAG GRM-CSTR", "[Estimate]") +TEST_CASE("Truncation error DAG GRM-CSTR", "[Estimate],[GRM],[CSTR],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(20)); @@ -581,7 +581,7 @@ TEST_CASE("Truncation error DAG GRM-CSTR", "[Estimate]") CHECK(abs((truncErr - ref) / ref) <= mpfr::mpreal("1e-16")); } -TEST_CASE("Truncation error two chains", "[Estimate]") +TEST_CASE("Truncation error two chains", "[Estimate],[GRM],[CSTR],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(20)); @@ -635,7 +635,7 @@ TEST_CASE("Truncation error two chains", "[Estimate]") CHECK(abs((truncErr - ref) / ref) <= mpfr::mpreal("1e-16")); } -TEST_CASE("Error estimate DAG GRM", "[Estimate]") +TEST_CASE("Error estimate DAG GRM", "[Estimate],[GRM],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(30)); @@ -680,7 +680,7 @@ TEST_CASE("Error estimate DAG GRM", "[Estimate]") CHECK(consError + exp(2 * abscissa * T) / T * truncErr <= error); } -TEST_CASE("Error estimate DAG CSTR", "[Estimate]") +TEST_CASE("Error estimate DAG CSTR", "[Estimate],[CSTR],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(30)); @@ -725,7 +725,7 @@ TEST_CASE("Error estimate DAG CSTR", "[Estimate]") CHECK(consError + exp(2 * abscissa * T) / T * truncErr <= error); } -TEST_CASE("Error estimate DAG GRM-CSTR", "[Estimate]") +TEST_CASE("Error estimate DAG GRM-CSTR", "[Estimate],[GRM],[CSTR],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(30)); @@ -770,7 +770,7 @@ TEST_CASE("Error estimate DAG GRM-CSTR", "[Estimate]") CHECK(consError + exp(2 * abscissa * T) / T * truncErr <= error); } -TEST_CASE("Error estimate two chains", "[Estimate]") +TEST_CASE("Error estimate two chains", "[Estimate],[GRM],[CSTR],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(30)); diff --git a/test/ExpInt.cpp b/test/ExpInt.cpp index 2af31d5..b29f224 100644 --- a/test/ExpInt.cpp +++ b/test/ExpInt.cpp @@ -27,7 +27,7 @@ namespace } } -TEST_CASE("ExpInt and inverseExpInt", "[ExpInt]") +TEST_CASE("ExpInt and inverseExpInt", "[ExpInt],[CI]") { // Test with 16, 32, 64 digits precision int prec = 16; diff --git a/test/GRM2D.cpp b/test/GRM2D.cpp index 3d360fc..35f9bf8 100644 --- a/test/GRM2D.cpp +++ b/test/GRM2D.cpp @@ -132,7 +132,7 @@ namespace } } -TEST_CASE("GRM vs GRM2D single zone", "[Bessel][GRM]") +TEST_CASE("GRM vs GRM2D single zone", "[Bessel],[GRM],[2DGRM],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(30)); @@ -180,7 +180,7 @@ TEST_CASE("GRM vs GRM2D single zone", "[Bessel][GRM]") CHECK((g1-g2).array().abs().maxCoeff() <= 500 * std::numeric_limits::epsilon()); } -TEST_CASE("GRM vs GRM2D two zones", "[Bessel][GRM]") +TEST_CASE("GRM vs GRM2D two zones", "[Bessel],[GRM],[2DGRM],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(30)); diff --git a/test/SystemTests.cpp b/test/SystemTests.cpp index c869462..c0b860b 100644 --- a/test/SystemTests.cpp +++ b/test/SystemTests.cpp @@ -192,7 +192,7 @@ namespace } } -TEST_CASE("Joint system solution single port units", "[System]") +TEST_CASE("Joint system solution single port units", "[System],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(30)); @@ -240,7 +240,7 @@ TEST_CASE("Joint system solution single port units", "[System]") CHECK(abs(solL[i] - solJ[i]) <= 10 * std::numeric_limits::epsilon()); } -TEST_CASE("Joint system solution two chains single port", "[System]") +TEST_CASE("Joint system solution two chains single port", "[System],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(30)); @@ -287,7 +287,7 @@ TEST_CASE("Joint system solution two chains single port", "[System]") CHECK(abs(solL[i] - solJ[i]) <= 10 * std::numeric_limits::epsilon()); } -TEST_CASE("Joint system solution multiple ports", "[System]") +TEST_CASE("Joint system solution multiple ports", "[System],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(30)); @@ -351,7 +351,7 @@ TEST_CASE("Joint system solution multiple ports", "[System]") CHECK(abs(solL[i] - solJ[i]) <= 10 * std::numeric_limits::epsilon()); } -TEST_CASE("Joint system solution multiple ports single out", "[System]") +TEST_CASE("Joint system solution multiple ports single out", "[System],[CI]") { mpfr::mpreal::set_default_prec(mpfr::digits2bits(30));