Subject: | Should be a way to bypass $Check_block_has_run check |
Test::Class now dies if you load it at runtime:
die "Test::Class was loaded too late (after the CHECK block was
run). See 'A NOTE
ON LOADING TEST CLASSES' in perldoc Test::Class for more details\n"
unless $Check_block_has_run;
However, it is perfectly possible to use Test::Class after loading it at
runtime, via add_testinfo(). In fact the documentation mentions this:
If you still can't arrange for your classes to be loaded at runtime,
you could use an alternative mechanism for adding your tests...
though I think you meant to say "compile time" rather than "runtime" there.
I am loading Test::Class at runtime and registering tests with
add_testinfo() so that I can use it in conjunction with forkprove.
I understand the intention of the error message and it is usually valid,
but there should be a way to bypass it, e.g. with an import flag
use Test::Class qw(--runtime);