[PATCH v1 1/3] travis-ci: move "after_failure" code to dedicated file in /ci

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Lars Schneider <larsxschneider@xxxxxxxxx>

Move the code and adjust it to the Git shell script coding guidelines.

Signed-off-by: Lars Schneider <larsxschneider@xxxxxxxxx>
---
 .travis.yml       | 12 +-----------
 ci/test-report.sh | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 11 deletions(-)
 create mode 100755 ci/test-report.sh

diff --git a/.travis.yml b/.travis.yml
index adab5b8..a93ecb3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -101,17 +101,7 @@ script: make --quiet test
 after_failure:
   - >
     : '<-- Click here to see detailed test output!                                                        ';
-    for TEST_EXIT in t/test-results/*.exit;
-    do
-      if [ "$(cat "$TEST_EXIT")" != "0" ];
-      then
-        TEST_OUT="${TEST_EXIT%exit}out";
-        echo "------------------------------------------------------------------------";
-        echo "$(tput setaf 1)${TEST_OUT}...$(tput sgr0)";
-        echo "------------------------------------------------------------------------";
-        cat "${TEST_OUT}";
-      fi;
-    done;
+    ./ci/test-report.sh
 
 notifications:
   email: false
diff --git a/ci/test-report.sh b/ci/test-report.sh
new file mode 100755
index 0000000..d08a999
--- /dev/null
+++ b/ci/test-report.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# Print test results
+#
+for TEST_EXIT in t/test-results/*.exit
+do
+	if test "$(cat "$TEST_EXIT")" != "0"
+	then
+		TEST="${TEST_EXIT%.exit}"
+		TEST_OUT="${TEST}.out"
+		echo "------------------------------------------------------------------------"
+		echo "  $(tput setaf 1)${TEST} Output$(tput sgr0)"
+		echo "------------------------------------------------------------------------"
+		cat "$TEST_OUT"
+		echo ""
+		echo ""
+	fi
+done
+
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]