meson uses MESON_TESTTHREADS to determine the number of parallel test
jobs. Since our main test suite cannot be run in parallel anyway, use
that same variable in litest to determine how many jobs we should fork
off.
In the CI pipeline, we can use FDO_CI_CONCURRENT to pass that down so we
don't end up running a billion jobs on a test runner.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
fi
if [[ -n "$FDO_CI_CONCURRENT" ]]; then
- NINJA_ARGS="-j${FDO_CI_CONCURRENT} $NINJA_ARGS"
+ NINJA_ARGS="-j$FDO_CI_CONCURRENT $NINJA_ARGS"
+ MESON_TESTTHREADS="$FDO_CI_CONCURRENT"
fi
echo "*************************************************"
int tty_mode = -1;
int failed_tests;
int rc;
+ const char *meson_testthreads;
in_debugger = is_debugger_attached();
if (in_debugger || RUNNING_ON_VALGRIND)
setenv("CK_FORK", "no", 0);
- jobs = get_nprocs();
- if (!RUNNING_ON_VALGRIND)
- jobs *= 2;
+ if ((meson_testthreads = getenv("MESON_TESTTHREADS")) == NULL ||
+ !safe_atoi(meson_testthreads, &jobs)) {
+ jobs = get_nprocs();
+ if (!RUNNING_ON_VALGRIND)
+ jobs *= 2;
+ }
mode = litest_parse_argv(argc, argv);
if (mode == LITEST_MODE_ERROR)