utils/test-pkg: ensure to exit with an error upon failure
authorHeiko Thiery <heiko.thiery@kontron.com>
Thu, 10 Oct 2019 10:24:26 +0000 (12:24 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 10 Oct 2019 20:54:12 +0000 (22:54 +0200)
This commit modifies the main() function so that it returns the sum of
build and legal errors, making sure the overall test-pkg script exists
with a non-zero error code upon failure.

Signed-off-by: Heiko Thiery <heiko.thiery@kontron.com>
[Thomas: improved commit log]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
utils/test-pkg

index f3b34d5d0d58fa61097e65aa55ffc26d76811595..a317d8c17aa47c29c98930519e58c7832504c251 100755 (executable)
@@ -138,6 +138,8 @@ main() {
 
     printf "%d builds, %d skipped, %d build failed, %d legal-info failed\n" \
         ${nb} ${nb_skip} ${nb_fail} ${nb_legal}
+
+    return $((nb_fail + nb_legal))
 }
 
 build_one() {