[tests] run "diff" from infer/tests

Summary:
Without this it's not always obvious which test fails. It also makes it easier
to mass-patch test failures from the CI jobs to replace expected outputs with
actual outputs (eg, when debugging osx frontend tests from linux).

Reviewed By: jberdine

Differential Revision: D4352205

fbshipit-source-id: 8887d7b
master
Jules Villard 8 years ago committed by Facebook Github Bot
parent d20c8a0222
commit 72d065017b

@ -142,6 +142,10 @@ direct_tests: $(DIRECT_TESTS:%=direct_%_test)
build_genrule_test: build_buck_test
build_genrule_print: build_buck_print
# the waf test and the make test run the same `make` command
build_waf_test: build_make_test
build_waf_print: build_make_print
.PHONY: print_direct_tests
print_direct_tests: $(DIRECT_TESTS:%=direct_%_print)

@ -7,6 +7,11 @@
ROOT_DIR = $(TESTS_DIR)/../..
# The relative path from infer/tests/ to the directory containing the current Makefile. This is
# computed in a hacky way and might not always be a relative path, so only use this for cosmetic
# reasons.
TEST_REL_DIR = $(patsubst $(abspath $(TESTS_DIR))/%,%,$(abspath $(CURDIR)))
include $(ROOT_DIR)/Makefile.config
default: compile
@ -25,7 +30,8 @@ print: issues.exp.test$(TEST_SUFFIX)
.PHONY: test
test: issues.exp.test$(TEST_SUFFIX)
diff -u issues.exp issues.exp.test$(TEST_SUFFIX)
@cd $(TESTS_DIR) && \
diff -u $(TEST_REL_DIR)/issues.exp $(TEST_REL_DIR)/issues.exp.test$(TEST_SUFFIX)
.PHONY: clean
clean:

@ -22,6 +22,9 @@ ROOT_DIR = $(TESTS_DIR)/../..
include $(ROOT_DIR)/Makefile.config
# see base.make
TEST_REL_DIR = $(patsubst $(abspath $(TESTS_DIR))/%,%,$(abspath $(CURDIR)))
default: compile
issues.exp.test: $(CLANG_DEPS) $(SOURCES)
@ -37,7 +40,8 @@ print: issues.exp.test
.PHONY: test
test: issues.exp.test
diff -u issues.exp issues.exp.test
@cd $(TESTS_DIR) && \
diff -u $(TEST_REL_DIR)/issues.exp $(TEST_REL_DIR)/issues.exp.test
.PHONY: clean
clean:

@ -15,6 +15,9 @@ ROOT_DIR = $(TESTS_DIR)/../..
include $(TESTS_DIR)/java.make
include $(ROOT_DIR)/Makefile.config
# see base.make
TEST_REL_DIR = $(patsubst $(abspath $(TESTS_DIR))/%,%,$(abspath $(CURDIR)))
UTF8_DIR = $(shell printf '../codetoanalyze/utf8_\u03B9n_pwd')
CMAKE_DIR = $(UTF8_DIR)/cmake
@ -102,7 +105,8 @@ print: issues.exp.test
.PHONY: test
test: issues.exp.test
diff -u issues.exp issues.exp.test
@cd $(TESTS_DIR) && \
diff -u $(TEST_REL_DIR)/issues.exp $(TEST_REL_DIR)/issues.exp.test
.PHONY: clean
clean:

@ -8,6 +8,9 @@
TESTS_DIR = ../../..
include $(TESTS_DIR)/java.make
# see base.make
TEST_REL_DIR = $(patsubst $(abspath $(TESTS_DIR))/%,%,$(abspath $(CURDIR)))
ANALYZER = crashcontext
SOURCES = $(wildcard *.java)
@ -43,7 +46,8 @@ print: issues.exp.test
.PHONY: test
test: issues.exp.test
diff -u issues.exp issues.exp.test
@cd $(TESTS_DIR) && \
diff -u $(TEST_REL_DIR)/issues.exp $(TEST_REL_DIR)/issues.exp.test
.PHONY: clean
clean:

Loading…
Cancel
Save