[PATCH 3/3] gdb/testsuite: improve rerun scripts generated by make-check-all.sh

Andrew Burgess <[email protected]>
Newsgroups gmane.comp.gdb.patches
Message-ID <9cd9c53b7561d09ee1a6b18d0fce52b64ceb555c.1784373976.git.aburgess@redhat.com>
The make-check-all.sh script creates little scripts that allow each
board to easily be rerun, useful if a particular test fails and you
want to check a possible fix.

The scripts as currently generated only include the 'make check-...'
line, and are not executable, which means you need to first change to
the correct directory, and invoke the script with 'sh'.

This commit extends the script to include a '#! /bin/sh' line as well
as a 'cd ....' line to switch to the correct directory to run the
test.  The script is then made executable.

It should now be easier to rerun tests.  There is no change to how
tests are run, or what tests are run with this commit.
---
 gdb/testsuite/make-check-all.sh | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/make-check-all.sh b/gdb/testsuite/make-check-all.sh
index 3cf6b46cdb0..8708ecec1cc 100755
--- a/gdb/testsuite/make-check-all.sh
+++ b/gdb/testsuite/make-check-all.sh
@@ -215,8 +215,14 @@ do_tests ()
 	cp gdb.sum gdb.log "$dir"
 
 	# Record the 'make check' command to enable easy re-running.
-	echo "make $maketarget RUNTESTFLAGS=\"${rtf[*]}\" TESTS=\"${tests[*]}\"" \
-	     > "$dir/make-check.sh"
+	make_check_script="$dir/make-check.sh"
+	cat <<-EOF > "$make_check_script"
+	#!/bin/sh
+
+	cd "$PWD" && \\
+	  make $maketarget RUNTESTFLAGS="${rtf[*]}" TESTS="${tests[*]}"
+	EOF
+	chmod +x "$make_check_script"
     fi
 }
 
-- 
2.25.4
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.