瀏覽代碼

Make loader detect valgrind/helgrind/[altu]san execution

Rather than hardcoding the timeout in the tests.py configure, thus the
same for all of quick/normal/long cases.
Samuel Thibault 5 年之前
父節點
當前提交
8324d41f09
共有 1 個文件被更改,包括 14 次插入2 次删除
  1. 14 2
      tests/loader.c

+ 14 - 2
tests/loader.c

@@ -230,6 +230,9 @@ int main(int argc, char *argv[])
 	test_args = NULL;
 	timeout = 0;
 
+	launcher=getenv("STARPU_CHECK_LAUNCHER");
+	launcher_args=getenv("STARPU_CHECK_LAUNCHER_ARGS");
+
 	if (argv[x] && strcmp(argv[x], "-t") == 0)
 	{
 		timeout = strtol(argv[x+1], NULL, 10);
@@ -241,7 +244,18 @@ int main(int argc, char *argv[])
 		timeout = strtol(getenv("STARPU_TIMEOUT_ENV"), NULL, 10);
 	}
 	if (timeout <= 0)
+	{
 		timeout = DEFAULT_TIMEOUT;
+		if ((launcher && strstr(launcher, "valgrind")) ||
+		    (launcher && strstr(launcher, "helgrind")) ||
+		    getenv("TSAN_OPTIONS") != NULL)
+			timeout *= 10;
+		if (getenv("ASAN_OPTIONS") != NULL ||
+		    getenv("USAN_OPTIONS") != NULL ||
+		    getenv("LSAN_OPTIONS") != NULL)
+			timeout *= 2;
+	}
+
 #ifdef STARPU_SIMGRID
 	timeout *= 10;
 #endif
@@ -293,8 +307,6 @@ int main(int argc, char *argv[])
 	}
 
 	/* get launcher program */
-	launcher=getenv("STARPU_CHECK_LAUNCHER");
-	launcher_args=getenv("STARPU_CHECK_LAUNCHER_ARGS");
 	if (launcher_args)
 		launcher_args=strdup(launcher_args);