From: Paul Osmialowski Date: Wed, 29 Apr 2015 10:00:19 +0000 (+0200) Subject: kdbus: Ability to run kdbus test by executable binary name X-Git-Tag: submit/tizen/20160405.082219~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=555cb6b16c21b35a69411847206b5caa4bce1bb3;p=platform%2Fkernel%2Flinux-exynos.git kdbus: Ability to run kdbus test by executable binary name With this applied, you can do following: $ cp kdbus-test daemon $ cp kdbus-test send Then run 'daemon' in one shell session: $ ./daemon --bus test ...and 'send' in another: $ ./send --bus test Useful for testing features introduced by previous patches. Change-Id: Ic66355e664b7920736a0063b0ae6b456706d7d8d Signed-off-by: Paul Osmialowski --- diff --git a/tools/testing/selftests/kdbus/kdbus-test.c b/tools/testing/selftests/kdbus/kdbus-test.c index 526f25fbd79c..356a1c7fdf72 100644 --- a/tools/testing/selftests/kdbus/kdbus-test.c +++ b/tools/testing/selftests/kdbus/kdbus-test.c @@ -852,6 +852,7 @@ int main(int argc, char *argv[]) ARG_UIDMAP, ARG_GIDMAP, }; + char *exec = basename(argv[0]); kdbus_args = malloc(sizeof(*kdbus_args)); if (!kdbus_args) { @@ -881,6 +882,10 @@ int main(int argc, char *argv[]) srand(time(NULL)); + if (strcmp(exec, "kdbus-test") != 0) { + kdbus_args->test = exec; + } + while ((t = getopt_long(argc, argv, "hxfm:r:t:b:w:a", options, NULL)) >= 0) { switch (t) { case 'x':