Run readelf tests in parallel by default
[pyelftools.git] / test / all_tests.py
1 #!/usr/bin/env python
2 #-------------------------------------------------------------------------------
3 # test/all_tests.py
4 #
5 # Run all pyelftools tests.
6 #
7 # Eli Bendersky (eliben@gmail.com)
8 # This code is in the public domain
9 #-------------------------------------------------------------------------------
10 from __future__ import print_function
11 import subprocess, sys
12 from utils import is_in_rootdir
13
14 def run_test_script(path, *args):
15 cmd = [sys.executable, path] + list(args)
16 print("Running '%s'" % ' '.join(cmd))
17 subprocess.check_call(cmd)
18
19 def main():
20 if not is_in_rootdir():
21 testlog.error('Error: Please run me from the root dir of pyelftools!')
22 return 1
23 run_test_script('test/run_all_unittests.py')
24 run_test_script('test/run_examples_test.py')
25 run_test_script('test/run_readelf_tests.py', '--parallel')
26
27 if __name__ == '__main__':
28 sys.exit(main())