File: all_tests.py

package info (click to toggle)
python-pyelftools 0.24-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,448 kB
  • ctags: 2,645
  • sloc: python: 8,404; ansic: 142; makefile: 22
file content (28 lines) | stat: -rwxr-xr-x 869 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/env python
#-------------------------------------------------------------------------------
# test/all_tests.py
#
# Run all pyelftools tests.
#
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
from __future__ import print_function
import subprocess, sys
from utils import is_in_rootdir

def run_test_script(path):
    cmd = [sys.executable, path]
    print("Running '%s'" % ' '.join(cmd))
    subprocess.check_call(cmd)

def main():
    if not is_in_rootdir():
        testlog.error('Error: Please run me from the root dir of pyelftools!')
        return 1
    run_test_script('test/run_all_unittests.py')
    run_test_script('test/run_examples_test.py')
    # run_test_script('test/run_readelf_tests.py')

if __name__ == '__main__':
    sys.exit(main())