diff --git a/tests/bash_test/utils.py b/tests/bash_test/utils.py index ead606fe..c5d08f71 100644 --- a/tests/bash_test/utils.py +++ b/tests/bash_test/utils.py @@ -8,7 +8,8 @@ import shutil import subprocess -# TODO: Read the configuration from ../suite.conf +# The configuration parameters for bash test +# The function configure_suite() in system_tests.py will override these parameters EXIV2_DIR = os.path.normpath(os.path.join(os.path.abspath(__file__), '../../../')) BIN_DIR = os.path.join(EXIV2_DIR, 'build/bin') DATA_DIR = os.path.join(EXIV2_DIR, 'test/data') @@ -54,7 +55,7 @@ def runTest(cmd, vars_dict, expected_returncodes=[0], encoding='utf-8'): try: cmd = cmd.format(**vars_dict) args = shlex.split(cmd) - args[0] = os.path.join(BIN_DIR, args[0] + BIN_SUFFIX) + args[0] = os.path.join(BIN_DIR, args[0]) p = subprocess.Popen(args, stdout=subprocess.PIPE, cwd=TEST_DIR) stdout = p.communicate()[0] output = stdout.decode(encoding).rstrip('\n') diff --git a/tests/system_tests.py b/tests/system_tests.py index cc4f3bf1..d37af969 100644 --- a/tests/system_tests.py +++ b/tests/system_tests.py @@ -200,6 +200,11 @@ def configure_suite(config_file): _parameters["timeout"] *= config.getfloat( "General", "memcheck_timeout_penalty", fallback=20.0 ) + + # Configure the parameters for bash test + utils.BIN_DIR = os.path.abspath(config['ENV']['exiv2_path']) + utils.DATA_DIR = os.path.abspath(config['paths']['data_path']) + utils.TEST_DIR = os.path.abspath(config['paths']['tmp_path']) class FileDecoratorBase(object): @@ -969,3 +974,4 @@ def check_no_ASAN_UBSAN_errors(self, i, command, got_stderr, expected_stderr): self.assertNotIn(UBSAN_MSG, got_stderr) self.assertNotIn(ASAN_MSG, got_stderr) +