[Rt-commit] rt branch, 4.0/test-scripts-compile, created. rt-4.0.16-49-g3758840

Thomas Sibley trs at bestpractical.com
Tue Jul 30 14:56:35 EDT 2013


The branch, 4.0/test-scripts-compile has been created
        at  3758840df908ec874754fbcf4bd3634ccc256f87 (commit)

- Log -----------------------------------------------------------------
commit 3758840df908ec874754fbcf4bd3634ccc256f87
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Jul 30 11:24:09 2013 -0700

    Test that all bin/ and sbin/ scripts compile
    
    This catches problems introduced by problems such as 8acb3b7.

diff --git a/t/99-policy.t b/t/99-policy.t
index 0b9f261..01c4091 100644
--- a/t/99-policy.t
+++ b/t/99-policy.t
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use RT::Test nodb => 1;
+use RT::Test;
 use File::Find;
 
 my @files;
@@ -24,6 +24,7 @@ sub check {
         shebang  => 0,
         exec     => 0,
         bps_tag  => 0,
+        compile_perl => 0,
         @_,
     );
 
@@ -76,6 +77,12 @@ sub check {
     } elsif ($check{exec} == -1) {
         ok( !$executable, "$file permission is u-x" );
     }
+
+    if ($check{compile_perl}) {
+        my $output = `$^X -c $file 2>&1`;
+        ok( !$?, "$file compiles OK with perl ($^X)" )
+            or diag $output;
+    }
 }
 
 check( $_, shebang => -1, exec => -1, warnings => 1, strict => 1, bps_tag => 1 )
@@ -87,6 +94,9 @@ check( $_, shebang => -1, exec => -1, warnings => 1, strict => 1, bps_tag => -1
 check( $_, shebang => 1, exec => 1, warnings => 1, strict => 1, bps_tag => 1 )
     for grep {m{^s?bin/}} @files;
 
+check( $_, compile_perl => 1 )
+    for grep { -f $_ } map { s/\.in$//; $_ } grep {m{^s?bin/}} @files;
+
 check( $_, shebang => 1, exec => 1, warnings => 1, strict => 1, bps_tag => 1 )
     for grep {m{^devel/tools/} and not m{/(localhost\.(crt|key)|mime\.types)$}} @files;
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list