File tree Expand file tree Collapse file tree 3 files changed +22
-12
lines changed Expand file tree Collapse file tree 3 files changed +22
-12
lines changed Original file line number Diff line number Diff line change 11include ../tools.mk
22
3- ifdef RUSTC_BLESS_TEST
4- RUSTC_TEST_OP = cp
5- else
6- RUSTC_TEST_OP = $(DIFF )
7- endif
8-
93all :
104 $(RUSTC ) --emit=metadata,dep-info --crate-type lib dash-separated.rs -C extra-filename=_something-extra
115 # Strip TMPDIR since it is a machine specific absolute path
Original file line number Diff line number Diff line change 33
44include ../tools.mk
55
6- ifdef RUSTC_BLESS_TEST
7- RUSTC_TEST_OP = cp
8- else
9- RUSTC_TEST_OP = $(DIFF )
10- endif
11-
126all :
137 echo ' "comes from a file with a name that begins with <"' > " $( TMPDIR) /<leading-lt"
148 echo ' "comes from a file with a name that ends with >"' > " $( TMPDIR) /trailing-gt>"
Original file line number Diff line number Diff line change @@ -21,6 +21,28 @@ CGREP := "$(S)/src/etc/cat-and-grep.sh"
2121# diff with common flags for multi-platform diffs against text output
2222DIFF := diff -u --strip-trailing-cr
2323
24+ # With RUSTC_TEST_OP you can elegantly support blessing of run-make tests. Do
25+ # like this in a Makefile recipe:
26+ #
27+ # "$(TMPDIR)"/your-test > "$(TMPDIR)"/your-test.run.stdout
28+ # $(RUSTC_TEST_OP) "$(TMPDIR)"/your-test.run.stdout your-test.run.stdout
29+ #
30+ # When running the test normally with
31+ #
32+ # ./x test tests/run-make/your-test
33+ #
34+ # the actual output will be diffed against the expected output. When running in
35+ # bless-mode with
36+ #
37+ # ./x test --bless tests/run-make/your-test
38+ #
39+ # the actual output will be blessed as the expected output.
40+ ifdef RUSTC_BLESS_TEST
41+ RUSTC_TEST_OP = cp
42+ else
43+ RUSTC_TEST_OP = $(DIFF )
44+ endif
45+
2446# Some of the Rust CI platforms use `/bin/dash` to run `shell` script in
2547# Makefiles. Other platforms, including many developer platforms, default to
2648# `/bin/bash`. (In many cases, `make` is actually using `/bin/sh`, but `sh`
You can’t perform that action at this time.
0 commit comments