diff options
author | Nicholas Clark <nick@ccl4.org> | 2001-06-11 00:25:41 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-10 22:37:16 +0000 |
commit | 3414cef00cbe871b34a427fbbdf64738315ff89e (patch) | |
tree | 49950745b6f09280eb4baf3c9ea268428c297857 /t | |
parent | 1f8ffedc64f6819cf01d88581883f802b8dca4ce (diff) | |
download | perl-3414cef00cbe871b34a427fbbdf64738315ff89e.tar.gz |
ExtUtils::Constant
Message-ID: <20010610232540.C76396@plum.flirble.org>
p4raw-id: //depot/perl@10507
Diffstat (limited to 't')
-rw-r--r-- | t/lib/extutils.t | 69 |
1 files changed, 52 insertions, 17 deletions
diff --git a/t/lib/extutils.t b/t/lib/extutils.t index 9d54dad05c..48c2aa30e4 100644 --- a/t/lib/extutils.t +++ b/t/lib/extutils.t @@ -1,6 +1,6 @@ #!./perl -w -print "1..18\n"; +print "1..21\n"; BEGIN { chdir 't' if -d 't'; @@ -47,9 +47,15 @@ my @names = ("FIVE", {name=>"OK6", type=>"PV",}, value=>['"not ok 7\\n\\0ok 7\\n"', 15]}, {name => "FARTHING", type=>"NV"}, {name => "NOT_ZERO", type=>"UV", value=>"~(UV)0"}, + {name => "OPEN", type=>"PV", value=>'"/*"', + macro=>["#if 1\n", "#endif\n"]}, {name => "CLOSE", type=>"PV", value=>'"*/"', macro=>["#if 1\n", "#endif\n"]}, - {name => "ANSWER", default=>["UV", 42]}, "NOTDEF"); + {name => "ANSWER", default=>["UV", 42]}, "NOTDEF", + {name => "Yes", type=>"YES"}, + {name => "No", type=>"NO"}, + {name => "Undef", type=>"UNDEF"} +); my @names_only = map {(ref $_) ? $_->{name} : $_} @names; @@ -69,6 +75,9 @@ print FH <<'EOT'; #define OK7 1 #define FARTHING 0.25 #define NOT_ZERO 1 +#define Yes 0 +#define No 1 +#define Undef 1 #undef NOTDEF EOT close FH or die "close $header: $!\n"; @@ -199,6 +208,30 @@ if (defined $notthere) { print "ok 13\n"; } +# Truth +my $yes = Yes; +if ($yes) { + print "ok 14\n"; +} else { + print "not ok 14 # $yes='\$yes'\n"; +} + +# Falsehood +my $no = No; +if (defined $no and !$no) { + print "ok 15\n"; +} else { + print "not ok 15 # \$no=" . defined ($no) ? "'$no'\n" : "undef\n"; +} + +# Undef +my $undef = Undef; +unless (defined $undef) { + print "ok 16\n"; +} else { + print "not ok 16 # \$undef='$undef'\n"; +} + EOT close FH or die "close $testpl: $!\n"; @@ -276,27 +309,29 @@ if ($Config{usedl}) { } } -my $test = 14; +my $test = 17; my $maketest = "$make test"; print "# make = '$maketest'\n"; $makeout = `$maketest`; -if ($?) { - print "not ok $test # $maketest failed: $?\n"; -} else { - # echo of running the test script - $makeout =~ s/^\s*PERL_DL_NONLAZY=.+?\n//m; - $makeout =~ s/^MCR.+test.pl\n//mig if $^O eq 'VMS'; - # GNU make babblings - $makeout =~ s/^\w*?make.+?(?:entering|leaving) directory.+?\n//mig; +# echo of running the test script +$makeout =~ s/^\s*PERL_DL_NONLAZY=.+?\n//m; +$makeout =~ s/^MCR.+test.pl\n//mig if $^O eq 'VMS'; + +# GNU make babblings +$makeout =~ s/^\w*?make.+?(?:entering|leaving) directory.+?\n//mig; - # Hopefully gets most make's babblings - # make -f Makefile.aperl perl - $makeout =~ s/^\w*?make.+\sperl[^A-Za-z0-9]*\n//mig; - # make[1]: `perl' is up to date. - $makeout =~ s/^\w*?make.+perl.+?is up to date.*?\n//mig; +# Hopefully gets most make's babblings +# make -f Makefile.aperl perl +$makeout =~ s/^\w*?make.+\sperl[^A-Za-z0-9]*\n//mig; +# make[1]: `perl' is up to date. +$makeout =~ s/^\w*?make.+perl.+?is up to date.*?\n//mig; - print $makeout; +print $makeout; + +if ($?) { + print "not ok $test # $maketest failed: $?\n"; +} else { print "ok $test\n"; } $test++; |