Browse code

forked-test-driver: Show test output always

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>

Frank Lichtenheld authored on 2024/01/25 20:01:22
Showing 1 changed files
... ...
@@ -108,9 +108,14 @@ trap "st=143; $do_exit" 15
108 108
 # Test script is run here. We create the file first, then append to it,
109 109
 # to ameliorate tests themselves also writing to the log file. Our tests
110 110
 # don't, but others can (automake bug#35762).
111
+# OVPN changes:
112
+#  - add tee to see output of tests
113
+#  - needs portable pipefail mechanism
114
+estatusfile="${trs_file}.exit"
111 115
 : >"$log_file"
112
-"$@" >>"$log_file" 2>&1
113
-estatus=$?
116
+("$@" 2>&1; estatus=$?; echo $estatus >"$estatusfile") | tee -a "$log_file"
117
+estatus=$(cat "$estatusfile")
118
+rm -f "$estatusfile"
114 119
 
115 120
 if test $enable_hard_errors = no && test $estatus -eq 99; then
116 121
   tweaked_estatus=1