-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrun_integration_tests.py
More file actions
53 lines (43 loc) · 1.78 KB
/
run_integration_tests.py
File metadata and controls
53 lines (43 loc) · 1.78 KB
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
#!/usr/bin/env python3
'''
SpatialPy is a Python 3 package for simulation of
spatial deterministic/stochastic reaction-diffusion-advection problems
Copyright (C) 2019 - 2022 SpatialPy developers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU GENERAL PUBLIC LICENSE Version 3 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU GENERAL PUBLIC LICENSE Version 3 for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
'''
import unittest, sys, os
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-m', '--mode', default='develop', choices=['develop', 'release'],
help='Run tests in develop mode or release mode.')
if __name__ == '__main__':
args = parser.parse_args()
if args.mode == 'develop':
print('Running tests in develop mode. Appending repository directory to system path.')
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import test_model
import test_solver
import test_notebooks
#import test_mincde
modules = [
test_model,
test_solver,
test_notebooks
#test_mincde,
]
for module in modules:
suite = unittest.TestLoader().loadTestsFromModule(module)
runner = unittest.TextTestRunner(failfast=args.mode == 'develop')
print("Executing: {}".format(module))
result = runner.run(suite)
print('=' * 70)
if not result.wasSuccessful():
sys.exit(not result.wasSuccessful())