Linux-Sparse 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] testsuite: add option '-r' to 'test-suite format'
Date: Sun, 21 Mar 2021 13:54:25 +0100	[thread overview]
Message-ID: <20210321125425.28528-1-luc.vanoostenryck@gmail.com> (raw)

Because laziness is a virtue, add an option '-r' to the 'format'
subcommand of the testsuite to quickly create a test template for
linearized code which should just return 1.

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

diff --git a/validation/test-suite b/validation/test-suite
index 1b05c75e9f74..370cd35a8f70 100755
--- a/validation/test-suite
+++ b/validation/test-suite
@@ -512,6 +512,7 @@ echo "options:"
 echo "    -a                         append the created test to the input file"
 echo "    -f                         write a test known to fail"
 echo "    -l                         write a test for linearized code"
+echo "    -r                         write a test for linearized code returning 1"
 echo "    -p                         write a test for pre-processing"
 echo
 echo "argument(s):"
@@ -528,6 +529,7 @@ do_format()
 	append=0
 	linear=0
 	fail=0
+	ret=''
 
 	while [ $# -gt 0 ] ; do
 		case "$1" in
@@ -538,6 +540,9 @@ do_format()
 		-l)
 			def_cmd='test-linearize -Wno-decl $file'
 			linear=1 ;;
+		-r)
+			def_cmd='test-linearize -Wno-decl $file'
+			ret=1 ;;
 		-p)
 			def_cmd='sparse -E $file' ;;
 
@@ -582,6 +587,12 @@ _EOF
 	if [ $fail != 0 ]; then
 		echo " * check-known-to-fail"
 	fi
+	if [ "$ret" != '' ]; then
+		echo ' *'
+		echo ' * check-output-ignore'
+		echo " * check-output-returns: $ret"
+		rm -f "$file.output.got"
+	fi
 	if [ $linear != 0 ]; then
 		echo ' *'
 		echo ' * check-output-ignore'
-- 
2.31.0


                 reply	other threads:[~2021-03-21 12:55 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=20210321125425.28528-1-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 read-only IMAP folder(s) and NNTP newsgroup(s).