diff --git a/test/functional/test_framework/cdefs.py b/test/functional/test_framework/cdefs.py --- a/test/functional/test_framework/cdefs.py +++ b/test/functional/test_framework/cdefs.py @@ -36,7 +36,7 @@ mainmod = sys.modules['__main__'] mainmod_path = getattr(mainmod, '__file__', '') if mainmod_path and mainmod_path.endswith('.py'): - maybe_top = mainmod_path + maybe_top = os.path.realpath(mainmod_path) while maybe_top != '/': maybe_top = os.path.abspath(os.path.dirname(maybe_top)) if contains_src(maybe_top): diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -140,6 +140,12 @@ config.read_file(open(configfile)) src_dir = config["environment"]["SRCDIR"] + if 'SRCDIR' in os.environ: + src_dir = os.environ['SRCDIR'] + else: + # Setup SRCDIR env since subprocesses can't find it properly without the env. + os.environ['SRCDIR'] = src_dir + build_dir = config["environment"]["BUILDDIR"] tests_dir = os.path.join(src_dir, 'test', 'functional') @@ -406,7 +412,8 @@ update_queue.task_done() except Empty as e: if not on_ci(): - print("Running jobs: {}".format(", ".join(running_jobs)), end="\r") + print("Running jobs: {}".format( + ", ".join(running_jobs)), end="\r") sys.stdout.flush() printed_status = True