From 70c71b5448ba3aa75a30ef20803f0799dc82b9ee Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 14 Dec 2011 05:55:05 +0000 Subject: [PATCH] SCons can now run most of the tests in the test_problems directory Does not yet handle tests with multiple outputs or tests requiring additional command line arguments. --- test_problems/SConscript | 85 +++++++++++- test_problems/fracCoeff/frac_blessed.xml | 157 ----------------------- 2 files changed, 84 insertions(+), 158 deletions(-) delete mode 100644 test_problems/fracCoeff/frac_blessed.xml diff --git a/test_problems/SConscript b/test_problems/SConscript index e4c6a30b3..19fecacb5 100644 --- a/test_problems/SConscript +++ b/test_problems/SConscript @@ -3,6 +3,8 @@ from buildutils import * Import('env','buildTargets','installTargets') localenv = env.Clone() +os.environ['PYTHONPATH'] = pjoin(os.getcwd(), '..','Cantera','python') + class Test(object): def __init__(self, subdir, programName, blessedName, arguments=(), @@ -87,7 +89,88 @@ tests = [Test(pjoin('cathermo', 'DH_graph_1'), 'HMW_graph_GvT', 'output_blessed.txt', extensions=['^HMW_graph_GvT.cpp', '^sortAlgorithms.cpp'], - arguments='HMW_NaCl_sp1977_alt.xml') + arguments='HMW_NaCl_sp1977_alt.xml'), + Test(pjoin('cathermo', 'HMW_graph_HvT'), + 'HMW_graph_HvT', + 'output_blessed.txt', + extensions=['^HMW_graph_HvT.cpp', '^sortAlgorithms.cpp'], + arguments='HMW_NaCl_sp1977_alt.xml'), + Test(pjoin('cathermo', 'HMW_graph_VvT'), + 'HMW_graph_VvT', + 'output_blessed.txt', + extensions=['^HMW_graph_VvT.cpp', '^sortAlgorithms.cpp'], + arguments='HMW_NaCl_sp1977_alt.xml'), + Test(pjoin('cathermo', 'HMW_test_1'), + 'HMW_test_1', + 'output_noD_blessed.txt'), + Test(pjoin('cathermo', 'HMW_test_3'), + 'HMW_test_3', + 'output_noD_blessed.txt'), + Test(pjoin('cathermo', 'ims'), + 'IMSTester', + 'output_blessed.txt'), + Test(pjoin('cathermo', 'issp'), + 'ISSPTester', + 'output_blessed.txt'), + Test(pjoin('cathermo', 'stoichSubSSTP'), + 'stoichSubSSTP', + 'output_blessed.txt'), + Test(pjoin('cathermo', 'testIAPWS'), + 'testIAPWSphi', + 'output_blessed.txt'), + Test(pjoin('cathermo', 'testIAPWSPres'), + 'testIAPWSPres', + 'output_blessed.txt'), + Test(pjoin('cathermo', 'testIAPWSTripP'), + 'testIAPWSTripP', + 'output_blessed.txt'), + Test(pjoin('cathermo', 'testWaterPDSS'), + 'testWaterPDSS', + 'output_blessed.txt'), + Test(pjoin('cathermo', 'testWaterTP'), + 'testWaterSSTP', + 'output_blessed.txt'), + Test(pjoin('cathermo', 'VPissp'), + 'ISSPTester2', + 'output_blessed.txt'), + Test(pjoin('cathermo', 'wtWater'), + 'wtWater', + 'output_blessed.txt'), + Test('ChemEquil_gri_matrix', 'gri_matrix', 'output_blessed.txt'), + Test('ChemEquil_gri_pairs', 'gri_pairs', 'output_blessed.txt'), + Test('ChemEquil_ionizedGas', 'ionizedGasEquil', + 'output_blessed.txt', + artifacts=['table.csv']), # needs .csv comparison + Test('ChemEquil_red1', 'basopt_red1', 'output_blessed.txt'), + # Skipping ck2cti_test because of automatically generated file + Test('CpJump', 'CpJump', 'output_blessed.txt'), + # Skipping cxx_ex because of complicated behavior + Test('diamondSurf', 'runDiamond', 'runDiamond_blessed.out'), + Test('fracCoeff', 'fracCoeff', 'frac_blessed.out'), + # skipping min_python + Test('mixGasTransport', 'mixGasTransport', 'output_blessed.txt'), + Test('multiGasTransport', 'multiGasTransport', 'output_blessed.txt'), + Test('NASA9poly_test', 'NASA9poly_test', 'output_blessed.txt'), + # skipping nasa9_reader because of automatically generated file + Test('negATest', 'negATest', 'negATest_blessed.out'), + Test('printUtilUnitTest', 'pUtest', 'output_blessed.txt'), + Test('pureFluidTest', 'testPureWater', 'output_blessed.txt'), + # skipping python + Test('rankine_democxx', 'rankine', 'output_blessed.txt', + artifacts=['liquidvapor.xml']), + Test('silane_equil', 'silane_equi', 'output_blessed.txt'), + # spectroscopy is incomplete + Test('surfkin', 'surfdemo', 'output_blessed.txt'), + Test('surfSolverTest', 'surfaceSolver', + 'surfaceSolver_blessed.out', + arguments='haca2.xml', + artifacts=['results.txt', 'diamond.xml'], + extensions=['^surfaceSolver.cpp']), # needs .csv, extra tests +# # Disabled because of need for command line arguments +# Test(pjoin('VCSnonideal', 'NaCl_equil'), +# 'nacl_equil', +# 'good_out.txt'), # needs .csv diff + Test('VPsilane_test', 'VPsilane_test', 'output_blessed.txt') ] env.Alias('test', [test.run(localenv) for test in tests]) diff --git a/test_problems/fracCoeff/frac_blessed.xml b/test_problems/fracCoeff/frac_blessed.xml deleted file mode 100644 index 8b09e3c3c..000000000 --- a/test_problems/fracCoeff/frac_blessed.xml +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - O H - H2 H O O2 OH H2O - - - 300.0 - 101325.0 - - - - - - - - - - - - H:2 - - - - 2.344331120E+00, 7.980520750E-03, -1.947815100E-05, 2.015720940E-08, - -7.376117610E-12, -9.179351730E+02, 6.830102380E-01 - - - - 3.337279200E+00, -4.940247310E-05, 4.994567780E-07, -1.795663940E-10, - 2.002553760E-14, -9.501589220E+02, -3.205023310E+00 - - - - - - - H:1 - - - - 2.500000000E+00, 7.053328190E-13, -1.995919640E-15, 2.300816320E-18, - -9.277323320E-22, 2.547365990E+04, -4.466828530E-01 - - - - 2.500000010E+00, -2.308429730E-11, 1.615619480E-14, -4.735152350E-18, - 4.981973570E-22, 2.547365990E+04, -4.466829140E-01 - - - - - - - O:1 - - - - 3.168267100E+00, -3.279318840E-03, 6.643063960E-06, -6.128066240E-09, - 2.112659710E-12, 2.912225920E+04, 2.051933460E+00 - - - - 2.569420780E+00, -8.597411370E-05, 4.194845890E-08, -1.001777990E-11, - 1.228336910E-15, 2.921757910E+04, 4.784338640E+00 - - - - - - - O:2 - - - - 3.782456360E+00, -2.996734160E-03, 9.847302010E-06, -9.681295090E-09, - 3.243728370E-12, -1.063943560E+03, 3.657675730E+00 - - - - 3.282537840E+00, 1.483087540E-03, -7.579666690E-07, 2.094705550E-10, - -2.167177940E-14, -1.088457720E+03, 5.453231290E+00 - - - - - - - H:1 O:1 - - - - 3.992015430E+00, -2.401317520E-03, 4.617938410E-06, -3.881133330E-09, - 1.364114700E-12, 3.615080560E+03, -1.039254580E-01 - - - - 3.092887670E+00, 5.484297160E-04, 1.265052280E-07, -8.794615560E-11, - 1.174123760E-14, 3.858657000E+03, 4.476696100E+00 - - - - - - - H:2 O:1 - - - - 4.198640560E+00, -2.036434100E-03, 6.520402110E-06, -5.487970620E-09, - 1.771978170E-12, -3.029372670E+04, -8.490322080E-01 - - - - 3.033992490E+00, 2.176918040E-03, -1.640725180E-07, -9.704198700E-11, - 1.682009920E-14, -3.000429710E+04, 4.966770100E+00 - - - - - - - - - H2O =] 1.4 H + 0.6 OH + 0.2 O2 - - - 1.000000E+13 - 0.0 - 0.000000 - - - H2O:1.0 - H:1.3999999999999999 O2:0.20000000000000001 OH:0.59999999999999998 - - - - - 0.7 H2 + 0.6 OH + 0.2 O2 =] H2O - 0.80000000000000004 - 1.0 - 2.0 - - - 3.981072E+04 - 0.0 - 0.000000 - - - H2:0.69999999999999996 O2:0.20000000000000001 OH:0.59999999999999998 - H2O:1.0 - - -