From 8cd87bec6f69102726a50fecbd8f5748a7cd3a75 Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Sun, 26 Feb 2017 06:47:57 -0800 Subject: [PATCH] Fix running tests on Travis --- test/run_all_unittests.py | 4 ++++ test/run_examples_test.py | 5 +++-- test/run_readelf_tests.py | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) 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)) -- 2.30.2