unit-test.py: capture and forward failure

A failure in the make will be caught and dropped as far as
the CI is concerned.  This will pass that failure onto the CI.

Change-Id: I9b36c3128176261344cb0e4e8827de174a482170
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/scripts/unit-test.py b/scripts/unit-test.py
index 6b9f6d8..de657d8 100755
--- a/scripts/unit-test.py
+++ b/scripts/unit-test.py
@@ -437,14 +437,17 @@
     # Refresh dynamic linker run time bindings for dependencies
     check_call_cmd(os.path.join(WORKSPACE, UNIT_TEST_PKG), 'ldconfig')
     # Run package unit tests
+    rv = 0
     try:
         cmd = [ 'make', 'check' ]
         for i in range(0, args.repeat):
             check_call_cmd(os.path.join(WORKSPACE, UNIT_TEST_PKG),  *cmd)
     except CalledProcessError:
+        rv = 1
         for relpath in ("test/test-suite.log", "src/test/test-suite.log"):
             log = os.path.join(WORKSPACE, UNIT_TEST_PKG, relpath)
             if not os.path.exists(log):
                 continue
             check_call_cmd(os.path.join(WORKSPACE, UNIT_TEST_PKG), "cat", log)
     os.umask(prev_umask)
+    sys.exit(rv)