From: Michael Vrable Date: Wed, 19 Jun 2013 17:26:42 +0000 (-0700) Subject: Use valgrind to check for memory leaks in the tests. X-Git-Url: http://git.vrable.net/?a=commitdiff_plain;h=b44dcf7561fa5925b7c1821d6cf565f371272b9f;p=cumulus.git Use valgrind to check for memory leaks in the tests. --- diff --git a/tests/run-test b/tests/run-test index 7d3ec0c..a1fd7c5 100755 --- a/tests/run-test +++ b/tests/run-test @@ -31,6 +31,9 @@ BIN_DIR="$(readlink -f "$TEST_DIR/..")" # Directory where temporary files used for the tests can be stored. TMP_DIR="$(readlink -f "$(mktemp -d cumulus-tests.XXXXXX)")" +# Command to use for running memory leak tests. +VALGRIND="valgrind --tool=memcheck --leak-check=full --log-file=$TMP_DIR/valgrind.log" + log_action() { echo echo "================================================================" @@ -67,7 +70,7 @@ log_action "Running second backup..." sleep 5 BACKUP_DIR="$TMP_DIR/backups" mkdir "$BACKUP_DIR" -"$BIN_DIR"/cumulus --dest="$BACKUP_DIR" --localdb="$LOCALDB" \ +$VALGRIND "$BIN_DIR"/cumulus --dest="$BACKUP_DIR" --localdb="$LOCALDB" \ --scheme=test -v "$TREE" log_action "Restoring snapshots"