You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/01/02 10:31:59 UTC

[GitHub] utzig closed pull request #16: Add more qemu error messages to CI

utzig closed pull request #16: Add more qemu error messages to CI
URL: https://github.com/apache/mynewt-nffs/pull/16
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/ci/zephyr_run.sh b/ci/zephyr_run.sh
index 2be666d..9b1dc20 100755
--- a/ci/zephyr_run.sh
+++ b/ci/zephyr_run.sh
@@ -16,17 +16,28 @@ make
 output="${HOME}/zephyr-results.txt"
 (make run | tee ${output}) &
 
-# qemu output strings in case of failure
-failed1="ASSERTION FAIL"
-failed2="CPU Page Fault"
 succeded="PROJECT EXECUTION SUCCESSFUL"
+
+# There are multiple possible output messages, depending on which test was
+# run, where it failed, or when some low-level fault in qemu happens.
+declare -a finished_msgs=(
+    "ASSERTION FAIL"
+    "CPU Page Fault"
+    "PROJECT EXECUTION FAILED"
+    "${succeded}"
+)
+
 MAX_LOOPS=10
 count=1
-while true; do
-    [[ $count == $MAX_LOOPS ]] && break
-    grep -q -e "${failed1}" -e "${failed2}" -e "${succeded}" ${output}
-    [[ $? -eq 0 ]] && break
-
+while [[ $count -lt $MAX_LOOPS ]]; do
+    for msg in "${finished_msgs[@]}"; do
+        grep -q -e "${msg}" ${output}
+        rc=$?
+        # break inner loop
+        [[ ${rc} -eq 0 ]] && break
+    done
+
+    [[ ${rc} -eq 0 ]] && break
     sleep 3
     count=$((count + 1))
 done
@@ -38,8 +49,4 @@ sleep 5  # give some time for qemu to close
 
 cat ${output}
 
-grep -q -e "${failed1}" -e "${failed2}" ${output}
-[[ $? -eq 0 ]] && exit 1
-
-# If the grep above fails, the test succeeded, so force success exit!
-exit 0
+grep -q -e "${succeded}" ${output}


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services