I have a module with a MakeMaker generated Makefile and I want to run my unit tests (make test
) in parallel. Test::Harness accepts e.g., HARNESS_OPTIONS=j4
to use 4 threads. But I don't see how MakeMaker's test target can be adjusted to set this variable.
Now I could just export HARNESS_OPTIONS=j4
in my ~/.bashrc
but it seems odd to force that on every test run that uses Test::Harness. What if I have tests that shouldn't run in parallel in another project?
With make -j4 test
I don't see any improvement. make test
runs
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/*/*.t
so I guess that even if make
would use multiple threads, Test::Harness may not support this, or make
may not pass this information to Test::Harness.
Currently this just to speed up my testing. My module is an internal module and I'm not too worried about forcing this option on any user of the module. However, if I can define this option in e.g., a config file that I don't ship, that would work, too.
Speaking of config files: I can run prove -j4 t/
and run tests in parallel. So an option could be to tell MakeMaker to run tests with prove
, but I don't see a way to configure that either.
How can I tell MakeMaker to run this project's tests in parallel?