test: check for empty tests immediately, not later when we're running

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1062>
This commit is contained in:
Peter Hutterer 2024-10-16 11:12:42 +10:00
parent 6d26d83f00
commit 75ce537342

View file

@ -1313,12 +1313,6 @@ litest_run(struct list *tests)
list_init(&created_files_list);
if (list_empty(tests)) {
fprintf(stderr,
"Error: filters are too strict, no tests to run.\n");
return 1;
}
if (getenv("LITEST_VERBOSE"))
verbose = true;
@ -5038,6 +5032,12 @@ main(int argc, char **argv)
litest_init_test_devices(&devices);
setup_tests();
if (list_empty(&all_tests)) {
fprintf(stderr,
"Error: filters are too strict, no tests to run.\n");
return EXIT_FAILURE;
}
if (mode == LITEST_MODE_LIST) {
litest_list_tests(&all_tests);
return EXIT_SUCCESS;