-
Notifications
You must be signed in to change notification settings - Fork 25
/
testall.py
executable file
·53 lines (46 loc) · 1.96 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
##############################################################################
# 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
import shutil
import h5py
unit_tests = ("hdf5dtype_test", "hdf5db_test")
integ_tests = ("h5tojson_test", "jsontoh5_test")
# verify the hdf5 lib version is recent
if h5py.version.hdf5_version_tuple < (1, 10, 4):
print(h5py.version.info)
sys.exit("Need HDF5 library 1.10.4 or later")
# verify we have a recent version of h5py
if h5py.version.version_tuple < (3, 0, 0):
print(h5py.version.info)
sys.exit("Need h5py version 3.0 or later")
# Run all hdf5-json tests
# Run this script before running any integ tests
for file_name in unit_tests:
print(file_name)
rc = os.system("python test/unit/" + file_name + ".py")
if rc != 0:
sys.exit("FAILED")
shutil.rmtree("./out", ignore_errors=True)
os.remove("hdf5dbtest.log")
os.chdir("test/integ")
for file_name in integ_tests:
print(file_name)
rc = os.system("python " + file_name + ".py")
if rc != 0:
sys.exit("FAILED")
shutil.rmtree("./h5_out", ignore_errors=True)
shutil.rmtree("./json_out", ignore_errors=True)
os.remove("h5tojson.log")
os.remove("jsontoh5.log")
os.chdir("..")
print("Testing suite: Success!")