forked from HDFGroup/h5pyd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testall.py
executable file
·83 lines (76 loc) · 2.69 KB
/
testall.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/env python
##############################################################################
# Copyright by The HDF Group. #
# All rights reserved. #
# #
# This file is part of H5Serv (HDF5 REST Server) Service, Libraries and #
# Utilities. The full HDF5 REST Server copyright notice, including s #
# terms governing use, modification, and redistribution, is contained in #
# the file COPYING, which can be found at the root of the source code #
# distribution tree. If you do not have access to this file, you may #
# request a copy from [email protected]. #
##############################################################################
import os
import sys
hl_tests = ('test_attribute',
'test_committedtype',
'test_complex_numbers',
'test_dataset_compound',
'test_dataset_create',
'test_dataset_extend',
'test_dataset_fancyselect',
'test_dataset_objref',
'test_dataset_getitem',
'test_dataset_pointselect',
'test_dataset_scalar',
'test_dataset_setitem',
'test_dimscale',
'test_file',
'test_group',
'test_table',
'test_visit',
'test_vlentype',
'test_folder')
app_tests = ('test_hsinfo', 'test_tall_inspect', 'test_diamond_inspect',
'test_shuffle_inspect')
run_hl = True
run_app = True
if len(sys.argv) > 1:
if sys.argv[1] in ("-h", "--help"):
print("Usage: python testall.py [--hl_only | --app_only]")
sys.exit(0)
if sys.argv[1] == "--hl_only":
run_app = False
elif sys.argv[1] == "--app_only":
run_hl = False
else:
print("Unexpected argument")
sys.exit(1)
#
# Run tests
#
os.chdir('test')
if run_hl:
os.chdir('hl')
for test_name in hl_tests:
print(test_name)
rc = os.system('python ' + test_name + '.py')
if rc != 0:
sys.exit("Failed")
os.chdir('..')
if run_app:
os.chdir('apps')
rc = os.system('python is_hsds.py')
if rc == 0:
print("running HSDS app tests")
# these tests are only support with HSDS
rc = os.system('python load_files.py')
if rc != 0:
sys.exit("load_files.py failed")
for test_name in app_tests:
print(test_name)
rc = os.system('python ' + test_name + '.py')
if rc != 0:
sys.exit("Failed")
os.chdir('..')
print("Done!")