2 #-------------------------------------------------------------------------------
3 # test/run_all_unittests.py
5 # Run all unit tests (alternative to running 'python -m unittest discover ...')
7 # Eli Bendersky (eliben@gmail.com)
8 # This code is in the public domain
9 #-------------------------------------------------------------------------------
10 from __future__
import print_function
15 # Make it possible to run this file from the root dir of pyelftools without
16 # installing pyelftools; useful for CI testing, etc.
21 if not os
.path
.isdir('test'):
22 print('!! Please execute from the root directory of pyelftools')
25 tests
= unittest
.TestLoader().discover('test', 'test*.py', 'test')
26 result
= unittest
.TextTestRunner().run(tests
)
27 if result
.wasSuccessful():
32 if __name__
== '__main__':