/[escript]/branches/symbolic_from_3470/dudley/test/python/run_escriptOnDudley.py
ViewVC logotype

Diff of /branches/symbolic_from_3470/dudley/test/python/run_escriptOnDudley.py

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

revision 1827 by ksteube, Thu Oct 2 04:28:07 2008 UTC revision 2271 by jfenwick, Mon Feb 16 05:08:29 2009 UTC
# Line 29  import os Line 29  import os
29  from test_objects import Test_Dump, Test_SetDataPointValue  from test_objects import Test_Dump, Test_SetDataPointValue
30  from test_objects import Test_Domain  from test_objects import Test_Domain
31    
32    from test_shared import Test_Shared
33    
34  try:  try:
35       FINLEY_WORKDIR=os.environ['FINLEY_WORKDIR']       FINLEY_WORKDIR=os.environ['FINLEY_WORKDIR']
36  except KeyError:  except KeyError:
37       FINLEY_WORKDIR='.'       FINLEY_WORKDIR='.'
38    
39  NE=4 # number elements, must be even  NE=4 # number elements, must be even
40    
41    class Test_SharedOnFinley(Test_Shared):
42      def setUp(self):
43        self.domain=Rectangle(NE,NE)
44        self.tol=0.001
45      def tearDown(self):
46        del self.domain
47        del self.tol
48    
49  class Test_DomainOnFinley(Test_Domain):  class Test_DomainOnFinley(Test_Domain):
50     def setUp(self):     def setUp(self):
51         self.domain =Rectangle(NE,NE+1,2)         self.domain =Rectangle(NE,NE+1,2)
# Line 58  class Test_DomainOnFinley(Test_Domain): Line 69  class Test_DomainOnFinley(Test_Domain):
69         self.failUnless(len(tags)==len(ref_tags), "tags list has wrong length.")         self.failUnless(len(tags)==len(ref_tags), "tags list has wrong length.")
70         for i in ref_tags: self.failUnless(i in tags,"tag %s is missing."%i)         for i in ref_tags: self.failUnless(i in tags,"tag %s is missing."%i)
71     def test_tagsFunctionOnBoundary(self):     def test_tagsFunctionOnBoundary(self):
72         # For MPI a subdomain may be missing some tags and this test is expected to fail         ref_tags=[1, 2, 10, 20]
73         if getMPISizeWorld() == 1:         tags=FunctionOnBoundary(self.domain).getListOfTags()
74           ref_tags=[1, 2, 10, 20]         # For an MPI-distributed domain some tags may be missing
75           tags=FunctionOnBoundary(self.domain).getListOfTags()         if getMPISizeWorld() == 1: self.failUnless(len(tags)==len(ref_tags), "tags list has wrong length.")
76           self.failUnless(len(tags)==len(ref_tags), "tags list has wrong length.")         for i in tags: self.failUnless(i in ref_tags,"tag %s is missing."%i)
          for i in ref_tags: self.failUnless(i in tags,"tag %s is missing."%i)  
77     def test_tagsReducedFunctionOnBoundary(self):     def test_tagsReducedFunctionOnBoundary(self):
78         # For MPI a subdomain may be missing some tags and this test is expected to fail         ref_tags=[1, 2, 10, 20]
79         if getMPISizeWorld() == 1:         tags=ReducedFunctionOnBoundary(self.domain).getListOfTags()
80           ref_tags=[1, 2, 10, 20]         # For an MPI-distributed domain some tags may be missing
81           tags=ReducedFunctionOnBoundary(self.domain).getListOfTags()         if getMPISizeWorld() == 1: self.failUnless(len(tags)==len(ref_tags), "tags list has wrong length.")
82           self.failUnless(len(tags)==len(ref_tags), "tags list has wrong length.")         for i in tags: self.failUnless(i in ref_tags,"tag %s is missing."%i)
          for i in ref_tags: self.failUnless(i in tags,"tag %s is missing."%i)  
83     def test_tagsFunctionOnContactOne(self):     def test_tagsFunctionOnContactOne(self):
84         ref_tags=[]         ref_tags=[]
85         tags=FunctionOnContactOne(self.domain).getListOfTags()         tags=FunctionOnContactOne(self.domain).getListOfTags()
# Line 97  class Test_DataOpsOnFinley(Test_Dump, Te Line 106  class Test_DataOpsOnFinley(Test_Dump, Te
106         self.domain =Rectangle(NE,NE+1,2)         self.domain =Rectangle(NE,NE+1,2)
107         self.domain_with_different_number_of_samples =Rectangle(2*NE,NE+1,2)         self.domain_with_different_number_of_samples =Rectangle(2*NE,NE+1,2)
108         self.domain_with_different_number_of_data_points_per_sample =Rectangle(2*NE,NE+1,2,integrationOrder=2)         self.domain_with_different_number_of_data_points_per_sample =Rectangle(2*NE,NE+1,2,integrationOrder=2)
109         self.domain_with_different_sample_ordering =Rectangle(1,(NE+1)*NE,2)         self.domain_with_different_sample_ordering =Rectangle(NE,NE+1,2, optimize=True)
110         self.filename_base=FINLEY_WORKDIR         self.filename_base=FINLEY_WORKDIR
111    
112     def tearDown(self):     def tearDown(self):
# Line 108  class Test_DataOpsOnFinley(Test_Dump, Te Line 117  class Test_DataOpsOnFinley(Test_Dump, Te
117    
118  if __name__ == '__main__':  if __name__ == '__main__':
119     suite = unittest.TestSuite()     suite = unittest.TestSuite()
120       suite.addTest(unittest.makeSuite(Test_SharedOnFinley))
121     suite.addTest(unittest.makeSuite(Test_DataOpsOnFinley))     suite.addTest(unittest.makeSuite(Test_DataOpsOnFinley))
122     suite.addTest(unittest.makeSuite(Test_DomainOnFinley))     suite.addTest(unittest.makeSuite(Test_DomainOnFinley))
123     s=unittest.TextTestRunner(verbosity=2).run(suite)     s=unittest.TextTestRunner(verbosity=2).run(suite)

Legend:
Removed from v.1827  
changed lines
  Added in v.2271

  ViewVC Help
Powered by ViewVC 1.1.26