[PATCH libinput 12/13] test: if a filter is specified, don't parallelize jobs by default

Peter Hutterer peter.hutterer at who-t.net
Tue Aug 2 02:40:57 UTC 2016


Likely testing a specific set of tests, possibly in gdb. So don't parallelize.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 test/litest.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/test/litest.c b/test/litest.c
index 5a8498f..902543d 100644
--- a/test/litest.c
+++ b/test/litest.c
@@ -3099,6 +3099,12 @@ litest_parse_argv(int argc, char **argv)
 		{ 0, 0, 0, 0}
 	};
 
+	enum {
+		JOBS_DEFAULT,
+		JOBS_SINGLE,
+		JOBS_CUSTOM
+	} want_jobs = JOBS_DEFAULT;
+
 	while(1) {
 		int c;
 		int option_index = 0;
@@ -3109,16 +3115,23 @@ litest_parse_argv(int argc, char **argv)
 		switch(c) {
 		case OPT_FILTER_TEST:
 			filter_test = optarg;
+			if (want_jobs == JOBS_DEFAULT)
+				want_jobs = JOBS_SINGLE;
 			break;
 		case OPT_FILTER_DEVICE:
 			filter_device = optarg;
+			if (want_jobs == JOBS_DEFAULT)
+				want_jobs = JOBS_SINGLE;
 			break;
 		case OPT_FILTER_GROUP:
 			filter_group = optarg;
+			if (want_jobs == JOBS_DEFAULT)
+				want_jobs = JOBS_SINGLE;
 			break;
 		case 'j':
 		case OPT_JOBS:
 			jobs = atoi(optarg);
+			want_jobs = JOBS_CUSTOM;
 			break;
 		case OPT_LIST:
 			return LITEST_MODE_LIST;
@@ -3131,6 +3144,9 @@ litest_parse_argv(int argc, char **argv)
 		}
 	}
 
+	if (want_jobs == JOBS_SINGLE)
+		jobs = 1;
+
 	return LITEST_MODE_TEST;
 }
 
-- 
2.7.4



More information about the wayland-devel mailing list