Fix unittest script to report error (#2280)
author오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Tue, 14 Aug 2018 00:27:51 +0000 (09:27 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Tue, 14 Aug 2018 00:27:51 +0000 (09:27 +0900)
Fix unittest script to report error
- Save test result immediately to temporary variable
- We should save result before compare statement

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
tools/test_driver/run_unittest.sh

index ccc3d60..a557f4f 100755 (executable)
@@ -92,8 +92,9 @@ for TEST_BIN in `ls $UNITTEST_TEST_DIR --hide=*.skip`; do
     echo "Starting set $num_unittest: $TEST_BIN..."
     echo "============================================"
     $UNITTEST_TEST_DIR/$TEST_BIN $(get_gtest_option)
-    if [[ $? -ne 0 ]]; then
-        UNITTEST_RESULT=$?
+    TEMP_UNITTEST_RESULT=$?
+    if [[ $TEMP_UNITTEST_RESULT -ne 0 ]]; then
+        UNITTEST_RESULT=$TEMP_UNITTEST_RESULT
         echo "$TEST_BIN failed... return code: $UNITTEST_RESULT"
     fi
     echo "============================================"