From d1bd8f89b78d99eb2c0bd70bd3e22f0ab2376a5d Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Wed, 10 Jun 2020 11:25:22 +0200 Subject: [PATCH] shtests: print CPU times used at end (re: ebf71e61) Since we now have a shiny new POSIX compliant 'times' builtin, we might as well use it. src/cmd/ksh93/tests/shtests: - Run 'times' at end of test run. - Skip the pretty-printing until #7 is fixed. (cherry picked from commit 2c27d9fbc239583004ec70377db98627eea5e294) --- src/cmd/ksh93/tests/shtests | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/cmd/ksh93/tests/shtests b/src/cmd/ksh93/tests/shtests index fe9e12e4c..4731c9061 100755 --- a/src/cmd/ksh93/tests/shtests +++ b/src/cmd/ksh93/tests/shtests @@ -386,4 +386,18 @@ do [[ $i == *.sh ]] || i+='.sh' fi done print "Total errors: $total_e" + +# TODO: output process substitution is fatally broken. +# Until that is fixed, skip the pretty-printing. +# See https://github.com/modernish/ksh/issues/7 +#print $'CPU time used:\n\\t user:\t system:' +#times > >( +# t[0]='main' +# read t[1] t[2] +# t[3]='*.sh' +# read t[4] t[5] +# printf '%s:\t%s\t%s\n' "${t[@]}" +#) +times + exit $((total_e > 125 ? 125 : total_e))