[PATCH 14/16] testsuite: allow to test only a subdir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



During development, it is very useful to be able to run only
some of the tests, maybe a whole class.

Help this by allowing to run the testsuite on only a subdir
of the 'validation/' directory.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 validation/test-suite | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/validation/test-suite b/validation/test-suite
index 854ad8add..098cc7869 100755
--- a/validation/test-suite
+++ b/validation/test-suite
@@ -238,6 +238,7 @@ echo "    -q|--quiet                 Be extra quiet while running the tests."
 echo
 echo "commands:"
 echo "    [file ...]                 Runs the test suite on the given file(s)."
+echo "                               If a directory is given, run only those files."
 echo "                               If no file is given, run the whole testsuite."
 echo "    single file                Run the test in 'file'."
 echo "    format file [name [cmd]]   Help writing a new test case using cmd."
@@ -517,10 +518,6 @@ while [ "$#" -gt "0" ]; do
 		shift
 		continue
 		;;
-	*.c)
-		tests_list="$@"
-		break
-		;;
 
 	single|--single)
 		arg_file "$2"
@@ -537,10 +534,25 @@ while [ "$#" -gt "0" ]; do
 		do_format "$@"
 		exit 0
 		;;
-	help | *)
+	help)
 		do_usage
 		exit 1
 		;;
+
+	*.c)
+		tests_list="$tests_list $1"
+		shift
+		continue
+		;;
+	*)
+		if [ ! -d "$1" ]; then
+			do_usage
+			exit 1
+		fi
+		tests_list="$tests_list $(find "$1" -name '*.c' | sort)"
+		shift
+		continue
+		;;
 	esac
 	break
 done
-- 
2.15.0

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux