File tree 3 files changed +22
-12
lines changed
3 files changed +22
-12
lines changed Original file line number Diff line number Diff line change 1
1
include ../tools.mk
2
2
3
- ifdef RUSTC_BLESS_TEST
4
- RUSTC_TEST_OP = cp
5
- else
6
- RUSTC_TEST_OP = $(DIFF )
7
- endif
8
-
9
3
all :
10
4
$(RUSTC ) --emit=metadata,dep-info --crate-type lib dash-separated.rs -C extra-filename=_something-extra
11
5
# Strip TMPDIR since it is a machine specific absolute path
Original file line number Diff line number Diff line change 3
3
4
4
include ../tools.mk
5
5
6
- ifdef RUSTC_BLESS_TEST
7
- RUSTC_TEST_OP = cp
8
- else
9
- RUSTC_TEST_OP = $(DIFF )
10
- endif
11
-
12
6
all :
13
7
echo ' "comes from a file with a name that begins with <"' > " $( TMPDIR) /<leading-lt"
14
8
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"
21
21
# diff with common flags for multi-platform diffs against text output
22
22
DIFF := diff -u --strip-trailing-cr
23
23
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
+
24
46
# Some of the Rust CI platforms use `/bin/dash` to run `shell` script in
25
47
# Makefiles. Other platforms, including many developer platforms, default to
26
48
# `/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