[SCM] Debian Qt/KDE packaging tools branch, master, updated. debian/0.7.3-9-gd1e71ad

Modestas Vainius modax at alioth.debian.org
Fri May 14 13:27:17 UTC 2010


The following commit has been merged in the master branch:
commit 5eb53eefadf15fbf9f1ab88dbb531f0e4a446e86
Author: Modestas Vainius <modestas at vainius.eu>
Date:   Fri May 14 16:24:35 2010 +0300

    Add t/perl_syntax_check.t for checking syntax of the perl scripts in the package.
---
 debian/changelog      |    2 ++
 t/perl_syntax_check.t |   27 +++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 92137b5..f423306 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,8 @@ pkg-kde-tools (0.7.4~pre1) UNRELEASED; urgency=low
   * Add run-local wrapper for easy execution of scripts directly from the
     source package.
   * Add support for perl tests under t/*.t subdirectory to Makefile.
+  * Add t/perl_syntax_check.t for checking syntax of the perl scripts in
+    the package.
 
  -- Modestas Vainius <modax at debian.org>  Tue, 04 May 2010 11:09:03 +0300
 
diff --git a/t/perl_syntax_check.t b/t/perl_syntax_check.t
new file mode 100644
index 0000000..f97241d
--- /dev/null
+++ b/t/perl_syntax_check.t
@@ -0,0 +1,27 @@
+use Test::More;
+use File::Find;
+
+my @files;
+
+# Find all perl modules
+find(sub { push @files, $File::Find::name if /\.pm$/ }, "perllib", "datalib");
+
+# Find all perl executables in the top level
+foreach my $file (glob('*')) {
+    if (-f $file && -x $file) {
+        open(my $fh, "<", $file) or die "Unable to open $file for reading";
+        my $line = <$fh>;
+        if ($line =~ /^#!.*\/perl$/) {
+            push @files, $file;
+        }
+        close($fh);
+    }
+}
+
+# Setup a plan
+plan tests => scalar(@files);
+
+foreach my $file (@files) {
+    isnt(system("LANG=C $^X -c $file 2>&1 | grep -v 'syntax OK\$' >&2"), 0,
+        "Syntax check of $file");
+}

-- 
Debian Qt/KDE packaging tools



More information about the pkg-kde-commits mailing list