From 7e06b47018dc3b590852dda0201443391a1f6fef Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 5 Jul 2017 15:45:19 +1000 Subject: [PATCH] test: stop changing argv[0] for forked tests This was useful when we had a small number of test-forks with the suites distributed. It helped debug which one is still running and then which suites are in it. Now that we simply distributed everything across the forks it doesn't have a lot of usefulness and it interferes with the ability to backtrace properly. Signed-off-by: Peter Hutterer --- test/litest.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/test/litest.c b/test/litest.c index 3cb3f386..9e874050 100644 --- a/test/litest.c +++ b/test/litest.c @@ -916,13 +916,12 @@ litest_free_test_list(struct list *tests) } static int -litest_run_suite(char *argv0, struct list *tests, int which, int max) +litest_run_suite(struct list *tests, int which, int max) { int failed = 0; SRunner *sr = NULL; struct suite *s; struct test *t; - int argvlen = strlen(argv0); int count = -1; struct name { struct list node; @@ -931,9 +930,6 @@ litest_run_suite(char *argv0, struct list *tests, int which, int max) struct name *n, *tmp; struct list testnames; - if (max > 1) - snprintf(argv0, argvlen, "libinput-test-%-50d", which); - /* Check just takes the suite/test name pointers but doesn't strdup * them - we have to keep them around */ list_init(&testnames); @@ -1011,7 +1007,7 @@ out: } static int -litest_fork_subtests(char *argv0, struct list *tests, int max_forks) +litest_fork_subtests(struct list *tests, int max_forks) { int failed = 0; int status; @@ -1021,7 +1017,7 @@ litest_fork_subtests(char *argv0, struct list *tests, int max_forks) for (f = 0; f < max_forks; f++) { pid = fork(); if (pid == 0) { - failed = litest_run_suite(argv0, tests, f, max_forks); + failed = litest_run_suite(tests, f, max_forks); litest_free_test_list(&all_tests); exit(failed); /* child always exits here */ @@ -1058,9 +1054,9 @@ litest_run(int argc, char **argv) litest_setup_sighandler(SIGINT); if (jobs == 1) - failed = litest_run_suite(argv[0], &all_tests, 1, 1); + failed = litest_run_suite(&all_tests, 1, 1); else - failed = litest_fork_subtests(argv[0], &all_tests, jobs); + failed = litest_fork_subtests(&all_tests, jobs); litest_free_test_list(&all_tests);