8 Commits

Author SHA1 Message Date
Patrick McCarty 546b947ba6 Refactor pytest test summary parsing; update tests
Instead of using separate regular expressions to capture the multiple
forms pytest test summaries might take, use one generic regular
expression to match the summary line, and then process comma-separated
components of the line with more specific matches.

Three test cases needed to be updated to accommodate this refactor:

- Two tests omitted the leading '=' characters from the line to match,
  even though their summary lines clearly originated from pytest. Fix by
  adding some leading '=' characters for those summary lines.

- One test mistakenly counted an "xpass" as an "xfail". Autospec maps
  "xpass" results to "pass", so update the test accordingly.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2022-05-04 16:41:39 -07:00
Patrick McCarty 2db09c3c5a test: add tests for matching of the new format
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2022-02-28 12:49:36 -08:00
Patrick McCarty 756d1871a8 Improve meson test results reporting
Support the output of `meson test` in addition to `ninja test`, since
the meson docs recommend running `meson test`.

Also add a new unit test to cover some of the test result summary line
differences.

Fixes #323

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-01-30 19:02:23 -08:00
Patrick McCarty e5bf1b99b7 tests: fix up mocks for open_auto() use
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-06-24 13:08:39 -07:00
Caio Marcelo de Oliveira Filho 590c85bba3 count: support counting test results from meson
This patch takes a different approach, since it was likely that
changing the way we count the existing individual patterns could break
other logs.

So when it identifies this is a meson test, it forks off to just parse
the meson patterns.

It doesn't support the "CLR-XTEST:" prefix to group multiple tests,
mostly because I couldn't find examples of it to test.
2018-07-25 18:47:10 -07:00
Matthew Johnson 07622d5770 Increase count.py test coverage
Also remove some never-hit regular expressions from count.py

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-11-16 13:11:07 -08:00
Matthew Johnson 2552c9786f Move test generators out of name guard
This allows python3 unittest to properly generate the tests when running
all the tests in the tests directory.

Also adds a fix to test_test.py to reset buildpattern.default_pattern
every test. This was a bug introduced by running all tests at once -
this was not being cleared correctly.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-09-26 15:30:34 -07:00
Matthew Johnson 9f023f87eb Add unit tests for count.py
Add unit tests for the very large count.py module/script. These unit
tests attempt to test every regular expression present in the parse_log
function and helped catch several bugs in the original regexes ported
from perl.
2017-07-11 14:16:55 -07:00