From 0076cd5f0a7f94bae37ca93df77dbcb152d0c977 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 18 Sep 2022 10:14:53 +0300 Subject: [PATCH] aedi: run tests in build directory if test creates a file, it should be placed to a directory ignored by git --- aedi/target/special.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/aedi/target/special.py b/aedi/target/special.py index d6728cf9..72e49edf 100644 --- a/aedi/target/special.py +++ b/aedi/target/special.py @@ -92,23 +92,23 @@ class TestDepsTarget(BuildTarget): test_name = entry.stem pkg_config_output = state.run_pkg_config('--cflags', '--libs', test_name) - exe_name = state.build_path / test_name + exe_path = state.build_path / test_name print('Testing ' + test_name) - args = [ + build_args = [ 'clang++', '-arch', 'x86_64', '-arch', 'arm64', '-std=c++17', '-include', test_path / 'aedi.h', - '-o', exe_name, + '-o', exe_path, entry, ] - args += shlex.split(pkg_config_output) + build_args += shlex.split(pkg_config_output) if state.verbose: - print(' '.join(str(arg) for arg in args)) + print(' '.join(str(arg) for arg in build_args)) - subprocess.run(args, check=True, cwd=state.build_path, env=state.environment) - subprocess.run((exe_name,), check=True, env=state.environment) + for args in (build_args, (exe_path,)): + subprocess.run(args, check=True, cwd=state.build_path, env=state.environment)