Skip to content

Commit 7a627b3

Browse files
committed
Allowing test builds to continue if one test build fails
This ensures that a build report is produced, even if a build fails. This allows you to see what went wrong later.
1 parent c71e81b commit 7a627b3

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

tools/build_api.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,12 @@ def build_library(src_paths, build_path, target, toolchain_name,
306306
except Exception, e:
307307
if report != None:
308308
end = time()
309-
cur_result["result"] = "FAIL"
309+
310+
if isinstance(e, ToolException):
311+
cur_result["result"] = "FAIL"
312+
elif isinstance(e, NotSupportedException):
313+
cur_result["result"] = "NOT_SUPPORTED"
314+
310315
cur_result["elapsed_time"] = end - start
311316

312317
toolchain_output = toolchain.get_output()

tools/test_api.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2043,15 +2043,20 @@ def build_tests(tests, base_source_paths, build_path, target, toolchain_name,
20432043
for test_name, test_path in tests.iteritems():
20442044
test_build_path = os.path.join(build_path, test_path)
20452045
src_path = base_source_paths + [test_path]
2046-
bin_file = build_project(src_path, test_build_path, target, toolchain_name,
2047-
options=options,
2048-
jobs=jobs,
2049-
clean=clean,
2050-
macros=macros,
2051-
name=test_name,
2052-
report=report,
2053-
properties=properties,
2054-
verbose=verbose)
2046+
2047+
try:
2048+
bin_file = build_project(src_path, test_build_path, target, toolchain_name,
2049+
options=options,
2050+
jobs=jobs,
2051+
clean=clean,
2052+
macros=macros,
2053+
name=test_name,
2054+
report=report,
2055+
properties=properties,
2056+
verbose=verbose)
2057+
2058+
except Exception, e:
2059+
continue
20552060

20562061
# If a clean build was carried out last time, disable it for the next build.
20572062
# Otherwise the previously built test will be deleted.

0 commit comments

Comments
 (0)