From ef2dd74a86e2125215fadf5a6f376086d689c214 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 11 Sep 2024 12:48:16 +0200 Subject: [PATCH] Run test suites with a single call to run-test-suites.pl Before this commit, `make test` stopped after running the TLS tests if there was a failure. Have `run-test-suites.pl` take care of looking in all the directories, so that the last line of output from `make test` is an accurate report of all the test suites, not just the test suites from the last run of `run-test-suites.pl`. Signed-off-by: Gilles Peskine --- tests/Makefile | 1 - tests/scripts/run-test-suites.pl | 9 ++++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index 3f1a6dfcfd..635816b50f 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -270,7 +270,6 @@ endif # Test suites caught by SKIP_TEST_SUITES are built but not executed. check: $(BINARIES) $(CRYPTO_BINARIES) perl scripts/run-test-suites.pl $(TEST_FLAGS) --skip=$(SKIP_TEST_SUITES) - cd ../tf-psa-crypto/tests && perl ../../tests/scripts/run-test-suites.pl $(TEST_FLAGS) --skip=$(SKIP_TEST_SUITES) test: check diff --git a/tests/scripts/run-test-suites.pl b/tests/scripts/run-test-suites.pl index 408deaf13b..8274210e6f 100755 --- a/tests/scripts/run-test-suites.pl +++ b/tests/scripts/run-test-suites.pl @@ -40,7 +40,8 @@ GetOptions( # All test suites = executable files with a .datax file. my @suites = (); -for my $data_file (glob 'test_suite_*.datax') { +my @test_dirs = qw(../tf-psa-crypto/tests .); +for my $data_file (map {glob "$_/test_suite_*.datax"} @test_dirs) { (my $base = $data_file) =~ s/\.datax$//; push @suites, $base if -x $base; push @suites, "$base.exe" if -e "$base.exe"; @@ -82,8 +83,10 @@ sub pad_print_center { print $padchar x( $padlen ), " $string ", $padchar x( $padlen ), "\n"; } -for my $suite (@suites) +for my $suite_path (@suites) { + my $suite = $suite_path; + $suite =~ s!.*/!!; print "$suite ", "." x ( 72 - length($suite) - 2 - 4 ), " "; if( $suite =~ /$skip_re/o ) { print "SKIP\n"; @@ -91,7 +94,7 @@ for my $suite (@suites) next; } - my $command = "$prefix$suite"; + my $command = "$prefix$suite_path"; if( $verbose ) { $command .= ' -v'; }