Return-Path: Delivered-To: apmail-httpd-test-dev-archive@httpd.apache.org Received: (qmail 55725 invoked by uid 500); 18 Oct 2001 05:31:50 -0000 Mailing-List: contact test-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: test-dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list test-dev@httpd.apache.org Received: (qmail 55695 invoked from network); 18 Oct 2001 05:31:49 -0000 Message-ID: <3BCE6949.6090907@stason.org> Date: Thu, 18 Oct 2001 13:31:53 +0800 From: Stas Bekman Organization: Hope, Humanized User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20010914 X-Accept-Language: en-us MIME-Version: 1.0 To: test-dev@httpd.apache.org Subject: [patch] Re: Apache-Test breakage References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Doug MacEachern wrote: >>I think the break in the middle of config is important to fix, right? > > yes. the problem right now is if die() is thrown, files have been > generated but the Apache::TestConfig object is not committed to > t/conf/apache_test_config.pm. so t/TEST -clean does not know about those > generated files. either a DESTROY or __DIE__ handler could probably be > used to solve the problem. __DIE__ is a mess to use and DESTROY cannot be easily used unless Apache::TestConfig is subclassed. I think the following is quite clean solution. I've tested it with breaking the configure by requiring all .pm files (if you remember the breakage I had while developing APACHE_TEST_CONFIGURE functionality) So it works when you run ./t/TEST, but when you run 'make test', for some reason Makefile doesn't abort on exit from test_clean target, no matter if I put exit -1, 0 or 1, and proceeds with run_tests target. Does that have anything to do with the installed __DIE__ sighandler? I suggest to review the code and get rid of the __DIE__ sighandler all together and instead wrap the relevant pieces of code in eval block. Are there any exception handling modules bundled in the core? In any case I think this patch can be committed without relation to the __DIE__ issue. -- Index: Apache-Test/lib/Apache/TestRun.pm =================================================================== RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm,v retrieving revision 1.59 diff -u -r1.59 TestRun.pm --- Apache-Test/lib/Apache/TestRun.pm 2001/10/17 02:56:24 1.59 +++ Apache-Test/lib/Apache/TestRun.pm 2001/10/18 05:14:11 @@ -483,7 +483,16 @@ $self->opt_clean(1); } - $self->configure; + # if configure() fails for some reason before it has flushed the + # config to a file, save it so -clean will be able to clean + eval { $self->configure; }; + if ($@) { + error "configure() has failed:\n$@"; + warning "forcing Apache::TestConfig object save"; + $self->{test_config}->save; + warning "run 't/TEST -clean' to clean up before continuing"; + exit; + } if ($self->{opts}->{configure}) { warning "reconfiguration done"; _____________________________________________________________________ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:stas@stason.org http://ticketmaster.com http://apacheweek.com http://singlesheaven.com http://perl.apache.org http://perlmonth.com/