about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2021-10-21 14:11:06 +0900
committerGitHub <noreply@github.com>2021-10-21 14:11:06 +0900
commita980587421aa25ee382acc9dc577430a77327edd (patch)
tree67a717cab850ced181960ae05ca1ac8b501a7cf6
parentd29e98fe93e60b68cf2bfcd62afa50bedfcc0af3 (diff)
parentaefbd401408769fbca1c486546b8dc3fce9e0d9b (diff)
downloadrust-a980587421aa25ee382acc9dc577430a77327edd.tar.gz
rust-a980587421aa25ee382acc9dc577430a77327edd.zip
Rollup merge of #90029 - tgnottingham:incr-debug-logging-test, r=Mark-Simulacrum
Add test for debug logging during incremental compilation

Debug logging during incremental compilation had been broken for some
time, until #89343 fixed it (among other things). Add a test so this is
less likely to break without being noticed. This test is nearly a copy
of the `src/test/ui/rustc-rust-log.rs` test, but tests debug logging in
the incremental compliation code paths.
-rw-r--r--src/test/incremental/auxiliary/rustc-rust-log-aux.rs8
-rw-r--r--src/test/incremental/rustc-rust-log.rs16
-rw-r--r--src/test/ui/rustc-rust-log.rs5
3 files changed, 25 insertions, 4 deletions
diff --git a/src/test/incremental/auxiliary/rustc-rust-log-aux.rs b/src/test/incremental/auxiliary/rustc-rust-log-aux.rs
new file mode 100644
index 00000000000..a361373dc19
--- /dev/null
+++ b/src/test/incremental/auxiliary/rustc-rust-log-aux.rs
@@ -0,0 +1,8 @@
+// rustc-env:RUSTC_LOG=debug
+#[cfg(rpass1)]
+pub fn foo() {}
+
+#[cfg(rpass2)]
+pub fn foo() {
+    println!();
+}
diff --git a/src/test/incremental/rustc-rust-log.rs b/src/test/incremental/rustc-rust-log.rs
new file mode 100644
index 00000000000..566f0d96d97
--- /dev/null
+++ b/src/test/incremental/rustc-rust-log.rs
@@ -0,0 +1,16 @@
+// revisions: rpass1 rpass2
+// This test is just checking that we won't ICE if logging is turned
+// on; don't bother trying to compare that (copious) output.
+//
+// dont-check-compiler-stdout
+// dont-check-compiler-stderr
+// aux-build: rustc-rust-log-aux.rs
+// rustc-env:RUSTC_LOG=debug
+
+#[cfg(rpass1)]
+fn main() {}
+
+#[cfg(rpass2)]
+fn main() {
+    println!();
+}
diff --git a/src/test/ui/rustc-rust-log.rs b/src/test/ui/rustc-rust-log.rs
index 8ceb24dd2af..52e7dcf4499 100644
--- a/src/test/ui/rustc-rust-log.rs
+++ b/src/test/ui/rustc-rust-log.rs
@@ -1,9 +1,6 @@
 // run-pass
 // This test is just checking that we won't ICE if logging is turned
-// on; don't bother trying to compare that (copious) output. (Note
-// also that this test potentially silly, since we do not build+test
-// debug versions of rustc as part of our continuous integration
-// process...)
+// on; don't bother trying to compare that (copious) output.
 //
 // dont-check-compiler-stdout
 // dont-check-compiler-stderr