From 37704040e98f849a045b03e20e8632965228d2c2 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 18 Sep 2024 18:19:13 -0500 Subject: [PATCH] run tests after all env.Install calls --- test/SConscript | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/test/SConscript b/test/SConscript index f6fb646b2..b04dc81ae 100644 --- a/test/SConscript +++ b/test/SConscript @@ -1,5 +1,6 @@ - +import atexit import subprocess +import os Import("env platform party_classes common_sources") arch_short = '64' if (env['bits'] == '64') else '86' @@ -23,13 +24,16 @@ else: test = env.Program("#build/bin/boe_test", test_sources + party_classes + common_sources) def run_tests(env,target,source): - app = str(source[0].abspath) - exit_code = subprocess.call(app) - if exit_code == 0: - open(target[0].abspath,'w').write("PASSED\n") - else: - print(f'Unit test failure! Exit code: {exit_code}') - exit(exit_code) + def run_subprocess(): + app = str(source[0].abspath) + exit_code = subprocess.call(app) + if exit_code == 0: + open(target[0].abspath,'w').write("PASSED\n") + else: + print(f'Unit test failure! Exit code: {exit_code}') + os._exit(exit_code) + # The tests subprocess has to happen AFTER all DLLs have been installed in the CI + atexit.register(run_subprocess) env.Install("#build/test/", test) if debug_symbols is not None: