From 2f2642d5f609ca5d29c3d9b64e442560ca6e06e9 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Fri, 20 Sep 2019 00:21:03 +0200 Subject: [PATCH] scripts: testedtlib.py: Generate SystemExit on test failures The devicetree check in check_compliance.py in ci-tools expects the dtlib/edtlib test suites to exit with sys.exit() (which raises SystemExit) on test failures, and interprets Exception as an internal error in the test suite. testedtlib.py accidentally raised Exception on test failures, making check_compliance.py error out and skipping the rest of the tests when there were failures. Fix it. Signed-off-by: Ulf Magnusson --- scripts/dts/testedtlib.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/dts/testedtlib.py b/scripts/dts/testedtlib.py index ecd5e292f21..39c84c7c5dd 100755 --- a/scripts/dts/testedtlib.py +++ b/scripts/dts/testedtlib.py @@ -3,6 +3,8 @@ # Copyright (c) 2019 Nordic Semiconductor ASA # SPDX-License-Identifier: BSD-3-Clause +import sys + import edtlib # Test suite for edtlib.py. Mostly uses string comparisons via the various @@ -21,7 +23,7 @@ def run(): """ def fail(msg): - raise Exception("test failed: " + msg) + sys.exit("test failed: " + msg) def verify_streq(actual, expected): actual = str(actual)