summaryrefslogtreecommitdiffstats
path: root/vespaclient/src/perl/test/Generic/UseTest.pl
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
committerJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
commit72231250ed81e10d66bfe70701e64fa5fe50f712 (patch)
tree2728bba1131a6f6e5bdf95afec7d7ff9358dac50 /vespaclient/src/perl/test/Generic/UseTest.pl
Publish
Diffstat (limited to 'vespaclient/src/perl/test/Generic/UseTest.pl')
-rw-r--r--vespaclient/src/perl/test/Generic/UseTest.pl34
1 files changed, 34 insertions, 0 deletions
diff --git a/vespaclient/src/perl/test/Generic/UseTest.pl b/vespaclient/src/perl/test/Generic/UseTest.pl
new file mode 100644
index 00000000000..d2c051d395a
--- /dev/null
+++ b/vespaclient/src/perl/test/Generic/UseTest.pl
@@ -0,0 +1,34 @@
+# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#
+# That that all perl files use strict and warnings
+#
+
+use Test::More;
+use TestUtils::VespaTest;
+
+use strict;
+use warnings;
+
+my @dirs = (
+ '../bin',
+ '../lib',
+ 'Yahoo/Vespa/Mocks'
+);
+
+my $checkdirs = join(' ', @dirs);
+
+my @files = `find $checkdirs -name \\*.pm -or -name \\*.pl`;
+chomp @files;
+
+printTest "Checking " . (scalar @files) . " files for includes.\n";
+
+foreach my $file (@files) {
+ ok( system("cat $file | grep 'use strict;' >/dev/null") == 0,
+ "$file use strict" );
+ ok( system("cat $file | grep 'use warnings;' >/dev/null") == 0,
+ "$file use warnings" );
+}
+
+done_testing();
+
+exit(0);