Summary: The script valgrind_test.sh runs Valgrind for all tests in the makefile including leak-checks and outputs the logs for every test in a separate file with the name "valgrind_log_<testname>". It prints the failed tests in the file "valgrind_failed_tests". All these files are created in the directory "VALGRIND_LOGS" which can be changed in the Makefile. Finally it checks the line-count for the file "valgrind_failed_tests" and returns 0 if no tests failed and 1 otherwise. Test Plan: ./valgrind_test.sh; Changed the tests to incorporte leaks and verified correctness Reviewers: dhruba, sheki, MarkCallaghan Reviewed By: sheki CC: zshao Differential Revision: https://reviews.facebook.net/D8877main
parent
c41f1e995c
commit
ec96ad5405
@ -0,0 +1,4 @@ |
||||
This directory stores the tests that failed valgrind and the logs associated |
||||
with the failed runs. |
||||
"make valgrind_check" can be invoked to call valgrind on the rocksdb tests and |
||||
generate files in this directory |
@ -0,0 +1,18 @@ |
||||
#!/bin/bash |
||||
#A shell script for Jenknis to run valgrind on rocksdb tests |
||||
#Returns 0 on success when there are no failed tests |
||||
|
||||
VALGRIND_DIR=VALGRIND_LOGS |
||||
make valgrind_check |
||||
NUM_FAILED_TESTS=`wc -l $VALGRIND_DIR/valgrind_failed_tests | awk '{print $1}'` |
||||
if [ $NUM_FAILED_TESTS -le '1' ]; then |
||||
{ |
||||
echo No tests have valgrind errors; |
||||
exit 0; |
||||
} |
||||
else |
||||
{ |
||||
cat $VALGRIND_DIR/valgrind_failed_tests; |
||||
exit 1; |
||||
} |
||||
fi |
Loading…
Reference in new issue