Skip to content

Commit

Permalink
testc 208: improve testcase and add proper TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
Reini Urban committed Dec 24, 2013
1 parent d30ff6e commit 9b35d28
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Changes
Expand Up @@ -4,7 +4,7 @@
and worked quite fine with Perl 5.6 and 5.8

1.43 2013-?? rurban
partial 5.16, 5.18, 5.20 and windows support, some more fixes
new 5.16, 5.18, 5.20 and partial windows support, many more fixes and testcases

* C: Fix -u<module> without file extension.
With hek do not drop FAKE, only for const pv.
Expand Down
15 changes: 7 additions & 8 deletions t/issue208.t
Expand Up @@ -7,15 +7,14 @@ BEGIN {
require "test.pl";
}
use Test::More tests => 2;
my $expected = $] >= 5.014 ? 'RUN MyKooh DESTRUCT OurKooh' : ' MyKooh OurKooh';

# fixed with 1.42_66, 5.18
ctest(1, $expected,'C','ccode208i',<<'EOF','#208 missing DESTROY call at DESTRUCT time');
my $script = <<'EOF';
sub MyKooh::DESTROY { print "${^GLOBAL_PHASE} MyKooh " } my $k=bless {}, MyKooh;
sub OurKooh::DESTROY { print "${^GLOBAL_PHASE} OurKooh" } our $k=bless {}, OurKooh;
EOF
my $expected = ($] >= 5.014 ? 'RUN MyKooh DESTRUCT OurKooh' : ' MyKooh OurKooh');

ctest(2, $expected,'C,-O3','ccode208i',<<'EOF','TODO #208 -ffast-destruct');
sub MyKooh::DESTROY { print "${^GLOBAL_PHASE} MyKooh " } my $k=bless {}, MyKooh;
sub OurKooh::DESTROY { print "${^GLOBAL_PHASE} OurKooh" } our $k=bless {}, OurKooh;
EOF
# fixed with 1.42_66, 5.16+5.18
use B::C ();
my $todo = ($] > 5.015 and $B::C::VERSION gt '1.42_65') ? "" : "TODO ";
ctest(1, $expected,'C','ccode208i',$script,$todo.'#208 missing DESTROY call at DESTRUCT time');
ctest(2, $expected,'C,-O3','ccode208i',$script,'TODO #208 -ffast-destruct');
2 changes: 1 addition & 1 deletion t/testc.sh
Expand Up @@ -894,7 +894,7 @@ ok 2'
tests[208]='#TODO 197
sub MyKooh::DESTROY { print "${^GLOBAL_PHASE} MyKooh " } my $k=bless {}, MyKooh;
sub OurKooh::DESTROY { print "${^GLOBAL_PHASE} OurKooh" }our $k=bless {}, OurKooh;'
if [[ $v513 -gt 0 ]]; then
if [[ `$PERL -e'print (($] < 5.014)?0:1)'` -gt 0 ]]; then
result[208]='RUN MyKooh DESTRUCT OurKooh'
else
result[208]=' MyKooh OurKooh'
Expand Down

0 comments on commit 9b35d28

Please sign in to comment.