/[escript]/trunk/dudley/test/python/run_utilOnDudley.py
ViewVC logotype

Contents of /trunk/dudley/test/python/run_utilOnDudley.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4938 - (show annotations)
Wed May 14 01:13:23 2014 UTC (5 years, 3 months ago) by jfenwick
File MIME type: text/x-python
File size: 3786 byte(s)
Modify unit tests to read their classes from
esys.escriptcore.utestselect

Change the line in that file to switch between unittest and unittest2


1
2 ##############################################################################
3 #
4 # Copyright (c) 2003-2014 by University of Queensland
5 # http://www.uq.edu.au
6 #
7 # Primary Business: Queensland, Australia
8 # Licensed under the Open Software License version 3.0
9 # http://www.opensource.org/licenses/osl-3.0.php
10 #
11 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 # Development 2012-2013 by School of Earth Sciences
13 # Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 #
15 ##############################################################################
16
17 __copyright__="""Copyright (c) 2003-2014 by University of Queensland
18 http://www.uq.edu.au
19 Primary Business: Queensland, Australia"""
20 __license__="""Licensed under the Open Software License version 3.0
21 http://www.opensource.org/licenses/osl-3.0.php"""
22 __url__="https://launchpad.net/escript-finley"
23
24 import esys.escriptcore.utestselect as unittest
25 from test_util import Test_util as Test_util
26 from test_util import Test_Util_SpatialFunctions, Test_Util_SpatialFunctions_noGradOnBoundary_noContact
27
28 from esys.escript import *
29 from esys.dudley import Rectangle,Brick,ReadMesh
30 import sys
31 import os
32
33 if HAVE_SYMBOLS:
34 from test_symfuncs import Test_symfuncs
35 else:
36 print("Skipping symbolic tests since sympy is not available")
37 class Test_symfuncs:
38 pass
39
40 try:
41 DUDLEY_TEST_DATA=os.environ['DUDLEY_TEST_DATA']
42 except KeyError:
43 DUDLEY_TEST_DATA='.'
44
45 DUDLEY_TEST_MESH_PATH=os.path.join(DUDLEY_TEST_DATA,"data_meshes")
46
47
48 NE=4 # number elements, must be even
49
50 class Test_UtilOnDudley(Test_util,Test_symfuncs):
51 def setUp(self):
52 self.domain =Rectangle(NE,NE+1,1)
53 self.functionspace = FunctionOnBoundary(self.domain) # due to a bug in escript python needs to hold a reference to the domain
54 def tearDown(self):
55 del self.functionspace
56 del self.domain
57
58 class Test_Util_SpatialFunctionsOnDudleyTet2DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
59 def setUp(self):
60 self.order=1
61 self.domain = ReadMesh(os.path.join(DUDLEY_TEST_MESH_PATH,"tet_2D_order1.fly"),optimize=False)
62 def tearDown(self):
63 del self.order
64 del self.domain
65
66
67 class Test_Util_SpatialFunctionsOnDudleyTet3DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
68 def setUp(self):
69 self.order=1
70 self.domain = ReadMesh(os.path.join(DUDLEY_TEST_MESH_PATH,"tet_3D_order1.fly"),optimize=False)
71 def tearDown(self):
72 del self.order
73 del self.domain
74
75 class Test_Util_SpatialFunctionsOnDudleyRectOrder1(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
76 def setUp(self):
77 self.order=1
78 self.domain = Rectangle(n0=NE,n1=NE,order=1)
79 def tearDown(self):
80 del self.order
81 del self.domain
82
83
84 class Test_Util_SpatialFunctionsOnDudleyBrickOrder1(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
85 def setUp(self):
86 self.order=1
87 self.domain = Brick(n0=NE,n1=NE,n2=NE,order=1)
88 def tearDown(self):
89 del self.order
90 del self.domain
91
92
93
94 if __name__ == '__main__':
95 suite = unittest.TestSuite()
96 if True:
97 suite.addTest(unittest.makeSuite(Test_UtilOnDudley))
98 suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnDudleyTet2DOrder1))
99 suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnDudleyTet3DOrder1))
100 suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnDudleyRectOrder1))
101 suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnDudleyBrickOrder1))
102 # suite.addTest(Test_Util_SpatialFunctionsOnDudleyRectOrder1("test_normal_FunctionOnBoundary"))
103 else:
104 pass
105 s=unittest.TextTestRunner(verbosity=2).run(suite)
106 if not s.wasSuccessful(): sys.exit(1)
107

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision
svn:mergeinfo /branches/lapack2681/finley/test/python/run_utilOnFinley.py:2682-2741 /branches/pasowrap/dudley/test/python/run_utilOnDudley.py:3661-3674 /branches/py3_attempt2/dudley/test/python/run_utilOnDudley.py:3871-3891 /branches/restext/finley/test/python/run_utilOnFinley.py:2610-2624 /branches/ripleygmg_from_3668/dudley/test/python/run_utilOnDudley.py:3669-3791 /branches/stage3.0/finley/test/python/run_utilOnFinley.py:2569-2590 /branches/symbolic_from_3470/dudley/test/python/run_utilOnDudley.py:3471-3974 /branches/symbolic_from_3470/ripley/test/python/dudley/test/python/run_utilOnDudley.py:3517-3974 /release/3.0/finley/test/python/run_utilOnFinley.py:2591-2601 /trunk/ripley/test/python/dudley/test/python/run_utilOnDudley.py:3480-3515

  ViewVC Help
Powered by ViewVC 1.1.26