This repository has been archived by the owner on Jul 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
install_test.py
executable file
·56 lines (39 loc) · 1.6 KB
/
install_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/python
import os
import sys
# from bemio.__version__ import base
def run_test_case(test_case):
print '\n****Running the ' + str(test_case) + ' case****'
starting_dir = os.path.abspath(os.curdir)
try:
os.chdir(test_case)
execfile('run.py')
os.chdir(starting_dir)
print '****The ' + str(test_case) + ' test case ran successfully****\n'
status = str(test_case) + ': SUCCESS'
except:
print '****The ' + str(test_case) + ' test case failed. For the specific information on the error run the ' + str(test_case) + ' test case manually****\n'
status = str(test_case) + ': FAILED'
os.chdir(starting_dir)
return status
if __name__ == "__main__":
# print 'Testing bemio version ' + base()
status = []
if len(sys.argv) == 2 and sys.argv[1] == 'all':
print 'Running all test cases:\n'
status.append(run_test_case('tutorials/wamit/ecm_ellipsoid'))
status.append(run_test_case('tutorials/wamit/sphere'))
status.append(run_test_case('tutorials/wamit/oswec'))
status.append(run_test_case('tutorials/wamit/rm3'))
status.append(run_test_case('tutorials/mesh/scale_and_translate'))
status.append(run_test_case('tutorials/mesh/wamit_to_nemoh'))
status.append(run_test_case('tutorials/utilities/wave_excitation'))
else:
print 'Running standard test cases:\n'
status.append(run_test_case('tutorials/wamit/COER_hydrodynamic_modeling_comp'))
status.append(run_test_case('tutorials/wamit/wec3'))
status.append(run_test_case('tutorials/nemoh'))
status.append(run_test_case('tutorials/aqwa'))
print 'Test cases runs completed:'
for i, status_i in enumerate(status):
print '\t' + status_i