2019-04-23 22:17:59 +01:00
|
|
|
#!/usr/bin/env python
|
2017-07-24 22:38:48 +01:00
|
|
|
|
2017-03-20 23:54:29 +00:00
|
|
|
from __future__ import print_function
|
2017-03-23 11:20:00 +00:00
|
|
|
import os, sys, subprocess, shutil, json
|
2017-03-20 23:54:29 +00:00
|
|
|
from glob import glob
|
|
|
|
|
|
2017-09-06 15:07:58 +02:00
|
|
|
if __name__ == '__main__':
|
|
|
|
|
# move cwd to the project root
|
|
|
|
|
os.chdir(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
2017-09-01 13:32:34 +01:00
|
|
|
|
2017-09-06 15:07:58 +02:00
|
|
|
### run the unit tests
|
2017-09-01 13:32:34 +01:00
|
|
|
|
2017-09-07 21:59:04 +01:00
|
|
|
subprocess.check_call([sys.executable, '-m', 'pytest', 'unit_test'])
|
2017-09-01 13:32:34 +01:00
|
|
|
|
2017-09-06 15:07:58 +02:00
|
|
|
### run the integration tests
|
2017-03-20 23:54:29 +00:00
|
|
|
|
2019-04-20 20:06:43 +02:00
|
|
|
test_projects = sorted(glob('test/??_*'))
|
2017-03-20 23:54:29 +00:00
|
|
|
|
2017-09-06 15:07:58 +02:00
|
|
|
if len(test_projects) == 0:
|
|
|
|
|
print('No test projects found. Aborting.', file=sys.stderr)
|
|
|
|
|
exit(2)
|
2017-03-20 23:54:29 +00:00
|
|
|
|
2017-09-06 15:07:58 +02:00
|
|
|
print('Testing projects:', test_projects)
|
2017-03-23 11:20:00 +00:00
|
|
|
|
2017-09-06 16:14:39 +02:00
|
|
|
run_test_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'run_test.py')
|
2017-09-06 15:07:58 +02:00
|
|
|
for project_path in test_projects:
|
2017-09-06 16:14:39 +02:00
|
|
|
subprocess.check_call([sys.executable, run_test_path, project_path])
|
2017-03-23 11:20:00 +00:00
|
|
|
|
2017-09-06 15:07:58 +02:00
|
|
|
print('%d projects built successfully.' % len(test_projects))
|