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

[SCM] Debian package checker branch, master, updated. 1.24.4-116-g35bb1ea



The following commit has been merged in the master branch:
commit 026ef67416a5cb244fa31842524febfe597dcbe3
Author: Frank Lichtenheld <djpig@debian.org>
Date:   Sat Sep 13 00:19:12 2008 +0200

    t{,estset}/runtests: Print a warning if no tests were run
    
    Based on a patch by Raphael Geissert.

diff --git a/debian/changelog b/debian/changelog
index e1a7c80..8c7ce21 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -126,7 +126,12 @@ lintian (2.0.0~rc1) experimental; urgency=low
     + [FL] Copy the changes to testset/runtests from JP's branch.
     + [FL] Remove global tests that were duplicated from testset/runtests,
       which will not go away in the forseeable future.
+    + [FL] Print a warning if no tests were run.  Based on a patch by
+      Raphael Geissert.
     + [RA] Fix single test mode.
+  * testset/runtests:
+    + [FL] Print a warning if no tests were run.  Based on a patch by
+      Raphael Geissert.
 
  -- Frank Lichtenheld <djpig@debian.org>  Sat, 23 Aug 2008 22:55:44 +0200
 
diff --git a/t/runtests b/t/runtests
index 6e03822..426558b 100755
--- a/t/runtests
+++ b/t/runtests
@@ -138,9 +138,11 @@ if ($singletest) {
     @tests = map { s#^\Q$testset/tests/\E## ;s/\.desc$//; $_ } sort(<$testset/tests/*.desc>);
 }
 
-print "found the following tests: @tests\n" if $debug;
+print "Found the following tests: @tests\n" if $debug;
+my $tests_run = 0;
 for (@tests) {
     my $testdesc = "$testset/tests/$_.desc";
+    next unless -f $testdesc;
 
     print "process $testdesc...\n" if $debug;
     my $testdata = (read_dpkg_control($testdesc))[0];
@@ -202,6 +204,7 @@ for (@tests) {
 	if -e "$origdir/post_test";
 
     $testok = runsystem_ok("cmp", "-s", "$rundir/tags.$pkg", "$origdir/tags");
+    $tests_run++;
     if ($testok) {
 	print "done.\n";
     } else {
@@ -224,6 +227,14 @@ for (@tests) {
      close TAGS;
 }
 
+if (!$tests_run) {
+    if ($singletest) {
+	print "W: No tests run, did you specify a valid test name?\n";
+    } else {
+	print "E: No tests run, did you specify a valid testset directory?\n";
+    }
+}
+
 # --------------
 sub runsystem {
     print "runsystem(@_)\n" if $debug;
diff --git a/testset/runtests b/testset/runtests
index f02ef07..0759f7e 100755
--- a/testset/runtests
+++ b/testset/runtests
@@ -245,6 +245,7 @@ if ($singletest) {
 	closedir(TESTDIR);
 }
 
+my $tests_run = 0;
 for (@tests) {
     next if $_ eq '.' or $_ eq '..' or $_ eq 'CVS' or $_ eq '.svn';
     next unless -d "$testset/$_";
@@ -289,6 +290,7 @@ for (@tests) {
 	if -e "$testset/tags.$pkg.sed";
 
     $testok = runsystem_ok("cmp -s $rundir/tags.$pkg $testset/tags.$pkg");
+    $tests_run++;
     if ($testok) {
 	print "done.\n";
     } else {
@@ -300,7 +302,7 @@ for (@tests) {
 
     open TAGS, "$rundir/tags.$pkg" or fail("Cannot open $rundir/tags.$pkg");
     while (<TAGS>) {
-	next if /^N: /;
+	next if m/^N: /;
 	if (not /^(.): (\S+)(?: (?:source|udeb))?: (\S+)/) {
 	    print "E: Invalid line:\n$_";
 	    next;
@@ -311,6 +313,14 @@ for (@tests) {
     close TAGS;
 }
 
+if (!$tests_run) {
+    if ($singletest) {
+	print "W: No tests run, did you specify a valid test name?\n";
+    } else {
+	print "E: No tests run, did you specify a valid testset directory?\n";
+    }
+}
+
 print "Checking whether all tags are tested and tags have description ... \n";
 $testok = 1;
 for (keys %tags) {

-- 
Debian package checker


Reply to: