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

Diff of /branches/domexper/dudley/test/python/fixme_run_generators.py

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

revision 757 by woo409, Mon Jun 26 13:12:56 2006 UTC revision 798 by gross, Fri Aug 4 01:05:36 2006 UTC
# Line 17  import unittest Line 17  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  FINLEY_TEST_DATA_PATH=os.environ['FINLEY_TEST_DATA']+"/data_meshes/"  try:
21         FINLEY_TEST_DATA=os.environ['FINLEY_TEST_DATA']
22    except KeyError:
23         FINLEY_TEST_DATA='.'
24    
25    try:
26         FINLEY_WORKDIR=os.environ['FINLEY_WORKDIR']
27    except KeyError:
28         FINLEY_WORKDIR='.'
29    
30    FINLEY_TEST_MESH_PATH=FINLEY_TEST_DATA+"/data_meshes/"
31  if os.name == "nt":  if os.name == "nt":
32     FINLEY_TEST_DATA_PATH = FINLEY_TEST_DATA_PATH+"win32/"     FINLEY_TEST_MESH_PATH = FINLEY_TEST_MESH_PATH+"win32/"
33  FINLEY_WORKDIR_PATH=os.environ['FINLEY_WORKDIR']+"/"  FINLEY_WORKDIR_PATH=FINLEY_WORKDIR+"/"
34    
35  TEST_FILE_EXT=".test"  TEST_FILE_EXT=".test"
36  class Test_Generators(unittest.TestCase):  class Test_Generators(unittest.TestCase):
# Line 30  class Test_Generators(unittest.TestCase) Line 40  class Test_Generators(unittest.TestCase)
40        dom.write(dom_file)        dom.write(dom_file)
41  # Uncomment this section to dump the files for regression testing  # Uncomment this section to dump the files for regression testing
42  #      if True:  #      if True:
43  #         dom.write(FINLEY_TEST_DATA_PATH+reference)  #         dom.write(FINLEY_TEST_MESH_PATH+reference)
44        dom_string=open(dom_file).read().splitlines()        dom_string=open(dom_file).read().splitlines()
45        ref_string=open(FINLEY_TEST_DATA_PATH+reference).read().splitlines()        ref_string=open(FINLEY_TEST_MESH_PATH+reference).read().splitlines()
46        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")
47        for l in range(1,len(ref_string)):        for l in range(1,len(ref_string)):
48           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.757  
changed lines
  Added in v.798

  ViewVC Help
Powered by ViewVC 1.1.26