/[escript]/trunk/dudley/test/python/fixme_run_generators.py
ViewVC logotype

Diff of /trunk/dudley/test/python/fixme_run_generators.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 705 by gross, Thu Apr 6 00:13:40 2006 UTC revision 706 by gross, Sat Apr 8 16:13:02 2006 UTC
# Line 10  __copyright__="""  Copyright (c) 2006 by Line 10  __copyright__="""  Copyright (c) 2006 by
10                  Primary Business: Queensland, Australia"""                  Primary Business: Queensland, Australia"""
11  __license__="""Licensed under the Open Software License version 3.0  __license__="""Licensed under the Open Software License version 3.0
12               http://www.opensource.org/licenses/osl-3.0.php"""               http://www.opensource.org/licenses/osl-3.0.php"""
 TEST_FILE_EXT=".test"  
 REERFENCE_FILE_DIR="test_meshes"  
13    
14  import sys  import sys
15    import os
16  import unittest  import unittest
17  from esys.escript import *  from esys.escript import *
18  from esys.finley import Interval,Rectangle,Brick,JoinFaces  from esys.finley import Interval,Rectangle,Brick,JoinFaces
19    
20    TEST_FILE_EXT=".test"
21  class Test_Generators(unittest.TestCase):  class Test_Generators(unittest.TestCase):
22    
23     def checker(self,dom,reference):     def checker(self,dom,reference):
24        dom_file=reference+TEST_FILE_EXT        dom_file=os.environ['FINLEY_TEST_DATA']+"/"+reference+TEST_FILE_EXT
25        dom.write(dom_file)        dom.write(dom_file)
26        dom_string=open(dom_file).read().splitlines()        dom_string=open(dom_file).read().splitlines()
27        ref_string=open(REERFENCE_FILE_DIR+"/"+reference).read().splitlines()        ref_string=open(os.environ['FINLEY_WORKING_DIR']+"/"+reference).read().splitlines()
28        self.failUnlessEqual(len(dom_string),len(ref_string),"number of lines in mesh files does not match reference")        self.failUnlessEqual(len(dom_string),len(ref_string),"number of lines in mesh files does not match reference")
29        for l in range(1,len(ref_string)):        for l in range(1,len(ref_string)):
30           self.failUnlessEqual(dom_string[l].strip(),ref_string[l].strip(),"line %d (%s) in mesh files does not match reference (%s)"%(l,ref_string[l].strip(),dom_string[l].strip()))           self.failUnlessEqual(dom_string[l].strip(),ref_string[l].strip(),"line %d (%s) in mesh files does not match reference (%s)"%(l,ref_string[l].strip(),dom_string[l].strip()))

Legend:
Removed from v.705  
changed lines
  Added in v.706

  ViewVC Help
Powered by ViewVC 1.1.26