Subject: | ps/expected-test-count and Test.pm |
Date: | Sat, 30 Apr 2011 09:54:09 +1000 |
To: | bug-Devel-PerlySense [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
When running a Test.pm test script outside of the test harness there's
no summary for ps/expected-test-count to pick up. It might as the last
thing it tries, look for the last ok or not ok for how many tests were
actually run,
;; in a raw run of a Test.pm (without the test harness) there's
;; no count summary, look for the last "ok" or "not ok"
(goto-char (point-max))
(if (re-search-backward "^\\(not \\)?ok \\([0-9]+\\)$" nil t)
(throw 'count-string (string-to-number (match-string 2))))