Browse Source

Give test scripts a convenience macro for running the checker

Samuel Thibault 5 years ago
parent
commit
96476902f2
1 changed files with 8 additions and 1 deletions
  1. 8 1
      tests/loader.c

+ 8 - 1
tests/loader.c

@@ -305,10 +305,17 @@ int main(int argc, char *argv[])
 	    test_name[len-1] == 'h')
 	    test_name[len-1] == 'h')
 	{
 	{
 		/* This is a shell script, don't run the check on bash, but pass
 		/* This is a shell script, don't run the check on bash, but pass
-		it the decoded variables */
+		 * the script the decoded variables */
 		setenv("STARPU_CHECK_LAUNCHER", launcher, 1);
 		setenv("STARPU_CHECK_LAUNCHER", launcher, 1);
 		if (launcher_args)
 		if (launcher_args)
 			setenv("STARPU_CHECK_LAUNCHER_ARGS", launcher_args, 1);
 			setenv("STARPU_CHECK_LAUNCHER_ARGS", launcher_args, 1);
+
+		/* And give a convenience macro */
+		size_t len_launch = strlen(launcher) + 1 + strlen(launcher_args) + 1;
+		char *launch = malloc(len_launch);
+		snprintf(launch, len_launch, "%s %s", launcher, launcher_args);
+		setenv("STARPU_LAUNCH", launch, 1);
+
 		launcher = NULL;
 		launcher = NULL;
 		launcher_args = NULL;
 		launcher_args = NULL;
 	}
 	}