From: Eli Bendersky Date: Sun, 26 Feb 2017 14:47:57 +0000 (-0800) Subject: Fix running tests on Travis X-Git-Tag: v0.25~44 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8cd87bec6f69102726a50fecbd8f5748a7cd3a75;p=pyelftools.git Fix running tests on Travis --- diff --git a/test/run_all_unittests.py b/test/run_all_unittests.py index 6859b94..0e00a4d 100755 --- a/test/run_all_unittests.py +++ b/test/run_all_unittests.py @@ -12,6 +12,10 @@ from __future__ import print_function import os, sys import unittest +# Make it possible to run this file from the root dir of pyelftools without +# installing pyelftools; useful for Travis testing, etc. +sys.path[0:0] = ['.'] + def main(): if not os.path.isdir('test'): diff --git a/test/run_examples_test.py b/test/run_examples_test.py index 9bec604..349f13b 100755 --- a/test/run_examples_test.py +++ b/test/run_examples_test.py @@ -11,9 +11,11 @@ import os, sys import logging from utils import run_exe, is_in_rootdir, dump_output_to_temp_files +# Make it possible to run this file from the root dir of pyelftools without +# installing pyelftools; useful for Travis testing, etc. +sys.path[0:0] = ['.'] # Create a global logger object -# testlog = logging.getLogger('run_examples_test') testlog.setLevel(logging.DEBUG) testlog.addHandler(logging.StreamHandler(sys.stdout)) @@ -85,4 +87,3 @@ def main(): if __name__ == '__main__': sys.exit(main()) - diff --git a/test/run_readelf_tests.py b/test/run_readelf_tests.py index 9f5a4f7..7b58cf9 100755 --- a/test/run_readelf_tests.py +++ b/test/run_readelf_tests.py @@ -15,9 +15,11 @@ import logging import platform from utils import run_exe, is_in_rootdir, dump_output_to_temp_files +# Make it possible to run this file from the root dir of pyelftools without +# installing pyelftools; useful for Travis testing, etc. +sys.path[0:0] = ['.'] # Create a global logger object -# testlog = logging.getLogger('run_tests') testlog.setLevel(logging.DEBUG) testlog.addHandler(logging.StreamHandler(sys.stdout))