perl-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <ge...@modperlcookbook.org>
Subject Re: [patch] add method for writing temporary test libraries
Date Thu, 15 Nov 2007 22:54:07 GMT


Philippe M. Chiasson wrote:
> Fred Moyer wrote:
>> Please find attached a patch which adds t_write_test_lib, a method use 
>> to create temporary perl packages used in testing.  The patch adds a 
>> temp dir to @INC in modperl_inc.pl.
>>
>> - Fred
>>
>> [...]
>> Index: lib/Apache/TestUtil.pm
>> ===================================================================
>> [...]
>> @@ -191,6 +191,14 @@
>>       return $fh;
>>   }
>>
>> +sub _temp_package_dir {
>> +    return catdir(tmpdir(), 'apache_test');
>> +}
> 
> How do you make sure that tmp directory gets cleaned up at the end of the
> test run ?

he's using t_write_file() under the hood, which keeps track of
directories it creates and cleans them up afterward.

--Geoff

Mime
View raw message