Add address sanitizer (ASAN) support (fix #1002)
This commit is contained in:
1 parent
e17ccf2297
commit
8f115e9eed
2 files changed
+12
-1
No files matched your search
@@ -54,11 +54,16 @@ include_HEADERS = src/jv.h src/jq.h
|
|||||||
|
|
||||||
### Running tests under Valgrind
|
### Running tests under Valgrind
|
||||||
|
|
||||||
|
if ENABLE_ASAN
|
||||||
|
AM_CFLAGS += -fsanitize=address
|
||||||
|
NO_VALGRIND = 1
|
||||||
|
else
|
||||||
if ENABLE_VALGRIND
|
if ENABLE_VALGRIND
|
||||||
NO_VALGRIND =
|
NO_VALGRIND =
|
||||||
else
|
else
|
||||||
NO_VALGRIND = 1
|
NO_VALGRIND = 1
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
### Code coverage with gcov
|
### Code coverage with gcov
|
||||||
|
|
||||||
|
|||||||
+7
-1
@@ -89,6 +89,11 @@ dnl fix leaks.
|
|||||||
AC_ARG_ENABLE([valgrind],
|
AC_ARG_ENABLE([valgrind],
|
||||||
AC_HELP_STRING([--disable-valgrind], [do not run tests under Valgrind]))
|
AC_HELP_STRING([--disable-valgrind], [do not run tests under Valgrind]))
|
||||||
|
|
||||||
|
dnl Running tests with Valgrind is slow; address sanitizer (ASAN) is
|
||||||
|
dnl faster.
|
||||||
|
AC_ARG_ENABLE([asan],
|
||||||
|
AC_HELP_STRING([--enable-asan], [enable address sanitizer]))
|
||||||
|
|
||||||
dnl Code coverage
|
dnl Code coverage
|
||||||
AC_ARG_ENABLE([gcov],
|
AC_ARG_ENABLE([gcov],
|
||||||
AC_HELP_STRING([--enable-gcov], [enable gcov code coverage tool]))
|
AC_HELP_STRING([--enable-gcov], [enable gcov code coverage tool]))
|
||||||
@@ -117,7 +122,7 @@ AS_IF([test "x$enable_docs" != "xno"],[
|
|||||||
*****************************************************************
|
*****************************************************************
|
||||||
* Ruby dependencies for building jq documentation not found. *
|
* Ruby dependencies for building jq documentation not found. *
|
||||||
* You can still build, install and hack on jq, but the manpage *
|
* You can still build, install and hack on jq, but the manpage *
|
||||||
* will not be rebuilt and some of the tests won't run. *
|
* will not be rebuilt and some of the tests will not run. *
|
||||||
* See docs/README.md for how to install the docs dependencies. *
|
* See docs/README.md for how to install the docs dependencies. *
|
||||||
*****************************************************************
|
*****************************************************************
|
||||||
EOF
|
EOF
|
||||||
@@ -130,6 +135,7 @@ EOF
|
|||||||
])
|
])
|
||||||
|
|
||||||
AM_CONDITIONAL([ENABLE_VALGRIND], [test "x$enable_valgrind" != xno])
|
AM_CONDITIONAL([ENABLE_VALGRIND], [test "x$enable_valgrind" != xno])
|
||||||
|
AM_CONDITIONAL([ENABLE_ASAN], [test "x$enable_asan" = xyes])
|
||||||
AM_CONDITIONAL([ENABLE_GCOV], [test "x$enable_gcov" = xyes])
|
AM_CONDITIONAL([ENABLE_GCOV], [test "x$enable_gcov" = xyes])
|
||||||
AM_CONDITIONAL([ENABLE_DOCS], [test "x$enable_docs" != xno])
|
AM_CONDITIONAL([ENABLE_DOCS], [test "x$enable_docs" != xno])
|
||||||
AM_CONDITIONAL([ENABLE_ERROR_INJECTION], [test "x$enable_error_injection" = xyes])
|
AM_CONDITIONAL([ENABLE_ERROR_INJECTION], [test "x$enable_error_injection" = xyes])
|
||||||
|
|||||||
Reference in new issue
Block a user