From 7a627b3fdd88e2a655f5e6cde0a907c00d227a24 Mon Sep 17 00:00:00 2001 From: Brian Daniels Date: Wed, 25 May 2016 12:07:55 -0500 Subject: [PATCH] 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. --- tools/build_api.py | 7 ++++++- tools/test_api.py | 23 ++++++++++++++--------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/tools/build_api.py b/tools/build_api.py index 4394d9aaa9..615024e91c 100644 --- a/tools/build_api.py +++ b/tools/build_api.py @@ -306,7 +306,12 @@ def build_library(src_paths, build_path, target, toolchain_name, except Exception, e: if report != None: end = time() - cur_result["result"] = "FAIL" + + if isinstance(e, ToolException): + cur_result["result"] = "FAIL" + elif isinstance(e, NotSupportedException): + cur_result["result"] = "NOT_SUPPORTED" + cur_result["elapsed_time"] = end - start toolchain_output = toolchain.get_output() diff --git a/tools/test_api.py b/tools/test_api.py index 44a88e45b1..c1e76944e1 100644 --- a/tools/test_api.py +++ b/tools/test_api.py @@ -2043,15 +2043,20 @@ def build_tests(tests, base_source_paths, build_path, target, toolchain_name, for test_name, test_path in tests.iteritems(): test_build_path = os.path.join(build_path, test_path) src_path = base_source_paths + [test_path] - bin_file = build_project(src_path, test_build_path, target, toolchain_name, - options=options, - jobs=jobs, - clean=clean, - macros=macros, - name=test_name, - report=report, - properties=properties, - verbose=verbose) + + try: + bin_file = build_project(src_path, test_build_path, target, toolchain_name, + options=options, + jobs=jobs, + clean=clean, + macros=macros, + name=test_name, + report=report, + properties=properties, + verbose=verbose) + + except Exception, e: + continue # If a clean build was carried out last time, disable it for the next build. # Otherwise the previously built test will be deleted.