Commit Graph

5 Commits

Author SHA1 Message Date
Jun Wu
5b816fdf81 testing: MultiLineMatcher to handle line matching features
Summary:
Previously, D34725120 (ab08faf821) and D34790206 (25bcb70342) implement some features on line matching.
However, other special patterns like `(?)` and `(feature !)` are also common
in tests, which are hard to support on top of D34725120 (ab08faf821) and D34790206 (25bcb70342)'s work.

This diff adds MultiLineMatcher and ExpectLine which implements the `(?)` and
`(feature !)` and other features in D34725120 (ab08faf821) and D34790206 (25bcb70342) all together.

With this change, now passing tests increase from ~180 to ~210.

Differential Revision: D34835695

fbshipit-source-id: 446e75dbaef4cbdb2093dac5134379d0dfd5c402
2022-05-02 13:16:48 -07:00
Jun Wu
25bcb70342 testing: make autofix preserve glob lines
Summary:
One of the problem of autofix is it rewrites "(glob)" lines with non-glob
version. Let's try to make it smarter to preserve the "(glob)" lines.

Reviewed By: DurhamG

Differential Revision: D34790206

fbshipit-source-id: 0bb14f8569a55393165c8fe579f09d43aa98f0bc
2022-04-22 19:18:56 -07:00
Jun Wu
ad8f9bb3cd debugruntest: support stdlib doctest
Summary:
Python stdlib doctest is conceptually similar to what debugruntest
does - run code, check output. By adopting it in debugruntest,
we get the handy autofix feature for free, which is very handy
for files like `testing/t/transform.py`.

The Python doctest requires a Python module as the "starting point".
`doctest:<module name>` is added as a special syntax to indicate
this is a doctest.

A special case is added for edenscm/ source code. Python files will
automatically turn into doctest for convenience.

Reviewed By: DurhamG

Differential Revision: D34725126

fbshipit-source-id: 91b78505708ad930f7688cc3e51e53a94d9030e9
2022-04-22 19:18:56 -07:00
Durham Goode
ba94504297 tests: disable test-debugruntest.t
Summary:
conch_parser fails to build on some platforms. I ripped out the
dependency but didn't notice it was used in this test. Let's disable the test.

Reviewed By: sggutier

Differential Revision: D35824280

fbshipit-source-id: fd25b2adee065d67b2e686f69d1d92811ff5e7e2
2022-04-21 13:07:02 -07:00
Jun Wu
a6e31de629 debugruntest: initial alternative .t runner
Summary:
An alternative to run-tests.py. Does not shell out to anything
and supports Python code.

Reviewed By: DurhamG

Differential Revision: D34725135

fbshipit-source-id: 686b5996bb6016a8ebad04f804171a9a2fccd6aa
2022-04-20 12:57:30 -07:00