[tests] Rerun test without swallowing output on failure

Reviewed By: jvillard

Differential Revision: D3992995

fbshipit-source-id: 85d2586
master
Josh Berdine 8 years ago committed by Facebook Github Bot
parent ac0084019c
commit 6697ed781f

@ -125,3 +125,7 @@ CLANG_DEPS = $(addprefix $(PYTHON_LIB_DIR)/, \
$(INFERPRINT_BIN) $(INFERPRINT_BIN)
JAVA_MODELS_JAR = $(LIB_DIR)/java/models.jar JAVA_MODELS_JAR = $(LIB_DIR)/java/models.jar
define silent_on_success
$(1) >/dev/null 2>/dev/null || ($(1) && exit 1)
endef

@ -17,5 +17,5 @@ compile:
analyze: analyze:
INFER_REPORT_CUSTOM_ERROR=1 \ INFER_REPORT_CUSTOM_ERROR=1 \
$(INFER_BIN) -a $(ANALYZER) --check-duplicate-symbols --developer-mode -- clang $(OPTIONS) $(FILES) >/dev/null 2>duplicates.txt $(call silent_on_success,$(INFER_BIN) -a $(ANALYZER) --check-duplicate-symbols --developer-mode -- clang $(OPTIONS) $(FILES) 2>duplicates.txt)
grep "DUPLICATE_SYMBOLS" duplicates.txt; test $$? -ne 0 grep "DUPLICATE_SYMBOLS" duplicates.txt; test $$? -ne 0

@ -61,5 +61,5 @@ compile:
clang $(OPTIONS) $(FILES) clang $(OPTIONS) $(FILES)
analyze: analyze:
$(INFER_BIN) -a $(ANALYZER) --cxx --ml-buckets cpp --check-duplicate-symbols -- clang $(OPTIONS) $(FILES) >/dev/null 2>duplicates.txt $(call silent_on_success,$(INFER_BIN) -a $(ANALYZER) --cxx --ml-buckets cpp --check-duplicate-symbols -- clang $(OPTIONS) $(FILES) 2>duplicates.txt)
grep "DUPLICATE_SYMBOLS" duplicates.txt; test $$? -ne 0 grep "DUPLICATE_SYMBOLS" duplicates.txt; test $$? -ne 0

@ -27,4 +27,4 @@ compile:
javac -cp $(CLASSPATH) $(FILES) javac -cp $(CLASSPATH) $(FILES)
analyze: analyze:
$(INFER_BIN) -a $(ANALYZER) -- javac -cp $(CLASSPATH) $(FILES) >/dev/null 2>/dev/null $(call silent_on_success,$(INFER_BIN) -a $(ANALYZER) -- javac -cp $(CLASSPATH) $(FILES))

@ -24,7 +24,7 @@ compile:
analyze: analyze:
for file in $(FILES) ; do \ for file in $(FILES) ; do \
$(INFER_BIN) -a $(ANALYZER) --stacktrace $$file.stacktrace.json -- javac -cp $(CLASSPATH) $$file.java >/dev/null 2>/dev/null ; \ $(call silent_on_success,$(INFER_BIN) -a $(ANALYZER) --stacktrace $$file.stacktrace.json -- javac -cp $(CLASSPATH) $$file.java) ; \
cp infer-out/crashcontext/crashcontext.json $$file.exp.test ; \ cp infer-out/crashcontext/crashcontext.json $$file.exp.test ; \
done done

@ -29,4 +29,4 @@ compile:
analyze: analyze:
ERADICATE_RETURN_OVER_ANNOTATED=1 \ ERADICATE_RETURN_OVER_ANNOTATED=1 \
$(INFER_BIN) -a $(ANALYZER) -- javac -cp $(CLASSPATH) $(FILES) >/dev/null 2>/dev/null $(call silent_on_success,$(INFER_BIN) -a $(ANALYZER) -- javac -cp $(CLASSPATH) $(FILES))

@ -16,4 +16,4 @@ compile:
javac -cp $(CLASSPATH) $(FILES) javac -cp $(CLASSPATH) $(FILES)
analyze: analyze:
$(INFER_BIN) -a $(ANALYZER) --android-harness -- javac -cp $(CLASSPATH) $(FILES) >/dev/null 2>/dev/null $(call silent_on_success,$(INFER_BIN) -a $(ANALYZER) --android-harness -- javac -cp $(CLASSPATH) $(FILES))

@ -43,4 +43,4 @@ compile:
javac -cp $(CLASSPATH) $(FILES) javac -cp $(CLASSPATH) $(FILES)
analyze: analyze:
$(INFER_BIN) -a $(ANALYZER) -- javac -cp $(CLASSPATH) $(FILES) >/dev/null 2>/dev/null $(call silent_on_success,$(INFER_BIN) -a $(ANALYZER) -- javac -cp $(CLASSPATH) $(FILES))

@ -25,4 +25,4 @@ compile:
javac -cp $(CLASSPATH) $(FILES) javac -cp $(CLASSPATH) $(FILES)
analyze: analyze:
$(INFER_BIN) -a $(ANALYZER) -- javac -cp $(CLASSPATH) $(FILES) >/dev/null 2>/dev/null $(call silent_on_success,$(INFER_BIN) -a $(ANALYZER) -- javac -cp $(CLASSPATH) $(FILES))

@ -39,4 +39,4 @@ compile:
javac -cp $(CLASSPATH) $(FILES) javac -cp $(CLASSPATH) $(FILES)
analyze: analyze:
$(INFER_BIN) -a $(ANALYZER) -- javac -cp $(CLASSPATH) $(FILES) >/dev/null 2>/dev/null $(call silent_on_success,$(INFER_BIN) -a $(ANALYZER) -- javac -cp $(CLASSPATH) $(FILES))

@ -99,11 +99,11 @@ compile:
CLEAN_EXTRA = infer-out-arc infer-out-all CLEAN_EXTRA = infer-out-arc infer-out-all
analyze: analyze:
$(INFER_BIN) -a $(ANALYZER) --cxx --ml-buckets all --check-duplicate-symbols -o infer-out-all -- clang $(OPTIONS) $(FILES_BUCKET_ALL) >/dev/null 2>duplicates.txt $(call silent_on_success,$(INFER_BIN) -a $(ANALYZER) --cxx --ml-buckets all --check-duplicate-symbols -o infer-out-all -- clang $(OPTIONS) $(FILES_BUCKET_ALL) 2>duplicates.txt)
grep "DUPLICATE_SYMBOLS" duplicates.txt; test $$? -ne 0 grep "DUPLICATE_SYMBOLS" duplicates.txt; test $$? -ne 0
$(INFER_BIN) -a $(ANALYZER) --cxx --ml-buckets cf --check-duplicate-symbols -o infer-out -- clang $(OPTIONS) $(FILES) >/dev/null 2>duplicates.txt $(call silent_on_success,$(INFER_BIN) -a $(ANALYZER) --cxx --ml-buckets cf --check-duplicate-symbols -o infer-out -- clang $(OPTIONS) $(FILES) 2>duplicates.txt)
grep "DUPLICATE_SYMBOLS" duplicates.txt; test $$? -ne 0 grep "DUPLICATE_SYMBOLS" duplicates.txt; test $$? -ne 0
$(INFER_BIN) -a $(ANALYZER) --cxx --ml-buckets cf --check-duplicate-symbols -o infer-out-arc -- clang $(OPTIONS) -fobjc-arc $(FILES_ARC) >/dev/null 2>duplicates.txt $(call silent_on_success,$(INFER_BIN) -a $(ANALYZER) --cxx --ml-buckets cf --check-duplicate-symbols -o infer-out-arc -- clang $(OPTIONS) -fobjc-arc $(FILES_ARC) 2>duplicates.txt)
grep "DUPLICATE_SYMBOLS" duplicates.txt; test $$? -ne 0 grep "DUPLICATE_SYMBOLS" duplicates.txt; test $$? -ne 0
cp infer-out-all/specs/* infer-out/specs cp infer-out-all/specs/* infer-out/specs
cp infer-out-arc/specs/* infer-out/specs cp infer-out-arc/specs/* infer-out/specs

@ -19,5 +19,5 @@ compile:
clang $(OPTIONS) $(FILES) clang $(OPTIONS) $(FILES)
analyze: analyze:
$(INFER_BIN) -a $(ANALYZER) --check-duplicate-symbols -- clang $(OPTIONS) $(FILES) >/dev/null 2>duplicates.txt $(call silent_on_success,$(INFER_BIN) -a $(ANALYZER) --check-duplicate-symbols -- clang $(OPTIONS) $(FILES) 2>duplicates.txt)
grep "DUPLICATE_SYMBOLS" duplicates.txt; test $$? -ne 0 grep "DUPLICATE_SYMBOLS" duplicates.txt; test $$? -ne 0

@ -18,5 +18,5 @@ compile:
clang $(OPTIONS) $(FILES) clang $(OPTIONS) $(FILES)
analyze: analyze:
$(INFER_BIN) -a $(ANALYZER) --check-duplicate-symbols -- clang $(OPTIONS) $(FILES) >/dev/null 2>duplicates.txt $(call silent_on_success,$(INFER_BIN) -a $(ANALYZER) --check-duplicate-symbols -- clang $(OPTIONS) $(FILES) 2>duplicates.txt)
grep "DUPLICATE_SYMBOLS" duplicates.txt; test $$? -ne 0 grep "DUPLICATE_SYMBOLS" duplicates.txt; test $$? -ne 0

Loading…
Cancel
Save