Skip to content

Commit

Permalink
run tests after all env.Install calls
Browse files Browse the repository at this point in the history
  • Loading branch information
NQNStudios committed Sep 18, 2024
1 parent 6905a75 commit 3770404
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions test/SConscript
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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:
Expand Down

0 comments on commit 3770404

Please sign in to comment.