Skip REFPROP tests when not available during CI (#2710)

* Try loading REFPROP backend and only warn on failure
* Skip REFPROP related tests when not available using a single helper routine in CoolProp:: namespace
This commit is contained in:
Jeff Henning
2026-04-09 21:12:20 -04:00
committed by GitHub
parent 61351d449c
commit 775e1d49a6
6 changed files with 43 additions and 1 deletions

View File

@@ -1044,8 +1044,18 @@ TEST_CASE("Check AbstractState", "[AbstractState]") {
SECTION("good backend - incomp") {
CHECK_NOTHROW(shared_ptr<CoolProp::AbstractState>(CoolProp::AbstractState::factory("INCOMP", "DEB")));
}
// SECTION("good backend - REFPROP") {
// CHECK_NOTHROW(shared_ptr<CoolProp::AbstractState>(CoolProp::AbstractState::factory("REFPROP", "Water")));
// }
// Code below lets the test suite continue with REFPROP isn't present while still reporting a visile warning from CATCH2
SECTION("good backend - REFPROP") {
CHECK_NOTHROW(shared_ptr<CoolProp::AbstractState>(CoolProp::AbstractState::factory("REFPROP", "Water")));
try {
auto s = shared_ptr<CoolProp::AbstractState>(CoolProp::AbstractState::factory("REFPROP", "Water"));
CHECK(s); // assert we got a non-null pointer when REFPROP is present
}
catch (const std::exception& e) {
WARN(std::string("REFPROP backend unavailable. All tests requiring REFPROP will be skipped."));
}
}
}