From a4a7bb9a3f72505efb6ca9856af45287c8685d5e Mon Sep 17 00:00:00 2001 From: Matthew Jasper Date: Mon, 15 Jul 2019 22:26:45 +0100 Subject: [PATCH] Make pretty-expanded-hygiene a `ui` test `normalize-stdout-test` removes the need for Make, and it can be updated with `--bless` this way --- .../pretty-expanded-hygiene/Makefile | 21 ------------------- .../input.rs => ui/hygiene/unpretty-debug.rs} | 6 ++++++ .../hygiene/unpretty-debug.stdout} | 6 ++++++ 3 files changed, 12 insertions(+), 21 deletions(-) delete mode 100644 src/test/run-make-fulldeps/pretty-expanded-hygiene/Makefile rename src/test/{run-make-fulldeps/pretty-expanded-hygiene/input.rs => ui/hygiene/unpretty-debug.rs} (50%) rename src/test/{run-make-fulldeps/pretty-expanded-hygiene/input.pp.rs => ui/hygiene/unpretty-debug.stdout} (59%) diff --git a/src/test/run-make-fulldeps/pretty-expanded-hygiene/Makefile b/src/test/run-make-fulldeps/pretty-expanded-hygiene/Makefile deleted file mode 100644 index 136d7643ade37..0000000000000 --- a/src/test/run-make-fulldeps/pretty-expanded-hygiene/Makefile +++ /dev/null @@ -1,21 +0,0 @@ --include ../tools.mk - -REPLACEMENT := s/[0-9][0-9]*\#[0-9][0-9]*/$(shell date)/g - -all: - $(RUSTC) -o $(TMPDIR)/input.out -Z unstable-options \ - --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 diff --git a/src/test/run-make-fulldeps/pretty-expanded-hygiene/input.rs b/src/test/ui/hygiene/unpretty-debug.rs similarity index 50% rename from src/test/run-make-fulldeps/pretty-expanded-hygiene/input.rs rename to src/test/ui/hygiene/unpretty-debug.rs index ed3b48dbdc114..6e936bb3d830c 100644 --- a/src/test/run-make-fulldeps/pretty-expanded-hygiene/input.rs +++ b/src/test/ui/hygiene/unpretty-debug.rs @@ -1,3 +1,9 @@ +// check-pass +// compile-flags: -Zunpretty=expanded,hygiene + +// Don't break whenever Symbol numbering changes +// normalize-stdout-test "\d+#" -> "0#" + // minimal junk #![feature(no_core)] #![no_core] diff --git a/src/test/run-make-fulldeps/pretty-expanded-hygiene/input.pp.rs b/src/test/ui/hygiene/unpretty-debug.stdout similarity index 59% rename from src/test/run-make-fulldeps/pretty-expanded-hygiene/input.pp.rs rename to src/test/ui/hygiene/unpretty-debug.stdout index 570dece023dea..beac4c17abf9c 100644 --- a/src/test/run-make-fulldeps/pretty-expanded-hygiene/input.pp.rs +++ b/src/test/ui/hygiene/unpretty-debug.stdout @@ -1,3 +1,9 @@ +// check-pass +// compile-flags: -Zunpretty=expanded,hygiene + +// Don't break whenever Symbol numbering changes +// normalize-stdout-test "\d+#" -> "0#" + // minimal junk #![feature /* 0#0 */(no_core)] #![no_core /* 0#0 */]