]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
forked-test-driver: Show test output always
authorFrank Lichtenheld <frank@lichtenheld.com>
Thu, 25 Jan 2024 11:01:22 +0000 (12:01 +0100)
committerGert Doering <gert@greenie.muc.de>
Tue, 2 Apr 2024 15:20:48 +0000 (17:20 +0200)
We want to see the progress, at least for slow tests
like t_client.sh.

Change-Id: I11e0091482d9acee89ca018374cb8d96d22f8514
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Message-Id: <20240125110122.16257-1-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28133.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
forked-test-driver

index be73b80adf95515f3fc7cdc504facb29bc12e6b3..6971dfb3eb93bcaaf100af7e94f9f4d19bd44e69 100755 (executable)
@@ -108,9 +108,14 @@ trap "st=143; $do_exit" 15
 # Test script is run here. We create the file first, then append to it,
 # to ameliorate tests themselves also writing to the log file. Our tests
 # don't, but others can (automake bug#35762).
+# OVPN changes:
+#  - add tee to see output of tests
+#  - needs portable pipefail mechanism
+estatusfile="${trs_file}.exit"
 : >"$log_file"
-"$@" >>"$log_file" 2>&1
-estatus=$?
+("$@" 2>&1; estatus=$?; echo $estatus >"$estatusfile") | tee -a "$log_file"
+estatus=$(cat "$estatusfile")
+rm -f "$estatusfile"
 
 if test $enable_hard_errors = no && test $estatus -eq 99; then
   tweaked_estatus=1