]> git.michaelhowe.org Git - packages/a/afs-monitor.git/commitdiff
Add test for syntax, strict, and warnings
authorRuss Allbery <rra@stanford.edu>
Thu, 10 Jan 2013 04:20:58 +0000 (20:20 -0800)
committerRuss Allbery <rra@stanford.edu>
Thu, 10 Jan 2013 04:20:58 +0000 (20:20 -0800)
t/strict.t [new file with mode: 0755]

diff --git a/t/strict.t b/t/strict.t
new file mode 100755 (executable)
index 0000000..04e196a
--- /dev/null
@@ -0,0 +1,32 @@
+#!/usr/bin/perl
+#
+# Test Perl code for strict, warnings, and syntax.
+#
+# Written by Russ Allbery <rra@stanford.edu>
+#
+# The authors hereby relinquish any claim to any copyright that they may have
+# in this work, whether granted under contract or by operation of law or
+# international treaty, and hereby commit to the public, at large, that they
+# shall not, at any time in the future, seek to enforce any copyright in this
+# work against any person or entity, or prevent any person or entity from
+# copying, publishing, distributing or creating derivative works of this work.
+
+use strict;
+use warnings;
+
+use File::Spec;
+use Test::More;
+
+# Skip tests if Test::Strict is not installed.
+if (!eval { require Test::Strict }) {
+    plan skip_all => 'Test::Strict required to test Perl syntax';
+
+    # Suppress "only used once" warnings.
+    $Test::Strict::TEST_WARNINGS = 0;
+}
+Test::Strict->import;
+
+# Test everything in the distribution directory.  We also want to check use
+# warnings.
+$Test::Strict::TEST_WARNINGS = 1;
+all_perl_files_ok(glob 'check_*');