Skip Menu |

This queue is for tickets about the Test-Class CPAN distribution.

Report information
The Basics
Id: 11512
Status: resolved
Priority: 0/
Queue: Test-Class

Owner: Nobody in particular
Requestors: emil.jansson [...]

Bug Information
Severity: Normal
Broken in: 0.10
Fixed in: (no value)

Subject: Test::Class can't handle exceptions in startup method
Download (untitled) / with headers
text/plain 1.2k
This code raises an exception in the startup metod: ---------< Start >--------- #!/usr/bin/env perl package Test; use strict; use warnings; use base qw(Test::Class); use Test::More; sub startup : Test(startup) { die; } sub test : Tests { ok(1, 'test that should be skipped because of the exception in startup'); } Test::Class->runtests; 1; ---------< End >--------- It produces this output: ---------< Start output >--------- Use of uninitialized value in string ne at /usr/lib/perl5/site_perl/5.8.3/Test/ line 192. Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.8.3/Test/ line 192. not ok 1 - startup (for test method '') died (Died at ./ line 9.) # Failed test (./ at line 16) ok 2 - test that should be skipped because of the exception in startup 1..2 # Looks like you failed 1 test of 2. ---------< End output >--------- Test:Class can't handle the exception as seen above (the uninitialized values). I also think that all the tests in the module should be skipped (or failed) if the startup methods raises an exception. The reason for raising an exception in the startup method could be a failure in setting up the testing environment, and then no tests can be run at all.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to