[Rt-commit] rt branch, 4.2/skip-mysql-specific-files-compile-check, created. rt-4.2.10-220-gc77d5a4

? sunnavy sunnavy at bestpractical.com
Sat Mar 28 03:35:54 EDT 2015


The branch, 4.2/skip-mysql-specific-files-compile-check has been created
        at  c77d5a4adc5b670e1aa35ab401a78403e48ea036 (commit)

- Log -----------------------------------------------------------------
commit c77d5a4adc5b670e1aa35ab401a78403e48ea036
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Mar 21 22:27:59 2015 +0800

    skip compile check of mysql specific files if DBD::mysql is unavailable
    
    it's unnecessary and tests could fail because of the lack of DBD::mysql.
    (e.g. etc/upgrade/upgrade-mysql-schema.pl)

diff --git a/t/99-policy.t b/t/99-policy.t
index f0cf5d0..6bfff32 100644
--- a/t/99-policy.t
+++ b/t/99-policy.t
@@ -94,11 +94,16 @@ sub check {
 
     if ($check{compile_perl}) {
         my ($input, $output, $error) = ('', '', '');
-        run3(
-            [$^X, '-Ilib', '-Mstrict', '-Mwarnings', '-c', $file],
-            \$input, \$output, \$error,
-        );
-        is $error, "$file syntax OK\n", "$file syntax is OK";
+        my $pre_check = 1;
+        if ( $file =~ /\bmysql\b/ ) {
+            eval { require DBD::mysql };
+            undef $pre_check if $@;
+        }
+
+        if ( $pre_check ) {
+            run3( [ $^X, '-Ilib', '-Mstrict', '-Mwarnings', '-c', $file ], \$input, \$output, \$error, );
+            is $error, "$file syntax OK\n", "$file syntax is OK";
+        }
     }
 }
 

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


More information about the rt-commit mailing list