]> git.lizzy.rs Git - rust.git/blob - src/test/run-make-fulldeps/libtest-json/Makefile
Auto merge of #100935 - cuviper:upgrade-android-ci, r=Mark-Simulacrum
[rust.git] / src / test / run-make-fulldeps / libtest-json / Makefile
1 include ../tools.mk
2
3 # Test expected libtest's JSON output
4
5 OUTPUT_FILE_DEFAULT := $(TMPDIR)/libtest-json-output-default.json
6 OUTPUT_FILE_STDOUT_SUCCESS := $(TMPDIR)/libtest-json-output-stdout-success.json
7
8 all: f.rs validate_json.py output-default.json output-stdout-success.json
9         $(RUSTC) --test f.rs
10         RUST_BACKTRACE=0 $(call RUN,f) -Z unstable-options --test-threads=1 --format=json > $(OUTPUT_FILE_DEFAULT) || true
11         RUST_BACKTRACE=0 $(call RUN,f) -Z unstable-options --test-threads=1 --format=json --show-output > $(OUTPUT_FILE_STDOUT_SUCCESS) || true
12
13         cat $(OUTPUT_FILE_DEFAULT) | "$(PYTHON)" validate_json.py
14         cat $(OUTPUT_FILE_STDOUT_SUCCESS) | "$(PYTHON)" validate_json.py
15
16         # Normalize the actual output and compare to expected output file
17         cat $(OUTPUT_FILE_DEFAULT) | sed 's/"exec_time": [0-9.]*/"exec_time": $$TIME/' | diff output-default.json -
18         cat $(OUTPUT_FILE_STDOUT_SUCCESS) | sed 's/"exec_time": [0-9.]*/"exec_time": $$TIME/' | diff output-stdout-success.json -