add compile test
skaufman [Wed, 13 Aug 2014 15:10:52 +0000 (16:10 +0100)]
t/compile.t [new file with mode: 0644]

diff --git a/t/compile.t b/t/compile.t
new file mode 100644 (file)
index 0000000..05ffd87
--- /dev/null
@@ -0,0 +1,24 @@
+use strict;
+use warnings FATAL => 'all';
+use Test::Compile::Internal;
+use Test::More;
+use Module::Runtime qw[ use_module ];
+use FindBin;
+use lib "$FindBin::Bin/../lib";
+use lib "$FindBin::Bin/../SocialFlow-Web-Config/lib";
+
+BEGIN {
+    use FindBin;
+    $ENV{SOCIALFLOW_TEMPLATE_PATH} = "$FindBin::Bin/../root/templates";
+};
+
+my @pms = Test::Compile::Internal->all_pm_files("lib");
+
+plan tests => 0+@pms;
+
+for my $pm (@pms) {
+    $pm =~ s!(^lib/|\.pm$)!!g;
+    $pm =~ s|/|::|g;
+    ok use_module($pm),$pm;
+    $pm->import;
+}