]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
valgrind_check to exit on test failures
authorsdong <siying.d@fb.com>
Wed, 5 Aug 2015 23:04:18 +0000 (16:04 -0700)
committersdong <siying.d@fb.com>
Thu, 6 Aug 2015 00:46:09 +0000 (17:46 -0700)
Summary: Currently, valgrind_check doesn't fail on test failures, which creates confusion. valgrind_check should fail if test fails.

Test Plan: Manually change tests to return test failure or cause memory leak and see valgrind_check has the correct behavior.

Reviewers: anthony, yhchiang, IslamAbdelRahman, igor, kradhakrishnan, rven

Reviewed By: rven

Subscribers: leveldb, dhruba

Differential Revision: https://reviews.facebook.net/D43629

Makefile

index 2b4b3fc6a8c62b31e9a3e9d202673962abbdd62f..4dbc0bfd50d923106b3674d50cab890e167781b8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -575,8 +575,11 @@ valgrind_check: $(TESTS)
        for t in $(filter-out skiplist_test,$(TESTS)); do \
                stime=`date '+%s'`; \
                $(VALGRIND_VER) $(VALGRIND_OPTS) ./$$t; \
-               if [ $$? -eq $(VALGRIND_ERROR) ] ; then \
+               ret_code=$$?; \
+               if [ $$ret_code -eq $(VALGRIND_ERROR) ] ; then \
                        echo $$t >> $(VALGRIND_DIR)/valgrind_failed_tests; \
+               elif [ $$ret_code -ne 0 ]; then \
+                       exit $$ret_code; \
                fi; \
                etime=`date '+%s'`; \
                echo $$t $$((etime - stime)) >> $(VALGRIND_DIR)/valgrind_tests_times; \