Commit 2cf16de4 authored by gejun's avatar gejun

Avoid concurrent submake in makefile of UT

parent 19ad43f3
......@@ -149,7 +149,7 @@ clean_bins:
clean_debug:
@$(MAKE) -C.. clean_debug
../libbrpc.dbg.a ../libbvar.dbg.a: FORCE
../libbrpc.dbg.a: FORCE
@$(MAKE) -C.. debug
FORCE:
......@@ -160,9 +160,9 @@ test_butil:$(TEST_BUTIL_OBJS) ../libbrpc.dbg.a
@echo "Linking $@"
@$(CXX) -o $@ $(LIBPATHS) -Xlinker "-(" $^ -Wl,-Bstatic $(STATIC_LINKINGS) -Wl,-Bdynamic -Xlinker "-)" $(DYNAMIC_LINKINGS)
test_bvar:$(TEST_BVAR_OBJS) ../libbvar.dbg.a
test_bvar:$(TEST_BVAR_OBJS) ../libbrpc.dbg.a
@echo "Linking $@"
@$(CXX) -o $@ $(LIBPATHS) -Xlinker "-(" $^ -Wl,-Bstatic $(STATIC_LINKINGS) -Wl,-Bdynamic -Xlinker "-)" $(DYNAMIC_LINKINGS)
@$(CXX) -o $@ $(LIBPATHS) -Xlinker "-(" $(TEST_BVAR_OBJS) ../libbvar.dbg.a -Wl,-Bstatic $(STATIC_LINKINGS) -Wl,-Bdynamic -Xlinker "-)" $(DYNAMIC_LINKINGS)
bthread%unittest:bthread%unittest.o ../libbrpc.dbg.a
@echo "Linking $@"
......
......@@ -9,18 +9,18 @@ for test_bin in $test_bins; do
>&2 echo "[runtest] $test_bin"
./$test_bin
rc=$?
if [[ $rc -ne 0 ]]; then
if [ $rc -ne 0 ]; then
failed_test="$test_bin"
break;
fi
done
if [[ $test_num -eq 0 ]]; then
if [ $test_num -eq 0 ]; then
>&2 echo "[runtest] Cannot find any tests"
exit 1
fi
if [[ -z "$failed_test" ]]; then
if [ -z "$failed_test" ]; then
>&2 echo "[runtest] $test_num succeeded"
elif [[ $test_num -gt 1 ]]; then
elif [ $test_num -gt 1 ]; then
>&2 echo "[runtest] '$failed_test' failed, $((test_num-1)) succeeded"
else
>&2 echo "[runtest] '$failed_test' failed"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment