浏览代码

new configure option --enable-valgrind=full to disable STARPU_SKIP_IF_VALGRIND (meaning all code will be tested with valgrind)

Nathalie Furmento 11 年之前
父节点
当前提交
70b047f2ce
共有 2 个文件被更改,包括 11 次插入9 次删除
  1. 4 1
      configure.ac
  2. 7 8
      tests/helper.h

+ 4 - 1
configure.ac

@@ -258,10 +258,13 @@ AC_CHECK_HEADERS([malloc.h], [AC_DEFINE([STARPU_HAVE_MALLOC_H], [1], [Define to
 AC_ARG_ENABLE(valgrind, [AS_HELP_STRING([--disable-valgrind],
 				   [Do not check the availability of valgrind.h and helgrind.h])],
 				   enable_valgrind=$enableval, enable_valgrind=yes)
-if test x$enable_valgrind = xyes ; then
+if test "$enable_valgrind" != "no" ; then
    AC_CHECK_HEADERS([valgrind/valgrind.h], [AC_DEFINE([STARPU_HAVE_VALGRIND_H], [1], [Define to 1 if you have the <valgrind/valgrind.h> header file.])])
    AC_CHECK_HEADERS([valgrind/helgrind.h], [AC_DEFINE([STARPU_HAVE_HELGRIND_H], [1], [Define to 1 if you have the <valgrind/helgrind.h> header file.])])
 fi
+if test "$enable_valgrind" = "full" ; then
+   AC_DEFINE([STARPU_VALGRIND_FULL], [1], [Define to 1 to disable STARPU_SKIP_IF_VALGRIND when running tests.])
+fi
 
 AC_CHECK_FUNC([sched_yield], [AC_DEFINE([STARPU_HAVE_SCHED_YIELD], [1], [Define to 1 if the function sched_yield is available.])])
 

+ 7 - 8
tests/helper.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -39,7 +39,7 @@
 //#define STARPU_TEST_OUTPUT
 #define FPRINTF(ofile, fmt, ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ## __VA_ARGS__); }} while(0)
 
-#ifdef STARPU_HAVE_VALGRIND_H
+#if defined(STARPU_HAVE_VALGRIND_H) && !defined(STARPU_VALGRIND_FULL)
 static int _starpu_valgrind_print_once STARPU_ATTRIBUTE_UNUSED = 0;
 
 #  define STARPU_SKIP_IF_VALGRIND \
@@ -55,11 +55,7 @@ static int _starpu_valgrind_print_once STARPU_ATTRIBUTE_UNUSED = 0;
 			return;						\
 		}							\
 	} while(0)
-#else
-#  define STARPU_SKIP_IF_VALGRIND
-#endif
 
-#ifdef STARPU_HAVE_VALGRIND_H
 #  define STARPU_RETURN(ret) \
 	do								\
 	{								\
@@ -70,7 +66,10 @@ static int _starpu_valgrind_print_once STARPU_ATTRIBUTE_UNUSED = 0;
 		} \
 		else return ret; \
 	} while(0)
-#else
+
+#else /* defined(STARPU_HAVE_VALGRIND_H) && !defined(STARPU_VALGRIND_FULL) */
 #  define STARPU_RETURN(ret) return ret
-#endif
+#  define STARPU_SKIP_IF_VALGRIND
+#endif  /* defined(STARPU_HAVE_VALGRIND_H) && !defined(STARPU_VALGRIND_FULL) */
+
 #endif /* _TESTS_HELPER_H */