When you write a Perl application with Mojolicious framework, you put tests into the t
directory. Then it is very easy to run them because Mojolicious supports tests “out of the box” with test
command that should run all tests one by one:
$ ./app-name.pl test [Fri Sep 9 13:21:06 2016] [debug] Some message Running tests from "/path/to/t". /path/to/t/1868-prev-next.t .. ok /path/to/t/1869-design.t ..... ok ... All tests successful. Files=8, Tests=171, 5 wallclock secs ( 0.08 usr 0.01 sys + 3.76 cusr 0.28 csys = 4.13 CPU) Result: PASS
Also, for that you could create a Makefile:
SCRIPT=app-name.pl
APP=perl $(SCRIPT)
test: $(SCRIPT)
$(APP) test
And all works just fine: tests spawned with a familiar make test
command.
I installed a trial copy of the latest ActiveState’s Komodo IDE and took it for a spin. That included testing as well. I found that Komodo tries to find a Makefile and runs the tests. Unfortunately, Komodo was not able to display the test results as it just spew an error messages **** Unrecognized input
There is another way to execute tests: the prove
command. It produced a similar output:
$ prove -l t/1868-prev-next.t .. ok t/1869-design.t ..... ok ... All tests successful. Files=8, Tests=171, 5 wallclock secs ( 0.07 usr 0.00 sys + 3.86 cusr 0.23 csys = 4.16 CPU) Result: PASS
But there were some differences: debug messages were hidden and paths to files were relative instead of absolutes. It was enough for a clean outcome: