/[escript]/trunk/modellib/test/python/run_domainreaders.py
ViewVC logotype

Diff of /trunk/modellib/test/python/run_domainreaders.py

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

revision 5287 by sshaw, Fri Jun 13 05:12:03 2014 UTC revision 5288 by sshaw, Tue Dec 2 23:18:40 2014 UTC
# Line 1  Line 1 
1    from __future__ import print_function
2  ##############################################################################  ##############################################################################
3  #  #
4  # Copyright (c) 2003-2014 by University of Queensland  # Copyright (c) 2003-2014 by University of Queensland
# Line 33  import os Line 33  import os
33  from subprocess import PIPE, Popen  from subprocess import PIPE, Popen
34  import esys.escriptcore.utestselect as unittest  import esys.escriptcore.utestselect as unittest
35  from esys.escriptcore.testing import *  from esys.escriptcore.testing import *
36  import esys.finley  try:
37  import esys.dudley      import esys.dudley
38        HAVE_DUDLEY = True
39    except ImportError:
40        HAVE_DUDLEY = False
41    
42  from esys.escript import getMPISizeWorld  try:
43        import esys.finley
44        from esys.modellib.geometry import *
45        HAVE_FINLEY = True
46    except ImportError:
47        HAVE_FINLEY = False
48    
49    from esys.escript import getMPISizeWorld, getEscriptParamInt
50  from esys.escript.modelframe import DataSource  from esys.escript.modelframe import DataSource
 from esys.modellib.geometry import *  
51  from esys.pycad.gmsh import *  from esys.pycad.gmsh import *
52  from esys.pycad import *  from esys.pycad import *
53    
# Line 60  except OSError: Line 69  except OSError:
69      pass      pass
70            
71  @unittest.skipIf(GMSH is None, "gmsh not available")  @unittest.skipIf(GMSH is None, "gmsh not available")
72  @unittest.skipIf(esys.escript.getEscriptParamInt("MPIBUILD",0)>0,  @unittest.skipIf(getEscriptParamInt("MPIBUILD",0)>0,
73          "not tested with MPI builds")          "not tested with MPI builds")
74  class Test_domainReaders(unittest.TestCase):  class Test_domainReaders(unittest.TestCase):
75      def domain_family(self, dommodule, f):      def domain_family(self, dommodule, f):
# Line 81  class Test_domainReaders(unittest.TestCa Line 90  class Test_domainReaders(unittest.TestCa
90          r2.source=DataSource(uri=os.path.join(MODELLIB_WORKDIR,"TESTgmsh_test.msh"), fileformat="gmsh")          r2.source=DataSource(uri=os.path.join(MODELLIB_WORKDIR,"TESTgmsh_test.msh"), fileformat="gmsh")
91          r2.domain()          r2.domain()
92    
93        @unittest.skipIf(not HAVE_FINLEY, "Finley module not available")
94      def test_domain_families(self):      def test_domain_families(self):
95          self.domain_family(None,os.path.join(MODELLIB_WORKDIR,'TESTnone'))          self.domain_family(None,os.path.join(MODELLIB_WORKDIR,'TESTnone'))
96          self.domain_family(esys.dudley,os.path.join(MODELLIB_WORKDIR,'TESTDud'))          if HAVE_DUDLEY:
97                self.domain_family(esys.dudley,os.path.join(MODELLIB_WORKDIR,'TESTDud'))
98          self.domain_family(esys.finley,os.path.join(MODELLIB_WORKDIR,'TESTfin'))          self.domain_family(esys.finley,os.path.join(MODELLIB_WORKDIR,'TESTfin'))
99      
100        @unittest.skipIf(not HAVE_FINLEY, "Finley module not available")
101      def test_finleyReader(self):      def test_finleyReader(self):
102          self.domain_family(esys.finley,os.path.join(MODELLIB_WORKDIR,'TESTfin'))          self.domain_family(esys.finley,os.path.join(MODELLIB_WORKDIR,'TESTfin'))
103          rf=FinleyReader(parameters=["fish","dummy"], debug=True)          rf=FinleyReader(parameters=["fish","dummy"], debug=True)

Legend:
Removed from v.5287  
changed lines
  Added in v.5288

  ViewVC Help
Powered by ViewVC 1.1.26