Advanced-Config
view release on metacpan or search on metacpan
full_developer_test.pl.src view on Meta::CPAN
#!/usr/bin/perl
# ------------------------------------------------------------------------
# This program is only for use by the developer of this module.
# ------------------------------------------------------------------------
# Running "make test" should be good enough for everyone else!
# ------------------------------------------------------------------------
# Only modify file: full_developer_test.pl.src
# not: full_developer_test.pl
# Run "make" to generate the PL file!
# make does: perl full_developer_test.pl.src full_developer_test.pl
# ------------------------------------------------------------------------
# Running: full_developer_test.pl
# ------------------------------------------------------------------------
# It runs "make test" 2 times with changes to $ENV{FISH_OFF_FLAG}
# 1) FISH_OFF_FLAG = 1 Run tests using Fred::Fish::DBUG qw /OFF/
# 2) FISH_OFF_FLAG = 0 Run tests using Fred::Fish::DBUG qw /ON/
#
# If a "make test" fails, it won't run the next in the series!
#
# There will be fish logs generated in each case. The only difference
# is when FISH_OFF_FLAG is set, Advanced::Config itself won't use fish.
# Only the test programs themselves will use it. Which is how this
# module is expected to be run by normal users.
# It just proves that using Fred::Fish::DBUG "on" vs "off" doesn't change
# the behaviour of my module.
# ------------------------------------------------------------------------
# Running: full_developer_test.pl t/<name>.t
# ------------------------------------------------------------------------
# Forces a "make" first.
# Runs just that one test program 2 times instead of the full "make test".
# Does this via "prove -bv t/<name>.t"
# Before each run it will reset FISH_OFF_FLAG. It's just a quick and
# dirty way to fully debug individual test progs.
# ------------------------------------------------------------------------
use strict;
use warnings;
use ExtUtils::MakeMaker 6.30;
use File::Spec;
use Cwd 'abs_path';
use File::Basename;
use File::Copy;
use File::Glob qw (bsd_glob);
# The number of fish log files to locate for each 'make test' run!
use constant MAX => 28;
my $fish_dir_summary;
my $fish_dir_details;
BEGIN {
eval {
require Time::HiRes;
Time::HiRes->import ( qw(time sleep) );
};
}
# Main Program ...
{
$fish_dir_summary = File::Spec->catdir ("t", "log_summary");
$fish_dir_details = File::Spec->catdir ("t", "log_details");
unless ( -d "t" ) {
die ("No such sub-dir './t'. Must run from the build dir!\n");
}
unless ( -d $fish_dir_summary ) {
die ("No such sub-dir '${fish_dir_summary}'. Must run from the build dir!\n");
}
unless ( -d $fish_dir_details ) {
die ("No such sub-dir '${fish_dir_details}'. Must run from the build dir!\n");
}
# Delete %ENV entry so t/99-failure.t will pass all it's tests!
delete $ENV{FAIL_TEST_99};
# Create %ENV entry so t/75-check_all_languages.t will fully write to fish.
# Also used by t/76-check_all_languages2.t
$ENV{FULL_75_TEST} = 1;
my $fail_test_msg = "";
my $one_test_prog;
my $one_fish_base;
# --------------------------------------------------------------------------
# This implements
# PL_FILES => { 'full_developer_test.pl.src' => 'full_developer_test.pl' }
# from Makefile.PL ...
# --------------------------------------------------------------------------
# This is only true during "make".
# --------------------------------------------------------------------------
( run in 1.016 second using v1.01-cache-2.11-cpan-0bd6704ced7 )