public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r11-7078] libstdc++: Abort test after 1000 lines of output
Date: Wed,  3 Feb 2021 15:50:59 +0000 (GMT)	[thread overview]
Message-ID: <20210203155059.75B0139B8CB2@sourceware.org> (raw)

https://gcc.gnu.org/g:ec384c56900748ef1f0cabb7df0f71f716bb2313

commit r11-7078-gec384c56900748ef1f0cabb7df0f71f716bb2313
Author: Matthias Kretz <kretz@kde.org>
Date:   Wed Feb 3 15:49:30 2021 +0000

    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.

Diff:
---
 libstdc++-v3/testsuite/experimental/simd/driver.sh | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/testsuite/experimental/simd/driver.sh b/libstdc++-v3/testsuite/experimental/simd/driver.sh
index 314c6a16f86..719e4db8e68 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


                 reply	other threads:[~2021-02-03 15:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210203155059.75B0139B8CB2@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).