Skip to content

Commit 9c38f2a

Browse files
committed
Merge pull request #85 from bridadan/build-tests-fix
Fixing build issues for tests
2 parents 904ea44 + 4ae7d54 commit 9c38f2a

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

tools/test.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
from tools.test_api import test_path_to_name, find_tests, print_tests, build_tests, test_spec_from_test_build
2929
from tools.options import get_default_options_parser
30-
from tools.build_api import build_project
30+
from tools.build_api import build_project, build_library
3131
from tools.targets import TARGET_MAP
3232
from tools.utils import mkdir
3333

@@ -115,10 +115,17 @@
115115
if not base_source_paths:
116116
base_source_paths = ['.']
117117

118+
118119
target = TARGET_MAP[options.mcu]
119120

121+
lib_build_res = build_library(base_source_paths, options.build_dir, target, options.tool,
122+
options=options.options,
123+
jobs=options.jobs,
124+
clean=options.clean,
125+
archive=False)
126+
120127
# Build all the tests
121-
test_build = build_tests(tests, base_source_paths, options.build_dir, target, options.tool,
128+
test_build = build_tests(tests, [options.build_dir], options.build_dir, target, options.tool,
122129
options=options.options,
123130
clean=options.clean,
124131
jobs=options.jobs)

tools/test_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,13 +2041,13 @@ def build_tests(tests, base_source_paths, build_path, target, toolchain_name,
20412041
}
20422042

20432043
for test_name, test_path in tests.iteritems():
2044+
test_build_path = os.path.join(build_path, test_path)
20442045
src_path = base_source_paths + [test_path]
2045-
artifact_name = os.path.join(test_path, test_name)
2046-
bin_file = build_project(src_path, build_path, target, toolchain_name,
2046+
bin_file = build_project(src_path, test_build_path, target, toolchain_name,
20472047
options=options,
20482048
jobs=jobs,
20492049
clean=clean,
2050-
name=artifact_name,
2050+
name=test_name,
20512051
report=report,
20522052
properties=properties,
20532053
verbose=verbose)

0 commit comments

Comments
 (0)