mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-05 00:30:26 +01:00
test: parse arguments before any other stuff
If the args are bad, we don't need to check for root and whatnot. Only exception here is the debugger check because it changes defaults that we may want to override with commandline arguments later. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
237ebb7cc4
commit
76233364b1
1 changed files with 8 additions and 8 deletions
|
|
@ -3988,6 +3988,14 @@ main(int argc, char **argv)
|
|||
int failed_tests;
|
||||
int rc;
|
||||
|
||||
in_debugger = is_debugger_attached();
|
||||
if (in_debugger)
|
||||
setenv("CK_FORK", "no", 0);
|
||||
|
||||
mode = litest_parse_argv(argc, argv);
|
||||
if (mode == LITEST_MODE_ERROR)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
rc = check_device_access();
|
||||
if (rc != 0)
|
||||
return rc;
|
||||
|
|
@ -3999,14 +4007,6 @@ main(int argc, char **argv)
|
|||
setenv("CK_DEFAULT_TIMEOUT", "30", 0);
|
||||
setenv("LIBINPUT_RUNNING_TEST_SUITE", "1", 1);
|
||||
|
||||
in_debugger = is_debugger_attached();
|
||||
if (in_debugger)
|
||||
setenv("CK_FORK", "no", 0);
|
||||
|
||||
mode = litest_parse_argv(argc, argv);
|
||||
if (mode == LITEST_MODE_ERROR)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
setup_tests();
|
||||
|
||||
if (mode == LITEST_MODE_LIST) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue