[build] Evaluate test names only when db_test exists

Summary:
as titled, this will prevent the error that was printed because
test_names was evaluated before db_test was built.

Test Plan:
verified below command works and no longer prints errors:

  $ make release -j32

verified below command still finds the right tests:

  $ make J=32 parallel_check

Reviewers: igor

Reviewed By: igor

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D54117
This commit is contained in:
Andrew Kryczka 2016-02-12 10:49:35 -08:00
parent 6a2b4fcb80
commit 5bb7371ca6

View File

@ -644,8 +644,6 @@ parloop:
exit $$ret_bad; exit $$ret_bad;
endif endif
all_tests:=$(shell $(test_names))
parallel_check: $(TESTS) parallel_check: $(TESTS)
$(AM_V_GEN)if test "$(J)" > 1 \ $(AM_V_GEN)if test "$(J)" > 1 \
&& (parallel --gnu --help 2>/dev/null) | \ && (parallel --gnu --help 2>/dev/null) | \
@ -659,7 +657,7 @@ parallel_check: $(TESTS)
echo $(J);\ echo $(J);\
echo Test Dir: $(TMPD); \ echo Test Dir: $(TMPD); \
seq $(J) | parallel --gnu 's=$(TMPD)/rdb-{}; rm -rf $$s; mkdir $$s'; \ seq $(J) | parallel --gnu 's=$(TMPD)/rdb-{}; rm -rf $$s; mkdir $$s'; \
$(MAKE) PAR_TEST="$(all_tests)" TMPD=$(TMPD) \ $(MAKE) PAR_TEST="$(shell $(test_names))" TMPD=$(TMPD) \
J=$(J) db_test=1 parloop; \ J=$(J) db_test=1 parloop; \
$(MAKE) PAR_TEST="$(filter-out db_test, $(TESTS))" \ $(MAKE) PAR_TEST="$(filter-out db_test, $(TESTS))" \
TMPD=$(TMPD) J=$(J) db_test=0 parloop; TMPD=$(TMPD) J=$(J) db_test=0 parloop;