import subprocess Import("env platform party_classes common_sources") arch_short = '64' if (env['bits'] == '64') else '86' # Add path to scons env.Append(CPPPATH=['./deps/Catch2/single_include/catch2']) test_sources = Glob("""*.cpp""") + Split(""" #build/obj/scenedit/scen.fileio.cpp """) if str(platform) == "win32" and 'msvc' in env["TOOLS"]: test = env.Program("#build/bin/boe_test", party_classes + common_sources + test_sources, LINKFLAGS=f'/nologo /SUBSYSTEM:CONSOLE /MACHINE:X{arch_short}') else: test = env.Program("#build/bin/boe_test", test_sources + party_classes + common_sources) def run_tests(env,target,source): import subprocess app = str(source[0].abspath) if not subprocess.call(app): open(target[0].abspath,'w').write("PASSED\n") env.Install("#build/test/", test) env.AlwaysBuild(env.Install("#build/test/", Dir("#test/files"))) env.AlwaysBuild(env.Install("#build/rsrc/", Dir("#rsrc/strings"))) env.Command("#build/test/junk/", '', 'mkdir "' + Dir("#build/test/junk").path + '"') env.Command("#build/test/passed", test, run_tests, chdir=True)