Skip to content

Commit

Permalink
[Test] Break out thermo consistency tests into a separate test set
Browse files Browse the repository at this point in the history
  • Loading branch information
speth authored and ischoegl committed Jun 13, 2023
1 parent 13cb334 commit f84e863
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions test/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ addTestProgram('general', 'general')
addTestProgram('kinetics', 'kinetics')
addTestProgram('oneD', 'oneD')
addTestProgram('thermo', 'thermo')
addTestProgram('thermo_consistency', 'thermo-consistency')
addTestProgram('transport', 'transport')
addTestProgram('zeroD', 'zeroD')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is part of Cantera. See License.txt in the top-level directory or
// at https://cantera.org/license.txt for license and copyright information.

#include "gtest/gtest.h"
#include "cantera/thermo/ThermoPhase.h"
#include "cantera/thermo/PlasmaPhase.h"
Expand Down Expand Up @@ -27,9 +30,7 @@
// definition.

using namespace std;

namespace Cantera
{
using namespace Cantera;

// Helper functions to reduce code duplication in test suite instantiations
vector<AnyMap> getStates(const string& name) {
Expand All @@ -42,6 +43,8 @@ AnyMap getSetup(const string& name) {
return cases[name]["setup"].as<AnyMap>();
}

namespace Cantera {

// For more informative output about failing test cases
std::ostream& operator<<(std::ostream& s, const AnyMap& m)
{
Expand All @@ -59,6 +62,8 @@ std::ostream& operator<<(std::ostream& s, const AnyMap& m)
return s;
}

} // end namespace Cantera

class TestConsistency : public testing::TestWithParam<std::tuple<AnyMap, AnyMap>>
{
public:
Expand Down Expand Up @@ -844,4 +849,12 @@ INSTANTIATE_TEST_SUITE_P(HMWSoln, TestConsistency,
testing::ValuesIn(getStates("HMW-electrolyte")))
);

int main(int argc, char** argv)
{
printf("Running main() from consistency.cpp\n");
testing::InitGoogleTest(&argc, argv);
Cantera::make_deprecation_warnings_fatal();
int result = RUN_ALL_TESTS();
Cantera::appdelete();
return result;
}

0 comments on commit f84e863

Please sign in to comment.