Recently I was required to create another flavor of test harness that runs tests, then captures and stores output.

The nature of my testing means that I am running millions of tests, and the resultant captured output is therefore huge. So I modified my tests to do the *equivalent* of the following:

        use Test::More tests => 10_000_000, sparse => 1;

        for my $i (1 .. 10_000_000)
        {
           fail ('problem...')
             unless complex_numerical_test ($i);
        }

The 'sparse => 1' causes this output to be written:

        1..10000000 sparse

This is a message to my custom harness that means it should not expect 10_000_000 "ok ..." lines, but just the "not ok ..." lines. Ordinarily of course, this would be interpreted as a test script failure to complete, but in this case it just shifts some assumptions around, such that for the duration of this test script only, there will be no "ok ..." lines, in the interest of capturing only the interesting output, and saving me considerable disk space.

I think this could make a useful enhancement to the Test::* modules.

Reply via email to