I'm using Test::More to test my application. I have a single script, run_tests.pl, that runs all the tests. Now I want to split this into run_tests_component_A.pl and B, and run both test suites from run_tests.pl. What is the proper way of doing this, does Test::More have any helpful methods?
I'm not using any build system.
Instead of running the creating a
run_tests.plto run the test suite, the standard practice is to useprove.Say you have
Then,
proveis short forprove t.prove truns the entire test suite (botht/foo.tandt/bar.t).prove t/foo.truns that specific test file.perl t/foo.truns that specific test file, and you get the raw output. Easier for debugging.perl -d t/foo.teven allows you to run the test in the debugger.Each file is a self-standing program. If you need to share code between test programs, you can create
t/lib/Test/Utils.pm(or whatever) and use the following in your test files:proveexecutes the files in alphabetical order, so it's common to name the filesThe
00test tests if the modules can be loaded and that's it. It usually outputs the versions of loaded modules to help with dependency problems. Then you have your more basic tests. The stuff that's like "if this doesn't work, you have major problems". There's no point in testing the more complex features if the basics don't work.