I have a fun problem with Apache-Test and the EU::MM test=>TESTS option. Long story longer.

I recently added t/*.t tests to test my Catalyst helper modules. These tests call the helpers modules, which in turn cause Catalyst to create files (modules, tests, templates) in t/TestApp. Some of these autogenerated files are actually other test files that would be run in the Catalyst app itself..files like t/TestApp/t/01app.t.

When I run make test for the first time, everything runs just fine. When I run make test for the second time, it's trying to run t/TestApp/t/01app.t and other files in the bogus t directory.

server localhost:8529 started
t\TestApp\t\01app......................
#     Failed test (t\TestApp\t\01app.t at line 2)
#     Tried to use 'Catalyst::Test'.
#     Error:  Couldn't load "TestApp", "Can't locate TestApp.pm in @INC (@INC 
contains: C:\Development\CPAN\Handel\blib\lib C:\Development\C
PAN\Handel\blib\arch C:\Development\CPAN\Handel lib blib\arch blib\lib 
C:/Development/Perl/584/lib C:/Development/Perl/584/site/lib . C:/Dev
elopment/Perl/584/lib C:/Development/Perl/584/site/lib .) at 
C:/Development/Perl/584/site/lib/Catalyst/Test.pm line 81.
# " at (eval 3) line 2


Now, at first I thought this was really bogus. Last time I checked, EU::MM only runs test in t/*.t, and no tests in subdirectories. So, just for giggles, I added this to my Makefile.PL:

test  => { TESTS => join ' ', (glob("t/*.t"))}

To my surprise, this didn't fix my problem. So, in Makefile.PL, I did:

warn join "\n", (glob("t/*.t"));

This gave me:

t/basic.t
t/cart_add.t
t/cart_clear.t
t/cart_delete.t
t/cart_item_new.t
t/cart_items.t
t/cart_iterator.t
t/cart_load.t
t/cart_new.t
t/cart_restore.t
t/cart_restore_append.t
t/cart_restore_append_filter.t
t/cart_restore_merge.t
t/cart_restore_merge_filter.t
t/cart_restore_replace.t
t/cart_restore_replace_filter.t
t/cart_save.t
t/catalyst_helpers_controller_cart.t
t/catalyst_helpers_controller_order.t
t/catalyst_helpers_model_cart.t
t/catalyst_helpers_model_order.t
t/checkout_cart.t
t/checkout_messages.t
t/checkout_order.t
t/checkout_phases.t
t/checkout_plugins.t
t/checkout_process.t
t/config.t
t/constants.t
t/constraints_cart_type.t
t/constraints_checkout_phase.t
t/constraints_currency_code.t
t/constraints_order_type.t
t/constraints_price.t
t/constraints_quantity.t
t/constraints_uuid.t
t/currency.t
t/dbi.t
t/exceptions.t
t/l10n.t
t/order_add.t
t/order_clear.t
t/order_delete.t
t/order_item_new.t
t/order_items.t
t/order_load.t
t/order_new.t
t/pod_coverage.t
t/pod_syntax.t
t/strict.t
t/tt2_cart.t
t/tt2_checkout.t
t/tt2_order.t
t/warnings.t
t/xsp_cart.t
t/xsp_checkout.t
t/xsp_order.t at Makefile.PL line 93.

So, I know the glob does what it should. I ran make test again, and it still is running the bogus tests in the subdirectories.

Then, I disabled Apache-Test in Makefile.PL and started over.
Now, I can run make test as many times as I want, and it never tries to run the tests in the subdirectories.

Just for giggles, I ran Makefile.PL twice, once with A-T enables, once with A-T disabled. In both cases, I left test=>TESTS glob line in Makefile.PL; and the t/TestApp/t direcotiry and files still exists.

Here's the noticable difference between the two: < is without A-T, > is with A-T:

< TEST_VERBOSE=0
< TEST_TYPE=test_$(LINKTYPE)
< TEST_FILE = test.pl
< TEST_FILES = t/basic.t t/cart_add.t t/cart_clear.t t/cart_delete.t 
t/cart_item_new.t t/cart_items.t t/cart_iterator.t t/cart_load.t t/cart_new.t 
t/cart_restore.t t/cart_restore_append.t t/cart_restore_append_filter.t 
t/cart_restore_merge.t t/cart_restore_merge_filter.t t/cart_restore_replace.t 
t/cart_restore_replace_filter.t t/cart_save.t t/catalyst_helpers_controller_cart.t 
t/catalyst_helpers_controller_order.t t/catalyst_helpers_model_cart.t 
t/catalyst_helpers_model_order.t t/checkout_cart.t t/checkout_messages.t 
t/checkout_order.t t/checkout_phases.t t/checkout_plugins.t t/checkout_process.t 
t/config.t t/constants.t t/constraints_cart_type.t t/constraints_checkout_phase.t 
t/constraints_currency_code.t t/constraints_order_type.t t/constraints_price.t 
t/constraints_quantity.t t/constraints_uuid.t t/currency.t t/dbi.t t/exceptions.t 
t/l10n.t t/order_add.t t/order_clear.t t/order_delete.t t/order_item_new.t 
t/order_items.t t/order_load.t t/order_new.t t/pod_coverage.t t/p
od_syntax.t t/strict.t t/tt2_cart.t t/tt2_checkout.t t/tt2_order.t t/warnings.t 
t/xsp_cart.t t/xsp_checkout.t t/xsp_order.t
< TESTDB_SW = -d

TEST_VERBOSE = 0
TEST_FILES =



A quick gander into Apache::TestMM::test() yields this:

TEST_VERBOSE = 0
TEST_FILES =

test_clean :
        $(FULLPERL) -I$(INST_ARCHLIB) -I$(INST_LIB) \
        t/TEST $(APACHE_TEST_EXTRA_ARGS) -clean

run_tests :
        $(PASSENV) \
        $(FULLPERL) -I$(INST_ARCHLIB) -I$(INST_LIB) \
        t/TEST $(APACHE_TEST_EXTRA_ARGS) -bugreport -verbose=$(TEST_VERBOSE) 
$(TEST_FILES)


Hey, there's the empty TEST_FILES in TestMM::test. :-/
So, is this a bug, a feature, and oversite? t/TEST recurses directories in t which isn't as bad as the fact that it's ignoreing the option in Makefile.PL entirely.

In the mean time, I'm not quite sure how to overcome this second make-test run problem. Trying to rmtree or ulink TestApp from t withint the tests that creates them just gives me a boatload of access denied errors. Adding a test that runs last that deletes t/TestApp works, but that breaks t/SMOKE since we'd no depend on that test running before the tests that create t/TestApp.

Thughts?
-=CHris





Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to