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
This commit is contained in:
Igor Canadi 2015-05-22 09:11:29 -07:00
parent 7fee8775a4
commit 309a9d0760

View File

@ -497,17 +497,19 @@ CLEAN_FILES += t LOG $(TMPD)
watch-log: watch-log:
watch --interval=0 'sort -k7,7nr -k4,4gr LOG|$(quoted_perl_command)' 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. # via the check_0 rule above. Otherwise, run them sequentially.
check: all check: all
$(AM_V_GEN)case $$(parallel --gnu --help 2>/dev/null) in \ $(AM_V_GEN)if test "$(J)" != 1 \
*'GNU Parallel'*) \ && (parallel --gnu --help 2>/dev/null) | \
t=$$($(test_names)); \ grep -q 'GNU Parallel'; \
$(MAKE) T="$$t" TMPD=$(TMPD) check_0;; \ then \
*) \ t=$$($(test_names)); \
for t in $(TESTS); do \ $(MAKE) T="$$t" TMPD=$(TMPD) check_0; \
echo "===== Running $$t"; ./$$t || exit 1; done;; \ else \
esac for t in $(TESTS); do \
echo "===== Running $$t"; ./$$t || exit 1; done; \
fi
rm -rf $(TMPD) rm -rf $(TMPD)
check_some: $(SUBSET) ldb_tests check_some: $(SUBSET) ldb_tests