(perl--Test ;; Test.pm ok() message when comparing got/want values (printed in ;; its _complain()), ;; ;; # Test 2 got: "xx" (t-compilation-perl-2.t at line 10) ;; ;; And under Test::Harness can be preceded by progress stuff so ;; allow match anywhere in the line. ;; ;; ... NOK 1# Test 1 got: "1234" (t/foo.t at line 46) ;; "# Test [0-9]+ got:.* (\\([^ \t\r\n]+\\) at line \\([0-9]+\\))" 1 2) (perl--Test-failed ;; Test.pm and Test::Builder fail messages. ;; Test.pm ok() function on a plain boolean test gives, ;; ;; # Failed test 1 in foo.t at line 6 ;; ;; And Test::Builder (eg. module version 0.94, and as used for ;; instance by Test::More) gives similar in its ok(). The # is ;; added by Test::Builder diag(). Eg. with no test name, ;; ;; # Failed test in foo.t at line 5. ;; ;; Or with a test name, ;; ;; # Failed test 'my name' ;; # in foo.t at line 5. ;; ;; Or with a multi-line name, ;; ;; # Failed test 'my name ;; # blah ;; # ' ;; # in foo.t at line 5. ;; ;; Both Test and Test::Harness can be preceded by a progress part ;; from Test::Harness, so match anywhere in the line, eg. ;; ;; ../devel/d-compilation-perl.t .. 1/1 # Failed test 1 in ../devel/d-compilation-perl.t at line 27 ;; ;; A Test::Builder message "# Failed (TODO) test" is deliberately ;; not matched, since a test flagged as TODO isn't an error. If ;; you want to match that you can slip a "\\( (TODO)\\)?" into the ;; pattern (perhaps classing it as a warning). ;; "# +Failed test.*?\\(\n#.*?\\)*? +in \\([^ \t\r\n]+\\) at line \\([0-9]+\\)" 2 3)