mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-04 00:00:28 +01:00
test: make the test case failure output easier to select
Split the suite and test case name up so it's easier to select with a double-click in the terminal. Because usually those tests need to be re-run individually and making that easier is a good thing. Previously: :: Failure: ../test/test-tablet.c:4434:touch_arbitration:wacom-cintiq-13hdt-pen-tablet Now: :: Failure: ../test/test-tablet.c:4434: touch_arbitration(wacom-cintiq-13hdt-pen-tablet) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
d5bdf7f232
commit
1e73cccfd9
1 changed files with 13 additions and 2 deletions
|
|
@ -850,11 +850,22 @@ litest_run_suite(struct list *tests, int which, int max, int error_fd)
|
|||
|
||||
trs = srunner_failures(sr);
|
||||
for (int i = 0; i < failed; i++) {
|
||||
char tname[256];
|
||||
char *c = tname;
|
||||
|
||||
/* tr_tcname is in the form "suite:testcase", let's
|
||||
* convert this to "suite(testcase)" to make
|
||||
* double-click selection in the terminal a bit
|
||||
* easier. */
|
||||
snprintf(tname, sizeof(tname), "%s)", tr_tcname(trs[i]));
|
||||
if ((c = index(c, ':')))
|
||||
*c = '(';
|
||||
|
||||
dprintf(error_fd,
|
||||
":: Failure: %s:%d:%s\n",
|
||||
":: Failure: %s:%d: %s\n",
|
||||
tr_lfile(trs[i]),
|
||||
tr_lno(trs[i]),
|
||||
tr_tcname(trs[i]));
|
||||
tname);
|
||||
}
|
||||
free(trs);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue