Skip to content

Integrate valgrind into Travis build #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cdunn2001 opened this issue Mar 15, 2015 · 4 comments · Fixed by #265
Closed

Integrate valgrind into Travis build #222

cdunn2001 opened this issue Mar 15, 2015 · 4 comments · Fixed by #265

Comments

@cdunn2001
Copy link
Contributor

From @cinemast in #157:

I integrated the valgrind checking to my travis build. Maybe that is a solution for you:

https://github.com/cinemast/libjson-rpc-cpp/blob/master/.travis.yml

@cinemast
Copy link
Contributor

Quick evaluation of latest master 951bd3d:

python rununittests.py --valgrind  ../build/src/test_lib_json/jsoncpp_test 
TESTING ==3278== Memcheck, a memory error detector: FAILED
TESTING ==3278== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.: FAILED
TESTING ==3278== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info: FAILED
TESTING ==3278== Command: /tmp/jsoncpp/build/src/test_lib_json/jsoncpp_test --test-auto --list-tests: FAILED
TESTING ==3278==: FAILED
TESTING ValueTest/checkNormalizeFloatingPointStr: OK
TESTING ValueTest/memberCount: OK
TESTING ValueTest/objects: OK
TESTING ValueTest/arrays: OK
TESTING ValueTest/null: OK
TESTING ValueTest/strings: OK
TESTING ValueTest/bools: OK
TESTING ValueTest/integers: OK
TESTING ValueTest/nonIntegers: OK
TESTING ValueTest/compareNull: OK
TESTING ValueTest/compareInt: OK
TESTING ValueTest/compareUInt: OK
TESTING ValueTest/compareDouble: OK
TESTING ValueTest/compareString: OK
TESTING ValueTest/compareBoolean: OK
TESTING ValueTest/compareArray: OK
TESTING ValueTest/compareObject: OK
TESTING ValueTest/compareType: OK
TESTING ValueTest/offsetAccessors: OK
TESTING ValueTest/typeChecksThrowExceptions: OK
TESTING ValueTest/StaticString: OK
TESTING ValueTest/CommentBefore: OK
TESTING ValueTest/zeroes: OK
TESTING ValueTest/zeroesInKeys: OK
TESTING WriterTest/dropNullPlaceholders: OK
TESTING StreamWriterTest/dropNullPlaceholders: OK
TESTING StreamWriterTest/writeZeroes: OK
TESTING ReaderTest/parseWithNoErrors: OK
TESTING ReaderTest/parseWithNoErrorsTestingOffsets: OK
TESTING ReaderTest/parseWithOneError: OK
TESTING ReaderTest/parseChineseWithOneError: OK
TESTING ReaderTest/parseWithDetailError: OK
TESTING CharReaderTest/parseWithNoErrors: OK
TESTING CharReaderTest/parseWithNoErrorsTestingOffsets: OK
TESTING CharReaderTest/parseWithOneError: OK
TESTING CharReaderTest/parseChineseWithOneError: OK
TESTING CharReaderTest/parseWithDetailError: OK
TESTING CharReaderTest/parseWithStackLimit: OK
TESTING CharReaderStrictModeTest/dupKeys: OK
TESTING CharReaderFailIfExtraTest/issue164: OK
TESTING CharReaderFailIfExtraTest/issue107: OK
TESTING CharReaderFailIfExtraTest/commentAfterObject: OK
TESTING CharReaderFailIfExtraTest/commentAfterArray: OK
TESTING CharReaderFailIfExtraTest/commentAfterBool: OK
TESTING CharReaderAllowDropNullTest/issue178: OK
TESTING CharReaderAllowSingleQuotesTest/issue182: OK
TESTING CharReaderAllowZeroesTest/issue176: OK
TESTING BuilderTest/settings: OK
TESTING IteratorTest/distance: OK
TESTING IteratorTest/names: OK
TESTING IteratorTest/indexes: OK
TESTING ==3278==: FAILED
TESTING ==3278== HEAP SUMMARY:: FAILED
TESTING ==3278==     in use at exit: 0 bytes in 0 blocks: FAILED
TESTING ==3278==   total heap usage: 372 allocs, 372 frees, 28,948 bytes allocated: FAILED
TESTING ==3278==: FAILED
TESTING ==3278== All heap blocks were freed -- no leaks are possible: FAILED
TESTING ==3278==: FAILED
TESTING ==3278== For counts of detected and suppressed errors, rerun with: -v: FAILED
TESTING ==3278== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0): FAILED

==3280== Memcheck, a memory error detector
==3280== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==3280== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==3280== Command: /tmp/jsoncpp/build/src/test_lib_json/jsoncpp_test --test-auto --test ==3278==\ Memcheck,\ a\ memory\ error\ detector
==3280== 
Test '==3278== Memcheck, a memory error detector' does not exist!
==3280== 
==3280== HEAP SUMMARY:
==3280==     in use at exit: 0 bytes in 0 blocks
==3280==   total heap usage: 373 allocs, 373 frees, 29,009 bytes allocated
==3280== 
==3280== All heap blocks were freed -- no leaks are possible
==3280== 
==3280== For counts of detected and suppressed errors, rerun with: -v
==3280== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

==3282== Memcheck, a memory error detector
==3282== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==3282== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==3282== Command: /tmp/jsoncpp/build/src/test_lib_json/jsoncpp_test --test-auto --test ==3278==\ Copyright\ (C)\ 2002-2013,\ and\ GNU\ GPL'd,\ by\ Julian\ Seward\ et\ al.
==3282== 
Test '==3278== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.' does not exist!
==3282== 
==3282== HEAP SUMMARY:
==3282==     in use at exit: 0 bytes in 0 blocks
==3282==   total heap usage: 373 allocs, 373 frees, 29,039 bytes allocated
==3282== 
==3282== All heap blocks were freed -- no leaks are possible
==3282== 
==3282== For counts of detected and suppressed errors, rerun with: -v
==3282== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

==3284== Memcheck, a memory error detector
==3284== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==3284== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==3284== Command: /tmp/jsoncpp/build/src/test_lib_json/jsoncpp_test --test-auto --test ==3278==\ Using\ Valgrind-3.10.0\ and\ LibVEX;\ rerun\ with\ -h\ for\ copyright\ info
==3284== 
Test '==3278== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info' does not exist!
==3284== 
==3284== HEAP SUMMARY:
==3284==     in use at exit: 0 bytes in 0 blocks
==3284==   total heap usage: 373 allocs, 373 frees, 29,042 bytes allocated
==3284== 
==3284== All heap blocks were freed -- no leaks are possible
==3284== 
==3284== For counts of detected and suppressed errors, rerun with: -v
==3284== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

==3286== Memcheck, a memory error detector
==3286== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==3286== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==3286== Command: /tmp/jsoncpp/build/src/test_lib_json/jsoncpp_test --test-auto --test ==3278==\ Command:\ /tmp/jsoncpp/build/src/test_lib_json/jsoncpp_test\ --test-auto\ --list-tests
==3286== 
Test '==3278== Command: /tmp/jsoncpp/build/src/test_lib_json/jsoncpp_test --test-auto --list-tests' does not exist!
==3286== 
==3286== HEAP SUMMARY:
==3286==     in use at exit: 0 bytes in 0 blocks
==3286==   total heap usage: 373 allocs, 373 frees, 29,059 bytes allocated
==3286== 
==3286== All heap blocks were freed -- no leaks are possible
==3286== 
==3286== For counts of detected and suppressed errors, rerun with: -v
==3286== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

==3288== Memcheck, a memory error detector
==3288== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==3288== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==3288== Command: /tmp/jsoncpp/build/src/test_lib_json/jsoncpp_test --test-auto --test ==3278==
==3288== 
Test '==3278==' does not exist!
==3288== 
==3288== HEAP SUMMARY:
==3288==     in use at exit: 0 bytes in 0 blocks
==3288==   total heap usage: 373 allocs, 373 frees, 28,975 bytes allocated
==3288== 
==3288== All heap blocks were freed -- no leaks are possible
==3288== 
==3288== For counts of detected and suppressed errors, rerun with: -v
==3288== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

==3398== Memcheck, a memory error detector
==3398== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==3398== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==3398== Command: /tmp/jsoncpp/build/src/test_lib_json/jsoncpp_test --test-auto --test ==3278==
==3398== 
Test '==3278==' does not exist!
==3398== 
==3398== HEAP SUMMARY:
==3398==     in use at exit: 0 bytes in 0 blocks
==3398==   total heap usage: 373 allocs, 373 frees, 28,975 bytes allocated
==3398== 
==3398== All heap blocks were freed -- no leaks are possible
==3398== 
==3398== For counts of detected and suppressed errors, rerun with: -v
==3398== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

==3400== Memcheck, a memory error detector
==3400== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==3400== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==3400== Command: /tmp/jsoncpp/build/src/test_lib_json/jsoncpp_test --test-auto --test ==3278==\ HEAP\ SUMMARY:
==3400== 
Test '==3278== HEAP SUMMARY:' does not exist!
==3400== 
==3400== HEAP SUMMARY:
==3400==     in use at exit: 0 bytes in 0 blocks
==3400==   total heap usage: 373 allocs, 373 frees, 28,989 bytes allocated
==3400== 
==3400== All heap blocks were freed -- no leaks are possible
==3400== 
==3400== For counts of detected and suppressed errors, rerun with: -v
==3400== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

==3402== Memcheck, a memory error detector
==3402== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==3402== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==3402== Command: /tmp/jsoncpp/build/src/test_lib_json/jsoncpp_test --test-auto --test ==3278==\ \ \ \ \ in\ use\ at\ exit:\ 0\ bytes\ in\ 0\ blocks
==3402== 
Test '==3278==     in use at exit: 0 bytes in 0 blocks' does not exist!
==3402== 
==3402== HEAP SUMMARY:
==3402==     in use at exit: 0 bytes in 0 blocks
==3402==   total heap usage: 373 allocs, 373 frees, 29,015 bytes allocated
==3402== 
==3402== All heap blocks were freed -- no leaks are possible
==3402== 
==3402== For counts of detected and suppressed errors, rerun with: -v
==3402== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

