summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2019-10-28 15:12:22 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2019-10-29 08:59:40 +1000
commitcb2493b8ff591d59a49bf880eaff2ca6cff6b276 (patch)
tree003fa6219e4b9ecac221463be2b37d3b7e674436
parent94b5be448ef3568738fa505a122478b9ee8cdf4f (diff)
downloadlibinput-cb2493b8ff591d59a49bf880eaff2ca6cff6b276.tar.gz
test: make the test jobs dependent on the number of processors
Let's hope the test suite is more successful on puny VMs that way. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 454dd4a2cb160cf709a0cdaf059e4f0b643b9827)
-rw-r--r--test/litest.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/litest.c b/test/litest.c
index 5b09ec4e..38a866fd 100644
--- a/test/litest.c
+++ b/test/litest.c
@@ -46,6 +46,7 @@
#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/types.h>
+#include <sys/sysinfo.h>
#include <libudev.h>
#if HAVE_LIBSYSTEMD
#include <systemd/sd-bus.h>
@@ -73,7 +74,7 @@
#define UDEV_DEVICE_GROUPS_FILE UDEV_RULES_D \
"/80-libinput-device-groups-litest-XXXXXX.rules"
-static int jobs = 8;
+static int jobs;
static bool in_debugger = false;
static bool verbose = false;
static bool run_deviceless = false;
@@ -4252,6 +4253,8 @@ main(int argc, char **argv)
if (in_debugger || RUNNING_ON_VALGRIND)
setenv("CK_FORK", "no", 0);
+ jobs = get_nprocs() * 2;
+
mode = litest_parse_argv(argc, argv);
if (mode == LITEST_MODE_ERROR)
return EXIT_FAILURE;