diff options
author | Matthias Kretz <kretz@kde.org> | 2021-02-03 15:49:30 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2021-02-03 15:49:30 +0000 |
commit | ec384c56900748ef1f0cabb7df0f71f716bb2313 (patch) | |
tree | 45e69d7aae275f33749bfe3821776e9bbf6acf9d | |
parent | b83a52fe07b36f65ccd73c9c8c1796f92db6f191 (diff) | |
download | gcc-ec384c56900748ef1f0cabb7df0f71f716bb2313.zip gcc-ec384c56900748ef1f0cabb7df0f71f716bb2313.tar.gz gcc-ec384c56900748ef1f0cabb7df0f71f716bb2313.tar.bz2 |
libstdc++: Abort test after 1000 lines of output
Handle overly large output by aborting the log and thus the test. This
is a similar condition to a timeout.
libstdc++-v3/ChangeLog:
* testsuite/experimental/simd/driver.sh: When handling the pipe
to log (and on verbose to stdout) count the lines. If it exceeds
1000 log the issue and exit 125, which is then handled as a
failure.
-rwxr-xr-x | libstdc++-v3/testsuite/experimental/simd/driver.sh | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libstdc++-v3/testsuite/experimental/simd/driver.sh b/libstdc++-v3/testsuite/experimental/simd/driver.sh index 314c6a1..719e4db 100755 --- a/libstdc++-v3/testsuite/experimental/simd/driver.sh +++ b/libstdc++-v3/testsuite/experimental/simd/driver.sh @@ -258,7 +258,11 @@ BEGIN { count = 0 } /^###exitstatus### [0-9]+$/ { exit \$2 } { print >> \"$log\" - if (count >= 1000) next + if (count >= 1000) { + print \"Aborting: too much output\" >> \"$log\" + print \"Aborting: too much output\" + exit 125 + } ++count if (length(\$0) > $maxcol) { i = 1 @@ -282,8 +286,17 @@ END { close(\"$log\") } " else awk " +BEGIN { count = 0 } /^###exitstatus### [0-9]+$/ { exit \$2 } -{ print >> \"$log\" } +{ + print >> \"$log\" + if (count >= 1000) { + print \"Aborting: too much output\" >> \"$log\" + print \"Aborting: too much output\" + exit 125 + } + ++count +} END { close(\"$log\") } " fi |