/[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 1388 by trankine, Fri Jan 11 07:45:58 2008 UTC revision 1809 by ksteube, Thu Sep 25 06:43:44 2008 UTC
# Line 1  Line 1 
1    
2    ########################################################
3  #  #
4  # $Id$  # Copyright (c) 2003-2008 by University of Queensland
5  #  # Earth Systems Science Computational Center (ESSCC)
6  #######################################################  # http://www.uq.edu.au/esscc
7  #  #
8  #           Copyright 2003-2007 by ACceSS MNRF  # Primary Business: Queensland, Australia
9  #       Copyright 2007 by University of Queensland  # Licensed under the Open Software License version 3.0
10  #  # http://www.opensource.org/licenses/osl-3.0.php
11  #                http://esscc.uq.edu.au  #
12  #        Primary Business: Queensland, Australia  ########################################################
13  #  Licensed under the Open Software License version 3.0  
14  #     http://www.opensource.org/licenses/osl-3.0.php  __copyright__="""Copyright (c) 2003-2008 by University of Queensland
15  #  Earth Systems Science Computational Center (ESSCC)
16  #######################################################  http://www.uq.edu.au/esscc
17  #  Primary Business: Queensland, Australia"""
18    __license__="""Licensed under the Open Software License version 3.0
19    http://www.opensource.org/licenses/osl-3.0.php"""
20    __url__="http://www.uq.edu.au/esscc/escript-finley"
21    
22  """  """
23  checks the mesh generators against the reference meshes in test_meshes and test the finley integration schemes.  checks the mesh generators against the reference meshes in test_meshes and test the finley integration schemes.
24  """  """
25    
 __copyright__="""  Copyright (c) 2006 by ACcESS MNRF  
                     http://www.access.edu.au  
                 Primary Business: Queensland, Australia"""  
 __license__="""Licensed under the Open Software License version 3.0  
              http://www.opensource.org/licenses/osl-3.0.php"""  
   
26  import sys  import sys
27  import os  import os
28  import unittest  import unittest
# Line 41  except KeyError: Line 40  except KeyError:
40       FINLEY_WORKDIR='.'       FINLEY_WORKDIR='.'
41    
42  FINLEY_TEST_MESH_PATH=FINLEY_TEST_DATA+"/data_meshes/"  FINLEY_TEST_MESH_PATH=FINLEY_TEST_DATA+"/data_meshes/"
43  if os.name == "nt":  #if os.name == "nt":
44     FINLEY_TEST_MESH_PATH = FINLEY_TEST_MESH_PATH+"win32/"  #   FINLEY_TEST_MESH_PATH = FINLEY_TEST_MESH_PATH+"win32/"
45  FINLEY_WORKDIR_PATH=FINLEY_WORKDIR+"/"  FINLEY_WORKDIR_PATH=FINLEY_WORKDIR+"/"
46    
47  TEST_FILE_EXT=".test"  TEST_FILE_EXT=".test"
# Line 58  class Test_Generators(unittest.TestCase) Line 57  class Test_Generators(unittest.TestCase)
57        ref_string=open(FINLEY_TEST_MESH_PATH+reference).read().splitlines()        ref_string=open(FINLEY_TEST_MESH_PATH+reference).read().splitlines()
58        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")
59        for l in range(1,len(ref_string)):        for l in range(1,len(ref_string)):
60           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()))       line=dom_string[l].strip()
61         if os.name == "nt":
62               line=line.replace("e+00","e+0").replace("e-00","e-0")
63             self.failUnlessEqual(line,ref_string[l].strip(),"line %d (%s) in mesh files does not match reference (%s)"%(l,ref_string[l].strip(),line))
64    
65     def test_hex_2D_order1(self):     def test_hex_2D_order1(self):
66        file="hex_2D_order1.msh"        file="hex_2D_order1.msh"
# Line 170  class Test_GMSHReader(unittest.TestCase) Line 172  class Test_GMSHReader(unittest.TestCase)
172        ref_string=open(reference_file).read().splitlines()        ref_string=open(reference_file).read().splitlines()
173        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")
174        for l in range(1,len(ref_string)):        for l in range(1,len(ref_string)):
175           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()))       line=dom_string[l].strip()
176         if os.name == "nt":
177               line=line.replace("e+00","e+0").replace("e-00","e-0")
178             self.failUnlessEqual(line,ref_string[l].strip(),"line %d (%s) in mesh files does not match reference (%s)"%(l,ref_string[l].strip(),line))
179    
180     def test_Tri3(self):     def test_Tri3(self):
181         file="tri3_gmsh.msh"         file="tri3_gmsh.msh"

Legend:
Removed from v.1388  
changed lines
  Added in v.1809

  ViewVC Help
Powered by ViewVC 1.1.26