==3404== Memcheck, a memory error detector
==3404== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==3404== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==3404== Command: /tmp/jsoncpp/build/src/test_lib_json/jsoncpp_test --test-auto --test ==3278==\ \ \ total\ heap\ usage:\ 372\ allocs,\ 372\ frees,\ 28,948\ bytes\ allocated
==3404== 
Test '==3278==   total heap usage: 372 allocs, 372 frees, 28,948 bytes allocated' does not exist!
==3404== 
==3404== HEAP SUMMARY:
==3404==     in use at exit: 0 bytes in 0 blocks
==3404==   total heap usage: 373 allocs, 373 frees, 29,041 bytes allocated
==3404== 
==3404== All heap blocks were freed -- no leaks are possible
==3404== 
==3404== For counts of detected and suppressed errors, rerun with: -v
==3404== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

==3406== Memcheck, a memory error detector
==3406== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==3406== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==3406== Command: /tmp/jsoncpp/build/src/test_lib_json/jsoncpp_test --test-auto --test ==3278==
==3406== 
Test '==3278==' does not exist!
==3406== 
==3406== HEAP SUMMARY:
==3406==     in use at exit: 0 bytes in 0 blocks
==3406==   total heap usage: 373 allocs, 373 frees, 28,975 bytes allocated
==3406== 
==3406== All heap blocks were freed -- no leaks are possible
==3406== 
==3406== For counts of detected and suppressed errors, rerun with: -v
==3406== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

==3408== Memcheck, a memory error detector
==3408== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==3408== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==3408== Command: /tmp/jsoncpp/build/src/test_lib_json/jsoncpp_test --test-auto --test ==3278==\ All\ heap\ blocks\ were\ freed\ --\ no\ leaks\ are\ possible
==3408== 
Test '==3278== All heap blocks were freed -- no leaks are possible' does not exist!
==3408== 
==3408== HEAP SUMMARY:
==3408==     in use at exit: 0 bytes in 0 blocks
==3408==   total heap usage: 373 allocs, 373 frees, 29,027 bytes allocated
==3408== 
==3408== All heap blocks were freed -- no leaks are possible
==3408== 
==3408== For counts of detected and suppressed errors, rerun with: -v
==3408== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

==3410== Memcheck, a memory error detector
==3410== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==3410== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==3410== Command: /tmp/jsoncpp/build/src/test_lib_json/jsoncpp_test --test-auto --test ==3278==
==3410== 
Test '==3278==' does not exist!
==3410== 
==3410== HEAP SUMMARY:
==3410==     in use at exit: 0 bytes in 0 blocks
==3410==   total heap usage: 373 allocs, 373 frees, 28,975 bytes allocated
==3410== 
==3410== All heap blocks were freed -- no leaks are possible
==3410== 
==3410== For counts of detected and suppressed errors, rerun with: -v
==3410== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

==3412== Memcheck, a memory error detector
==3412== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==3412== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==3412== Command: /tmp/jsoncpp/build/src/test_lib_json/jsoncpp_test --test-auto --test ==3278==\ For\ counts\ of\ detected\ and\ suppressed\ errors,\ rerun\ with:\ -v
==3412== 
Test '==3278== For counts of detected and suppressed errors, rerun with: -v' does not exist!
==3412== 
==3412== HEAP SUMMARY:
==3412==     in use at exit: 0 bytes in 0 blocks
==3412==   total heap usage: 373 allocs, 373 frees, 29,036 bytes allocated
==3412== 
==3412== All heap blocks were freed -- no leaks are possible
==3412== 
==3412== For counts of detected and suppressed errors, rerun with: -v
==3412== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

==3414== Memcheck, a memory error detector
==3414== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==3414== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==3414== Command: /tmp/jsoncpp/build/src/test_lib_json/jsoncpp_test --test-auto --test ==3278==\ ERROR\ SUMMARY:\ 0\ errors\ from\ 0\ contexts\ (suppressed:\ 0\ from\ 0)
==3414== 
Test '==3278== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)' does not exist!
==3414== 
==3414== HEAP SUMMARY:
==3414==     in use at exit: 0 bytes in 0 blocks
==3414==   total heap usage: 373 allocs, 373 frees, 29,038 bytes allocated
==3414== 
==3414== All heap blocks were freed -- no leaks are possible
==3414== 
==3414== For counts of detected and suppressed errors, rerun with: -v
==3414== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

51/65 tests passed (14 failure(s))

@cdunn2001
Copy link
Contributor Author

Oh. The odd test system is parsing stderr, I think. I'd like to move to gtest at some point. But at least it's valgrind-clean.

@cinemast
Copy link
Contributor

I have made good experiences with boost::test.

cdunn2001 added a commit to cdunn2001/jsoncpp that referenced this issue Apr 27, 2015
Because this runs apt-get, it will not work as-is for OSX. So when
we have OSX in Travis, we will have to wrap this somehow. See open-source-parsers#250.

Closes open-source-parsers#222.
@cdunn2001
Copy link
Contributor Author

Thanks, @cinemast!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants