/[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 798 by gross, Fri Aug 4 01:05:36 2006 UTC revision 934 by gross, Tue Jan 23 09:52:45 2007 UTC
# Line 15  import sys Line 15  import sys
15  import os  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, ReadGmsh
19    
20  try:  try:
21       FINLEY_TEST_DATA=os.environ['FINLEY_TEST_DATA']       FINLEY_TEST_DATA=os.environ['FINLEY_TEST_DATA']
# Line 171  class Test_Generators(unittest.TestCase) Line 171  class Test_Generators(unittest.TestCase)
171        my_dom=JoinFaces([ms1,ms2])        my_dom=JoinFaces([ms1,ms2])
172        self.checker(my_dom,file)        self.checker(my_dom,file)
173    
174    class Test_GMSHReader(unittest.TestCase):
175       def compare(self, test_file, reference_file):
176          dom_string=open(test_file).read().splitlines()
177          ref_string=open(reference_file).read().splitlines()
178          self.failUnlessEqual(len(dom_string),len(ref_string),"number of lines in mesh files does not match reference")
179          for l in range(1,len(ref_string)):
180             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()))
181    
182       def test_Tri3(self):
183           file="tri3_gmsh.msh"
184           ref ="tri3.fly"
185           test = FINLEY_WORKDIR+os.sep+"tri3_test.fly"
186           dom = ReadGmsh(FINLEY_TEST_MESH_PATH+os.sep+file,2)
187           dom.write(test)
188           self.compare(test, FINLEY_TEST_MESH_PATH+os.sep+ref)
189    
190       def test_Tri6(self):
191           file="tri6_gmsh.msh"
192           ref="tri6.fly"
193           test = FINLEY_WORKDIR+os.sep+"tri8_test.fly"
194           dom = ReadGmsh(FINLEY_TEST_MESH_PATH+os.sep+file,2)
195           dom.write(test)
196           self.compare(test, FINLEY_TEST_MESH_PATH+os.sep+ref)
197    
198       def test_Tet4(self):
199           file="tet4_gmsh.msh"
200           ref="tet4.fly"
201           test = FINLEY_WORKDIR+os.sep+"tet4_test.fly"
202           dom = ReadGmsh(FINLEY_TEST_MESH_PATH+os.sep+file,3)
203           dom.write(test)
204           self.compare(test, FINLEY_TEST_MESH_PATH+os.sep+ref)
205    
206       def test_Tet(self):
207           file="tet10_gmsh.msh"
208           ref="tet10.fly"
209           test = FINLEY_WORKDIR+os.sep+"tet10_test.fly"
210           dom = ReadGmsh(FINLEY_TEST_MESH_PATH+os.sep+file,3)
211           dom.write(test)
212           self.compare(test, FINLEY_TEST_MESH_PATH+os.sep+ref)
213    
214  if __name__ == '__main__':  if __name__ == '__main__':
215     suite = unittest.TestSuite()     suite = unittest.TestSuite()
216     suite.addTest(unittest.makeSuite(Test_Generators))     suite.addTest(unittest.makeSuite(Test_Generators))
217       suite.addTest(unittest.makeSuite(Test_GMSHReader))
218     s=unittest.TextTestRunner(verbosity=2).run(suite)     s=unittest.TextTestRunner(verbosity=2).run(suite)
219     if s.wasSuccessful():     if s.wasSuccessful():
220       sys.exit(0)       sys.exit(0)

Legend:
Removed from v.798  
changed lines
  Added in v.934

  ViewVC Help
Powered by ViewVC 1.1.26