[Module-build-general] [PATCH] - really fix add_to_cleanup
Status: Beta
Brought to you by:
kwilliams
|
From: Dave R. <au...@ur...> - 2003-04-24 14:31:19
|
Ken, you changed my patch in a way that broke it. Unfortunately, my test case wasn't very good, so it didn't catch it. Here's another patch that fixes this problem again and adds a test case that actually tests it ;) /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ ? t/XSTest/blib ? t/XSTest/lib/XSTest.bs ? t/XSTest/lib/XSTest.c Index: lib/Module/Build/Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.95 diff -u -r1.95 Base.pm --- lib/Module/Build/Base.pm 21 Apr 2003 20:54:40 -0000 1.95 +++ lib/Module/Build/Base.pm 24 Apr 2003 14:28:38 -0000 @@ -309,6 +309,7 @@ # just save in memory. @{$self->{add_to_cleanup}}{ @new_files } = (); + return; } @{$self->{cleanup}}{ @new_files } = (); Index: t/runthrough.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/runthrough.t,v retrieving revision 1.15 diff -u -r1.15 runthrough.t --- t/runthrough.t 21 Apr 2003 19:44:04 -0000 1.15 +++ t/runthrough.t 24 Apr 2003 14:28:38 -0000 @@ -3,6 +3,7 @@ use Module::Build; use File::Spec; use File::Path; +use IO::File; my $HAVE_YAML = eval {require YAML; 1}; my $HAVE_SIGNATURE = eval {require Module::Signature; 1}; @@ -28,9 +29,19 @@ eval {$build->create_build_script}; ok $@, ''; -ok grep $_ eq 'before_script', keys %{$build->{cleanup}}; - +# Do this here to force it to write cleanup file $build->add_to_cleanup('save_out'); + +my $cleanup = $build->config_file('cleanup'); +my $fh = IO::File->new("<$cleanup") + or die "Cannot read $cleanup: $!"; +my $found = 0; +while (<$fh>) { + chomp; + $found = 1 if $_ eq 'before_script'; +} +ok $found; + my $output = eval { stdout_of( sub { $build->dispatch('test', verbose => 1) } ) }; |