linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH 3/6] testsuite: grep the output patterns only when needed
Date: Sun, 28 May 2017 21:29:03 +0200	[thread overview]
Message-ID: <20170528192906.1023-4-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20170528192906.1023-1-luc.vanoostenryck@gmail.com>

For some testcase, it is checked if the output contains or not
some given pattern, or we're checking the number of time a
pattern is present in the output.
This is done with grep and some glue.

But for most testcases there is nothing to check and this
grepping is just wasted CPU cycles.

Fix this by using the already known tags to see if we need to
do this grepping or not.

This speedup the testsuite by another 15%.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 validation/test-suite | 33 +++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/validation/test-suite b/validation/test-suite
index ce2ca454c..e33d97804 100755
--- a/validation/test-suite
+++ b/validation/test-suite
@@ -244,22 +244,27 @@ do_test()
 	fi
 
 	# verify the 'check-output-contains/excludes' tags
-	has_each_patterns "$file" 'check-output-contains' $file.output.got
-	if [ "$?" -ne "0" ]; then
-		error "Actual output doesn't contain some of the expected patterns."
-		test_failed=1
+	if [ $check_output_contains -eq 1 ]; then
+		has_each_patterns "$file" 'check-output-contains' $file.output.got
+		if [ "$?" -ne "0" ]; then
+			error "Actual output doesn't contain some of the expected patterns."
+			test_failed=1
+		fi
 	fi
-	has_none_patterns "$file" 'check-output-excludes' $file.output.got
-	if [ "$?" -ne "0" ]; then
-		error "Actual output contains some patterns which are not expected."
-		test_failed=1
+	if [ $check_output_excludes -eq 1 ]; then
+		has_none_patterns "$file" 'check-output-excludes' $file.output.got
+		if [ "$?" -ne "0" ]; then
+			error "Actual output contains some patterns which are not expected."
+			test_failed=1
+		fi
 	fi

  parent reply	other threads:[~2017-05-28 19:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-28 19:29 [PATCH 0/6] testsuite speedup Luc Van Oostenryck
2017-05-28 19:29 ` [PATCH 1/6] testsuite: get all tags in once Luc Van Oostenryck
2017-05-28 19:29 ` [PATCH 2/6] testsuite: grep the expected output only when needed Luc Van Oostenryck
2017-05-28 19:29 ` Luc Van Oostenryck [this message]
2017-05-28 19:29 ` [PATCH 4/6] testsuite: use shell arithmetic instead of fork-execing expr Luc Van Oostenryck
2017-05-28 19:29 ` [PATCH 5/6] testsuite: remove unneeded './' before commands Luc Van Oostenryck
2017-05-28 19:29 ` [PATCH 6/6] testsuite: avoid fork+execing basename Luc Van Oostenryck
2017-05-28 22:04 ` [PATCH 0/6] testsuite speedup Ramsay Jones
2017-05-28 22:39   ` Luc Van Oostenryck
2017-05-29  1:44     ` Ramsay Jones
2017-06-01  9:16 ` Christopher Li
2017-06-01 14:05   ` Luc Van Oostenryck
2017-06-02  7:29     ` Christopher Li
2017-06-02 10:57       ` Luc Van Oostenryck

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=20170528192906.1023-4-luc.vanoostenryck@gmail.com \
    --to=luc.vanoostenryck@gmail.com \
    --cc=linux-sparse@vger.kernel.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 NNTP newsgroup(s).