diff --git a/Makefile.config.in b/Makefile.config.in index 70d5535eb..7606f68ac 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -125,3 +125,7 @@ CLANG_DEPS = $(addprefix $(PYTHON_LIB_DIR)/, \ $(INFERPRINT_BIN) JAVA_MODELS_JAR = $(LIB_DIR)/java/models.jar + +define silent_on_success + $(1) >/dev/null 2>/dev/null || ($(1) && exit 1) +endef diff --git a/infer/tests/codetoanalyze/c/errors/Makefile b/infer/tests/codetoanalyze/c/errors/Makefile index 903f50f24..1616b1d96 100644 --- a/infer/tests/codetoanalyze/c/errors/Makefile +++ b/infer/tests/codetoanalyze/c/errors/Makefile @@ -17,5 +17,5 @@ compile: analyze: 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 diff --git a/infer/tests/codetoanalyze/cpp/errors/Makefile b/infer/tests/codetoanalyze/cpp/errors/Makefile index 1e0aa33ce..3ee736ad7 100644 --- a/infer/tests/codetoanalyze/cpp/errors/Makefile +++ b/infer/tests/codetoanalyze/cpp/errors/Makefile @@ -61,5 +61,5 @@ compile: clang $(OPTIONS) $(FILES) 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 diff --git a/infer/tests/codetoanalyze/java/checkers/Makefile b/infer/tests/codetoanalyze/java/checkers/Makefile index a5db2f7ca..352a57fd1 100644 --- a/infer/tests/codetoanalyze/java/checkers/Makefile +++ b/infer/tests/codetoanalyze/java/checkers/Makefile @@ -27,4 +27,4 @@ compile: javac -cp $(CLASSPATH) $(FILES) 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)) diff --git a/infer/tests/codetoanalyze/java/crashcontext/Makefile b/infer/tests/codetoanalyze/java/crashcontext/Makefile index 49d570062..a80e77f3a 100644 --- a/infer/tests/codetoanalyze/java/crashcontext/Makefile +++ b/infer/tests/codetoanalyze/java/crashcontext/Makefile @@ -24,7 +24,7 @@ compile: analyze: 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 ; \ done diff --git a/infer/tests/codetoanalyze/java/eradicate/Makefile b/infer/tests/codetoanalyze/java/eradicate/Makefile index 211d22dc1..21d07cdf5 100644 --- a/infer/tests/codetoanalyze/java/eradicate/Makefile +++ b/infer/tests/codetoanalyze/java/eradicate/Makefile @@ -29,4 +29,4 @@ compile: analyze: 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)) diff --git a/infer/tests/codetoanalyze/java/harness/Makefile b/infer/tests/codetoanalyze/java/harness/Makefile index 451801763..7ffc46913 100644 --- a/infer/tests/codetoanalyze/java/harness/Makefile +++ b/infer/tests/codetoanalyze/java/harness/Makefile @@ -16,4 +16,4 @@ compile: javac -cp $(CLASSPATH) $(FILES) 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)) diff --git a/infer/tests/codetoanalyze/java/infer/Makefile b/infer/tests/codetoanalyze/java/infer/Makefile index 446d59445..99f37e870 100644 --- a/infer/tests/codetoanalyze/java/infer/Makefile +++ b/infer/tests/codetoanalyze/java/infer/Makefile @@ -43,4 +43,4 @@ compile: javac -cp $(CLASSPATH) $(FILES) 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)) diff --git a/infer/tests/codetoanalyze/java/quandary/Makefile b/infer/tests/codetoanalyze/java/quandary/Makefile index 3b8e654b5..e5c4d8a88 100644 --- a/infer/tests/codetoanalyze/java/quandary/Makefile +++ b/infer/tests/codetoanalyze/java/quandary/Makefile @@ -25,4 +25,4 @@ compile: javac -cp $(CLASSPATH) $(FILES) 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)) diff --git a/infer/tests/codetoanalyze/java/tracing/Makefile b/infer/tests/codetoanalyze/java/tracing/Makefile index 997b25d80..b057168dd 100644 --- a/infer/tests/codetoanalyze/java/tracing/Makefile +++ b/infer/tests/codetoanalyze/java/tracing/Makefile @@ -39,4 +39,4 @@ compile: javac -cp $(CLASSPATH) $(FILES) 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)) diff --git a/infer/tests/codetoanalyze/objc/errors/Makefile b/infer/tests/codetoanalyze/objc/errors/Makefile index 7da08178f..6a22e7c02 100644 --- a/infer/tests/codetoanalyze/objc/errors/Makefile +++ b/infer/tests/codetoanalyze/objc/errors/Makefile @@ -99,11 +99,11 @@ compile: CLEAN_EXTRA = infer-out-arc infer-out-all 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 - $(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 - $(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 cp infer-out-all/specs/* infer-out/specs cp infer-out-arc/specs/* infer-out/specs diff --git a/infer/tests/codetoanalyze/objc/linters/Makefile b/infer/tests/codetoanalyze/objc/linters/Makefile index 501cce324..f8b65bff9 100644 --- a/infer/tests/codetoanalyze/objc/linters/Makefile +++ b/infer/tests/codetoanalyze/objc/linters/Makefile @@ -19,5 +19,5 @@ compile: clang $(OPTIONS) $(FILES) 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 diff --git a/infer/tests/codetoanalyze/objcpp/linters/Makefile b/infer/tests/codetoanalyze/objcpp/linters/Makefile index 117de2151..59ac64e32 100644 --- a/infer/tests/codetoanalyze/objcpp/linters/Makefile +++ b/infer/tests/codetoanalyze/objcpp/linters/Makefile @@ -18,5 +18,5 @@ compile: clang $(OPTIONS) $(FILES) 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