summary refs log tree commit diff
path: root/src/test/run-make/pretty-expanded-hygiene/Makefile
blob: 11763446437d3f2f5e4cc50a0821dfa0e7280a07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-include ../tools.mk

REPLACEMENT := s/[0-9][0-9]*\#[0-9][0-9]*/$(shell date)/g

all:
	$(RUSTC) -o $(TMPDIR)/input.out --pretty expanded,hygiene input.rs

	# the name/ctxt numbers are very internals-dependent and thus
	# change relatively frequently, and testing for their exact values
	# them will fail annoyingly, so we just check their positions
	# (using a non-constant replacement like this will make it less
	# likely the compiler matches whatever other dummy value we
	# choose).
	#
	# (These need to be out-of-place because OSX/BSD & GNU sed
	# differ.)
	sed "$(REPLACEMENT)" input.pp.rs > $(TMPDIR)/input.pp.rs
	sed "$(REPLACEMENT)" $(TMPDIR)/input.out > $(TMPDIR)/input.out.replaced

	diff -u $(TMPDIR)/input.out.replaced $(TMPDIR)/input.pp.rs