From e611f0e8b3ba495b65dc911b4daf1d22f37bf014 Mon Sep 17 00:00:00 2001 From: Sungkeun Cho Date: Tue, 9 Jun 2020 04:55:32 -0700 Subject: [PATCH] [infer] Fix empty `issues.exp.test` on Ant build test Summary: There was an issue on `make build_ant_test` that newly generated `issues.exp.test` is empty. When infer runs with `-- ant`, if there is already built objects in `ant_out`, infer analyzes nothing, which result in the empty `issues.exp.test`. For example, ``` ~/infer/infer/tests/build_systems/ant$ make test [11:26:49][36924] Testing ant integration... [ 2s][36924] SUCCESS Testing ant integration ~/infer/infer/tests/build_systems/ant$ touch `which infer` ``` The makefile tries to reanalyze ant targets because `infer` binary has been changed. However, there is nothing to build/analyze, since `ant_out` still exists as the same. ``` ~/infer/infer/tests/build_systems/ant$ make test [11:26:57][37078] Testing ant integration... [ 1s][37078] SUCCESS Testing ant integration diff --git a/Users/scho/infer/infer/tests/build_systems/ant/issues.exp b/Users/scho/infer/infer/tests/build_systems/ant/issues.exp.test index 376146b5f..e69de29bb 100644 --- a/Users/scho/infer/infer/tests/build_systems/ant/issues.exp +++ b/Users/scho/infer/infer/tests/build_systems/ant/issues.exp.test @@ -1 +0,0 @@ [-build_systems/ant/src/Hello.java, Hello.test():int, 2, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure test()]-] Test output (build_systems/ant/issues.exp.test) differs from expected test output build_systems/ant/issues.exp Run the following command to replace the expected test output with the new output: make -C build_systems/ant replace make: *** [test] Error 1 ``` To handle this issue, this cleans `ant_out` before running infer. Reviewed By: jvillard Differential Revision: D21950916 fbshipit-source-id: f57056f6e --- infer/tests/build_systems/ant/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infer/tests/build_systems/ant/Makefile b/infer/tests/build_systems/ant/Makefile index 175fd1065..61cbc6cfd 100644 --- a/infer/tests/build_systems/ant/Makefile +++ b/infer/tests/build_systems/ant/Makefile @@ -19,4 +19,4 @@ $(OBJECTS): $(SOURCES) infer-out/report.json: $(JAVA_DEPS) $(SOURCES) $(QUIET)$(call silent_on_success,Testing ant integration,\ - $(INFER_BIN) --project-root $(TESTS_DIR) -- $(ANT)) + $(ANT) clean && $(INFER_BIN) --project-root $(TESTS_DIR) -- $(ANT))