testsuite: Smokey: Use argv[0] in favor of hard-coded paths
PATCH 1/1 testsuite: Smokey: Use argv[0] in favor of hard-coded paths
From: Jan Kiszka <[email protected]>
Whenever possible (dlopen test excluded so far), use argv[0] when calling the smokey binary again or running it under gdb. This reduces the dependency on hard-coded paths and also supports invocation from the build folder.
Signed-off-by Jan Kiszka <[email protected]>
--- testsuite/smokey/gdb/gdb.c | 3 +-- testsuite/smokey/posix-fork/posix-fork.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)
testsuite/smokey/gdb/gdb.c +1 -2
@@ -274,8 +274,7 @@ static int run_gdb(struct smokey_test *t, int argc, char *const argv[])snprintf (run_param,sizeof (run_param),"--run=%d" , t->__reserved.id);execl ("/usr/bin/gdb" ,"gdb" ,"--args" , -CONFIG_XENO_PREFIX "/bin/smokey" , run_param, -"run_target" ,NULL ); + argv[0 ], run_param,"run_target" ,NULL );_exit (ESRCH );default :
testsuite/smokey/posix-fork/posix-fork.c +1 -1
@@ -32,5 +32,5 @@ static int run_posix_fork(struct smokey_test *t, int argc, char *const argv[])* Re-exec ourselves without running any test, this is * enough for creating a shadow context. */ -return smokey_fork_exec (XENO_TEST_DIR "/smokey" ,"smokey" ); +return smokey_fork_exec (argv[0 ],"smokey" ); }
Signature · 1 line
2.16.4