test: only force gdb to no-fork, valgrind can fork
authorPeter Hutterer <peter.hutterer@who-t.net>
Tue, 15 Oct 2024 09:27:39 +0000 (19:27 +1000)
committerMarge Bot <emma+marge@anholt.net>
Wed, 30 Oct 2024 23:20:42 +0000 (23:20 +0000)
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1067>

test/litest.c

index 2745aa64d0cb9bbba1a99d414cc4d127836a302c..fa2c0ce9c0527dc87a6561cae395f820a3e4ecd9 100644 (file)
@@ -4754,7 +4754,6 @@ disable_tty(void)
        if (!run_deviceless &&
            jobs > 1 &&
            !in_debugger &&
-           getenv("CK_FORK") == NULL &&
            isatty(STDIN_FILENO) &&
            ioctl(STDIN_FILENO, KDGKBMODE, &tty_mode) == 0) {
 #ifdef __linux__
@@ -4823,11 +4822,10 @@ main(int argc, char **argv)
        const char *meson_testthreads;
 
        in_debugger = is_debugger_attached();
-       if (in_debugger || RUNNING_ON_VALGRIND)
-               setenv("CK_FORK", "no", 0);
-
-       if ((meson_testthreads = getenv("MESON_TESTTHREADS")) == NULL ||
-            !safe_atoi(meson_testthreads, &jobs)) {
+       if (in_debugger) {
+               jobs = 0;
+       } else if ((meson_testthreads = getenv("MESON_TESTTHREADS")) == NULL ||
+                  !safe_atoi(meson_testthreads, &jobs)) {
                jobs = get_nprocs();
                if (!RUNNING_ON_VALGRIND)
                        jobs *= 2;