App-GhostWork

 view release on metacpan or  search on metacpan

pmake.bat  view on Meta::CPAN

897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
#-----------------------------------------------------------------------------
#                   $tar->add_files("$tardir/$file");
#-----------------------------------------------------------------------------
                    open(FH, $file) || die "Can't open file: $file\n"; #'
                    binmode FH;
                    local $/ = undef; # slurp mode
                    my $data = <FH>;
                    close FH;
 
#-----------------------------------------------------------------------------
# Kwalitee Indicator: buildtool_not_executable core
# The build tool (Build.PL/Makefile.PL) is executable. This is bad because
# you should specify which perl you want to use while installing.
#
# How to fix
# Change the permissions of Build.PL/Makefile.PL to not-executable.
#-----------------------------------------------------------------------------
 
                    my $tar = Archive::Tar->new;
                    if ($file =~ m/ (?: Build\.PL | Makefile\.PL ) \z/oxmsi) {
                        $tar->add_data("$tardir/$file", $data, {'mode' => 0664});

pmake.bat  view on Meta::CPAN

1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
        }
        return $_[0];
    }
}
 
# Test::Harness::runtests cannot work heavy load.
sub _runtests {
    my @script = @_;
    my @fail_testno = ();
    my $ok_script = 0;
    my $not_ok_script = 0;
    my $total_ok = 0;
    my $total_not_ok = 0;
 
    # cygwin warning:
    #   MS-DOS style path detected: C:/cpan/Char-X.XX
    #   Preferred POSIX equivalent is: /cygdrive/c/cpan/Char-X.XX
    #   CYGWIN environment variable option "nodosfilewarning" turns off this warning.
    #   Consult the user's guide for more details about POSIX paths: #'
 
    if (exists $ENV{'CYGWIN'}) {
        if ($ENV{'CYGWIN'} !~ /\b nodosfilewarning \b/x) {
            $ENV{'CYGWIN'} = join(' ', $ENV{'CYGWIN'}, 'nodosfilewarning');
        }
    }
 
    my $scriptno = 0;
    for my $script (@script) {
        next if not -e $script;
 
        my $testno = 1;
        my $ok = 0;
        my $not_ok = 0;
        if (my @result = qx{$^X $script}) {
            if (my($tests) = shift(@result) =~ /^1..([0-9]+)/) {
                for my $result (@result) {
                    if ($result =~ /^ok /) {
                        $ok++;
                    }
                    elsif ($result =~ /^not ok /) {
                        push @{$fail_testno[$scriptno]}, $testno;
                        $not_ok++;
                    }
                    $testno++;
                }
                if ($ok == $tests) {
                    printf("$script ok\n");
                    $ok_script++;
                }
                else {
                    printf("$script Failed %d/%d subtests\n", $not_ok, $ok+$not_ok);
                    $not_ok_script++;
                }
            }
        }
        $total_ok += $ok;
        $total_not_ok += $not_ok;
        $scriptno++;
    }
 
    if (scalar(@script) == $ok_script) {
        printf <<'END', scalar(@script), $total_ok + $total_not_ok;
All tests successful.
Files=%d, Tests=%d
Result: PASS
END
    }
    else {
        print <<'END';
 
Test Summary Report
-------------------
END
        my $scriptno = 0;
        for my $fail_testno (@fail_testno) {
            if (defined $fail_testno) {
                print $script[$scriptno], "\n";
                print '  Failed test:  ', join(', ', @{$fail_testno[$scriptno]}), "\n";
            }
            $scriptno++;
        }
        printf("Files=%d, Tests=%d\n", scalar(@script), $total_ok + $total_not_ok);
        printf("Result: FAIL\n");
        printf("Failed %d/%d test programs. %d/%d subtests failed.\n", $not_ok_script, scalar(@script), $total_not_ok, $total_ok + $total_not_ok);
    }
}
 
sub check_usascii {
    my($file) = @_;
    if (open(FILE,$file)) {
        while (<FILE>) {
            if (not /^[\x0A\x20-\x7E]+$/) {
                die "error not US-ASCII: $file, q(;_;)bad!!";
            }



( run in 0.389 second using v1.01-cache-2.11-cpan-26ccb49234f )