Skip to content

Commit 45cf791

Browse files
authored
Merge pull request #137 from etr/valgrind_travis
Enable valgrind memcheck tests on travis
2 parents 2f67108 + fec97e3 commit 45cf791

File tree

5 files changed

+24
-2
lines changed

5 files changed

+24
-2
lines changed

.travis.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ install:
5555
../configure --disable-fastopen --build `../config.guess` --host aarch64-linux-gnu CC="gcc -B$HOME/linker_bin" CXX="g++ -B$HOME/linker_bin";
5656
elif [ "$CROSS_COMPILE" = "1" ] && [ "$ARM_ARCH_DIR" = "arm-linux-gnueabi" ]; then
5757
../configure --disable-fastopen --build `../config.guess` --host arm-linux-gnueabi;
58+
elif [ "$VALGRIND" = "valgrind" ]; then
59+
../configure --enable-debug --disable-fastopen --disable-valgrind-helgrind --disable-valgrind-drd --disable-valgrind-sgcheck;
5860
else
5961
../configure --disable-fastopen;
6062
fi
@@ -85,6 +87,8 @@ script:
8587
fi
8688
- make check
8789
- cat test/test-suite.log
90+
- if [ "$VALGRIND" = "valgrind" ]; then make check-valgrind; fi;
91+
- if [ "$VALGRIND" = "valgrind" ]; then cat test/test-suite-memcheck.log; fi;
8892
- ls -l /usr/local/lib/
8993
- ls -l /usr/lib/
9094
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd ../src/; cppcheck --error-exitcode=1 .; cd ../build; fi
@@ -178,6 +182,17 @@ matrix:
178182
- g++-8
179183
env:
180184
- MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
185+
- os: linux
186+
addons:
187+
apt:
188+
sources:
189+
- ubuntu-toolchain-r-test
190+
packages:
191+
- g++-7
192+
- valgrind
193+
- valgrind-dbg
194+
env:
195+
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && VALGRIND=valgrind"
181196
#- os: osx
182197
# osx_image: xcode8
183198
# env:

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ AC_CONFIG_LINKS([test/test_content:test/test_content])
338338
AC_CONFIG_LINKS([test/cert.pem:test/cert.pem])
339339
AC_CONFIG_LINKS([test/key.pem:test/key.pem])
340340
AC_CONFIG_LINKS([test/test_root_ca.pem:test/test_root_ca.pem])
341+
AC_CONFIG_LINKS([test/libhttpserver.supp:test/libhttpserver.supp])
341342
AC_CONFIG_LINKS([examples/cert.pem:examples/cert.pem])
342343
AC_CONFIG_LINKS([examples/key.pem:examples/key.pem])
343344
AC_CONFIG_LINKS([examples/test_content:examples/test_content])

test/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ endif
4545
TESTS = $(check_PROGRAMS)
4646

4747
@VALGRIND_CHECK_RULES@
48-
#VALGRIND_SUPPRESSIONS_FILES = libhttpserver.supp
49-
#EXTRA_DIST = libhttpserver.supp
48+
VALGRIND_SUPPRESSIONS_FILES = libhttpserver.supp
49+
EXTRA_DIST = libhttpserver.supp

test/integ/ws_start_stop.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ LT_BEGIN_AUTO_TEST(ws_start_stop_suite, ssl_base)
377377
LT_ASSERT_EQ(res, 0);
378378
LT_CHECK_EQ(s, "OK");
379379
curl_easy_cleanup(curl);
380+
curl_global_cleanup();
380381

381382
ws.stop();
382383
LT_END_AUTO_TEST(ssl_base)

test/libhttpserver.supp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
gnutls_session_get_data
3+
Memcheck:Cond
4+
fun:gnutls_session_get_data
5+
}

0 commit comments

Comments
 (0)