summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2019-03-13 08:17:03 -0700
committerPatrick Venture <venture@google.com>2019-03-21 17:41:15 +0000
commit7e276658d0a0783eb51303995db1a72daaadc4a2 (patch)
tree8e33f63365a2ad565fedba16e22c3365ca6a8eb1
parent2e476ac3563776b5320cf33f8fe05c5ac539c3a6 (diff)
downloadphosphor-hwmon-7e276658d0a0783eb51303995db1a72daaadc4a2.tar.gz
phosphor-hwmon-7e276658d0a0783eb51303995db1a72daaadc4a2.zip
build: enable valgrind
Enable valgrind to check memory usage. Change-Id: I73ec2ee1a92e797ea9b78d6ea440f9ccdd2f49f3 Signed-off-by: Patrick Venture <venture@google.com>
-rw-r--r--configure.ac10
-rw-r--r--test/Makefile.am2
2 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index dea63da..bd63629 100644
--- a/configure.ac
+++ b/configure.ac
@@ -123,6 +123,16 @@ AC_ARG_ENABLE([oe-sdk],
)
)
+# Check for valgrind
+AS_IF([test "x$enable_tests" = "xno"], [enable_valgrind=no])
+m4_foreach([vgtool], [valgrind_tool_list],
+ [AX_VALGRIND_DFLT(vgtool, [off])])
+AX_VALGRIND_DFLT([memcheck], [on])
+AX_VALGRIND_CHECK
+AM_EXTRA_RECURSIVE_TARGETS([check-valgrind])
+m4_foreach([vgtool], [valgrind_tool_list],
+ [AM_EXTRA_RECURSIVE_TARGETS([check-valgrind-]vgtool)])
+
# Code coverage
AX_CODE_COVERAGE
m4_ifdef([_AX_CODE_COVERAGE_RULES],
diff --git a/test/Makefile.am b/test/Makefile.am
index 60d07e0..37aa977 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,3 +1,5 @@
+@VALGRIND_CHECK_RULES@
+
AM_CPPFLAGS = \
-I$(top_srcdir)/ \
$(GTEST_CFLAGS) \
OpenPOWER on IntegriCloud