From ef9657017cf082bd49ed81f3df85a0fb1786f715 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 5 Sep 2010 02:20:56 +0200 Subject: selftest: Print out unmatched tests when using --load-list. --- selftest/selftest.pl | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'selftest/selftest.pl') diff --git a/selftest/selftest.pl b/selftest/selftest.pl index cf79c83441..2d936e24ca 100755 --- a/selftest/selftest.pl +++ b/selftest/selftest.pl @@ -698,8 +698,8 @@ my $restricted = undef; if ($opt_load_list) { $restricted = []; open(LOAD_LIST, "<$opt_load_list") or die("Unable to open $opt_load_list"); - while () { - chomp; + while () { + chomp; push (@$restricted, $_); } close(LOAD_LIST); @@ -723,8 +723,7 @@ foreach my $testsuite (@available) { if ($r eq $name) { $individual_tests->{$name} = []; $match = 1; - } - if ($r =~ /^$name\.(.*)$/) { + } elsif ($r =~ /^$name\.(.*)$/) { push(@{$individual_tests->{$name}}, $1); $match = 1; } @@ -735,10 +734,16 @@ foreach my $testsuite (@available) { } } -if ($#todo == -1) { +if (defined($restricted)) { + foreach (@$restricted) { + unless (defined($individual_tests->{$_})) { + print "No test or testsuite found matching $_\n"; + } + } +} elsif ($#todo == -1) { print STDERR "No tests to run\n"; exit(1); - } +} my $suitestotal = $#todo + 1; my $i = 0; @@ -938,7 +943,7 @@ $envvarstr $cmd =~ s/([\(\)])/\\$1/g; my $name = $$_[0]; my $envname = $$_[1]; - + my $envvars = setup_env($envname); if (not defined($envvars)) { Subunit::skip_testsuite($name, -- cgit