Advanced-Config

 view release on metacpan or  search on metacpan

t/76-check_all_languages2.t  view on Meta::CPAN

#!/usr/bin/perl

use strict;
use warnings;

use Test::More;
use File::Basename;
use File::Spec;
use File::Glob qw (bsd_glob);
use Fred::Fish::DBUG 2.09 qw ( on );
use Fred::Fish::DBUG::Test 2.09;

# How to find the helper module ...
BEGIN { push (@INC, File::Spec->catdir (".", "t", "test-helper")); }
use helper1234;

# ---------------------------------------------------------------------
# Automatically creates a config file with all Date::Manip::Lang::*.pm in use.
# It doesn't use the tools Advanced::Config has to give me more
# direct control on how the config file is created.  Also when originally
# created those tools hadn't been created yet.
# ---------------------------------------------------------------------
# After the config file has been created it attempts to use the
# Config object to validate everything works.
# ---------------------------------------------------------------------

my $fish;
my $config_file_normal;
my $config_file_wide;
my @global_modules;
my $run_as_developer = 0;

BEGIN {
   # The config file this program is to create!
   $config_file_normal = File::Spec->catfile (dirname ($0), "config", "76-all_languages_normal-2.cfg");
   $config_file_wide   = File::Spec->catfile (dirname ($0), "config", "76-all_languages_wide-2.cfg");
   unlink ( $config_file_normal, $config_file_wide );

   $fish = turn_fish_on_off_for_advanced_config ();

   unlink ( $fish );

   DBUG_ENTER_FUNC ();

   use_ok ("Advanced::Config");

   DBUG_VOID_RETURN ();

   # Turn fish on ...
   DBUG_PUSH ( $fish, allow_utf8 => 1 );

   $run_as_developer = $ENV{FULL_75_TEST} ? 1 : 0;
}


BEGIN
{
   DBUG_ENTER_FUNC ();

   my $ver;
   eval {
      require Date::Manip;
      Date::Manip->import ();
      $ver = $Date::Manip::VERSION;
      dbug_ok (1, "Loaded version ${ver} of Date::Manip");
   };
   if ($@) {
      dbug_ok (1, "Date::Manip is not installed.  Skipping this test!");
      done_testing ();
      DBUG_LEAVE (0);
   }

   my $index = "";
   eval {
      require Date::Manip::Lang::index;
      Date::Manip::Lang::index->import ();
      $index = "index";     # This must match this module name loaded ...
   };
   if ($@) {
      dbug_ok (1, "Date::Manip::Lang::index is not installed.  This version of Date::Manip (v${ver}) is not supported.  Skipping this test!");



( run in 1.303 second using v1.01-cache-2.11-cpan-39bf76dae61 )