From 0ffbf44d709da783abaa0ab1dde222d0c84c6bc2 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Wed, 9 Jan 2013 20:20:58 -0800 Subject: [PATCH] Add test for syntax, strict, and warnings --- t/strict.t | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 t/strict.t diff --git a/t/strict.t b/t/strict.t new file mode 100755 index 0000000..04e196a --- /dev/null +++ b/t/strict.t @@ -0,0 +1,32 @@ +#!/usr/bin/perl +# +# Test Perl code for strict, warnings, and syntax. +# +# Written by Russ Allbery +# +# 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_*'); -- 2.39.5