summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorIgor Canadi <icanadi@fb.com>2015-05-22 09:11:29 -0700
committerIgor Canadi <icanadi@fb.com>2015-05-22 09:11:29 -0700
commit309a9d0760c6ff50a6323b9e76f5606adaa6bcbc (patch)
tree3ebe7e9a55c34661dd73bf9dcded46b2001d72fb /Makefile
parent7fee8775a459134c4cb04baae5bd1687e268f2a0 (diff)
Run tests sequentally if J=1
Summary: Sometimes we want to run tests sequentially. J=1 gives us that option Test Plan: make J=1 check -- sequential make J=2 check -- parallel Reviewers: sdong, yhchiang, meyering Reviewed By: meyering Subscribers: dhruba, leveldb Differential Revision: https://reviews.facebook.net/D38805
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 11 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 46de0cebd..a494e8eb6 100644
--- a/Makefile
+++ b/Makefile
@@ -497,17 +497,19 @@ CLEAN_FILES += t LOG $(TMPD)
watch-log:
watch --interval=0 'sort -k7,7nr -k4,4gr LOG|$(quoted_perl_command)'
-# If GNU parallel is installed, run the tests in parallel,
+# If J != 1 and GNU parallel is installed, run the tests in parallel,
# via the check_0 rule above. Otherwise, run them sequentially.
check: all
- $(AM_V_GEN)case $$(parallel --gnu --help 2>/dev/null) in \
- *'GNU Parallel'*) \
- t=$$($(test_names)); \
- $(MAKE) T="$$t" TMPD=$(TMPD) check_0;; \
- *) \
- for t in $(TESTS); do \
- echo "===== Running $$t"; ./$$t || exit 1; done;; \
- esac
+ $(AM_V_GEN)if test "$(J)" != 1 \
+ && (parallel --gnu --help 2>/dev/null) | \
+ grep -q 'GNU Parallel'; \
+ then \
+ t=$$($(test_names)); \
+ $(MAKE) T="$$t" TMPD=$(TMPD) check_0; \
+ else \
+ for t in $(TESTS); do \
+ echo "===== Running $$t"; ./$$t || exit 1; done; \
+ fi
rm -rf $(TMPD)
check_some: $(SUBSET) ldb_tests