/
test_FishboneMoncriefID.py
36 lines (25 loc) · 1.09 KB
/
test_FishboneMoncriefID.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
from UnitTesting.create_test import create_test
def test_FishboneMoncriefID():
module = 'FishboneMoncriefID.FishboneMoncriefID'
module_name = 'FishBoneMoncriefID'
function_and_global_dict = {'FishboneMoncriefID()': ['hm1', 'rho_initial', 'uBL4D', 'uBL4U', 'uKS4U', 'IDalpha', 'IDgammaDD', 'IDKDD', 'IDbetaU', 'IDValencia3velocityU']}
create_test(module, module_name, function_and_global_dict)
if __name__ == '__main__':
import sys
if len(sys.argv) <= 3:
failed_functions = []
for fun in dir():
if fun[0:5] == 'test_':
print('\nTesting ' + str(fun) + '...\n')
try:
exec(fun + '()')
except SystemExit:
failed_functions.append(fun)
if failed_functions != []:
import sys, os
with open(os.path.join('UnitTesting', 'failed_tests.txt'), 'a') as file:
for function in failed_functions:
file.write(sys.argv[0] + ': ' + str(function) + '\n')
sys.exit(1)
else:
globals()[sys.argv[4]]()