mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
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:
@@ -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."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user