mirror of
https://github.com/Cantera/cantera.git
synced 2026-08-11 05:24:57 -05:00
[Test] Skip conversion tests if no Python package is being built
Converting between different mechanism formats require at least the "minimal" Python package to be built.
This commit is contained in:
committed by
Bryan W. Weber
parent
9d5c9d45e1
commit
b3f1a73663
@@ -96,6 +96,8 @@ def addTestProgram(subdir, progName, env_vars={}):
|
||||
testenv['ENV'].update(env_vars)
|
||||
if env["skip_slow_tests"]:
|
||||
testenv.Append(CPPDEFINES=["CT_SKIP_SLOW"])
|
||||
if env["python_package"] == "none":
|
||||
testenv.Append(CPPDEFINES=["CT_NO_PYTHON"])
|
||||
program = testenv.Program(pjoin(subdir, progName),
|
||||
multi_glob(testenv, subdir, 'cpp'))
|
||||
passedFile = File(pjoin(str(program[0].dir), '%s.passed' % program[0].name))
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
namespace Cantera
|
||||
{
|
||||
|
||||
#ifndef CT_NO_PYTHON
|
||||
TEST(FracCoeff, ConvertFracCoeff)
|
||||
{
|
||||
IdealGasPhase thermo1("../data/frac.cti", "gas");
|
||||
@@ -33,6 +34,7 @@ TEST(FracCoeff, ConvertFracCoeff)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
class FracCoeffTest : public testing::Test
|
||||
{
|
||||
@@ -181,11 +183,13 @@ public:
|
||||
size_t nRxn, nSpec;
|
||||
};
|
||||
|
||||
#ifndef CT_NO_PYTHON
|
||||
TEST_F(NegativePreexponentialFactor, fromCti)
|
||||
{
|
||||
setup("../data/noxNeg.cti");
|
||||
testNetProductionRates();
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST_F(NegativePreexponentialFactor, fromYaml)
|
||||
{
|
||||
|
||||
@@ -118,6 +118,7 @@ TEST(IonsFromNeutralConstructor, fromScratch)
|
||||
EXPECT_NEAR(mu[1], -2.88157316e+06, 1e-1);
|
||||
}
|
||||
|
||||
#ifndef CT_NO_PYTHON
|
||||
class CtiConversionTest : public testing::Test
|
||||
{
|
||||
public:
|
||||
@@ -177,6 +178,7 @@ TEST_F(ChemkinConversionTest, FailedConversion) {
|
||||
ASSERT_THROW(ck2cti("h2o2_missingThermo.inp"),
|
||||
CanteraError);
|
||||
}
|
||||
#endif
|
||||
|
||||
class ConstructFromScratch : public testing::Test
|
||||
{
|
||||
|
||||
@@ -200,8 +200,9 @@ CompileAndTest('CpJump', 'CpJump', 'CpJump', 'output_blessed.txt')
|
||||
|
||||
diamond = CompileAndTest('diamondSurf-yaml', 'diamondSurf', 'diamondSurf',
|
||||
'runDiamond_blessed.out', options='diamond.yaml')
|
||||
Test('diamondSurf-cti', 'diamondSurf', diamond.program, 'runDiamond_blessed.out',
|
||||
options='diamond.cti') # @TODO: remove after Cantera 2.6
|
||||
if env["python_package"] != "none":
|
||||
Test('diamondSurf-cti', 'diamondSurf', diamond.program, 'runDiamond_blessed.out',
|
||||
options='diamond.cti') # @TODO: remove after Cantera 2.6
|
||||
Test('diamondSurf-xml', 'diamondSurf', diamond.program, 'runDiamond_blessed.out',
|
||||
options='diamond.xml') # @TODO: remove after Cantera 2.6
|
||||
|
||||
|
||||
Reference in New Issue
Block a user