Changeset 8786
- Timestamp:
- Mar 28, 2013, 6:14:52 PM (12 years ago)
- Location:
- trunk/anuga_core
- Files:
-
- 3 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga_validation_tests/Case_studies/Okushiri/run_okushiri.py
r8694 r8786 49 49 print 'set stage' 50 50 if elevation_in_mesh is False: 51 print 'start '52 51 domain.set_quantity('elevation', 53 52 filename=project.bathymetry_filename, … … 55 54 verbose=True, 56 55 use_cache=False) 57 print 'end'58 56 59 57 -
trunk/anuga_core/source/anuga_validation_tests/Case_studies/Okushiri/validate_okushiri.py
r8676 r8786 1 """Automatic verification that the ANUGA code validates against the okushiri2 dataset as expected. See anuga_validation/okushiri_2005for more details1 """Automatic verification of ANUGA flows. 2 See functions exercised by this wrapper for more details 3 3 """ 4 4 5 5 import unittest 6 6 import os 7 import numpy 8 import anuga 7 9 10 indent = anuga.indent 8 11 9 class Test_Okushiri(unittest.TestCase): 12 verbose = True 13 14 class Test_results(unittest.TestCase): 10 15 def setUp(self): 11 12 # Remove garbage 13 for file in os.listdir('.'): 16 for file in os.listdir('.'): 14 17 if file.endswith('.stdout') or\ 15 18 file.endswith('.sww') or\ 16 file.endswith('.msh'): 19 file.endswith('.msh') or\ 20 file.endswith('.png'): 17 21 os.remove(file) 18 22 19 23 20 24 def tearDown(self): 21 25 pass 22 26 23 def test_that_output_is_as_expected(self): 24 """Test that ANUGA replicates physics of the Okushiri Island 25 wave tank experiment 26 """ 27 28 #print 27 def test_simulation(self): 28 29 30 if verbose: 31 print 32 print indent+'Running create mesh script' 33 29 34 s = 'create_okushiri.py' 30 #print s 31 res = os.system('python %s > create_okushiri.stdout' %s) 32 assert res == 0 33 34 s = 'run_okushiri.py' 35 #print s 36 res = os.system('python %s > run_okushiri.stdout' %s) 37 assert res == 0 38 39 40 s = 'compare_timeseries_with_measures.py' 41 #print s 42 res = os.system('python %s > compare_timeseries_with_measures.stdout'\ 43 %s) 35 res = os.system('python %s > validate_create.stdout' %s) 36 # Test that script runs ok 44 37 assert res == 0 45 38 46 39 47 def test_caching_of_set_quantity(self):48 """Test that caching of set_quantity works49 """ 50 51 s = 'create_okushiri.py'52 res = os.system('python %s > create_okushiri_for_caching.stdout' %s)40 if verbose: 41 print indent+'Running simulation script' 42 43 s = 'run_okushiri.py' 44 res = os.system('python %s > validate_run.stdout' %s) 45 # Test that script runs ok 53 46 assert res == 0 54 47 55 48 56 s = 'test_caching_of_set_quantity.py' 57 res = os.system('python %s > test_caching_of_set_quantity.stdout' %s) 49 50 if verbose: 51 print indent+'Running test script' 52 53 s = 'compare_timeseries_with_measures.py' 54 res = os.system('python %s > validate_test.stdout' %s) 55 # Test that script runs ok 58 56 assert res == 0 59 57 60 58 61 59 62 def manual_test_that_output_is_as_expected(self):63 from run_okushiri import main64 from create_okushiri import create_mesh65 66 # Note, this has not been tested when code is failing.67 # Next step, use the parrameter elevation_in_mesh68 # and only run create_okishiri once for speed.69 70 res = create_mesh()71 assert res == None72 73 res = main()74 assert res == None75 76 s = 'compare_timeseries_with_measures.py'77 #print s78 res = os.system('python %s > compare_timeseries_with_measures.stdout'\79 %s)80 assert res == 081 82 60 83 61 #------------------------------------------------------------- 84 if __name__ == "__main__":85 suite = unittest.makeSuite(Test_ Okushiri, 'test')62 if __name__ == '__main__': 63 suite = unittest.makeSuite(Test_results, 'test') 86 64 runner = unittest.TextTestRunner(verbosity=2) 87 65 runner.run(suite)
Note: See TracChangeset
for help on using the changeset viewer.