[tflchef] Log test output (#2606)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Tue, 11 Dec 2018 01:41:10 +0000 (10:41 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Tue, 11 Dec 2018 01:41:10 +0000 (10:41 +0900)
* [tflchef] Log test output

This commit revises runall to log the output of each test into a
dedicated file.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
* Log running command

contrib/tflchef/tests/runall

index 0512844..c697f1b 100755 (executable)
@@ -23,9 +23,22 @@ while [[ $# -ne 0 ]]; do
 
   TESTED+=("${PREFIX}")
 
-  "${NNKIT_RUN_PATH}" --backend "${TFLITE_BACKEND_PATH}" --backend-arg "${PREFIX}.tflite"
+  PASSED_TAG="${PREFIX}.passed"
 
-  if [[ $? -eq 0 ]]; then
+  rm -f "${PASSED_TAG}"
+
+  cat > "${PREFIX}.log" <(
+    exec 2>&1
+
+    echo "'${NNKIT_RUN_PATH}' --backend '${TFLITE_BACKEND_PATH}' --backend-arg '${PREFIX}.tflite'"
+    "${NNKIT_RUN_PATH}" --backend "${TFLITE_BACKEND_PATH}" --backend-arg "${PREFIX}.tflite"
+
+    if [[ $? -eq 0 ]]; then
+      touch "${PASSED_TAG}"
+    fi
+  )
+
+  if [[ -f "${PASSED_TAG}" ]]; then
     PASSED+=("$PREFIX")
   else
     FAILED+=("$PREFIX")