about summary refs log tree commit diff
path: root/tests/run-make/version-verbose-commit-hash
diff options
context:
space:
mode:
authorOneirical <manchot@videotron.ca>2024-07-16 13:24:19 -0400
committerOneirical <manchot@videotron.ca>2024-07-22 10:12:00 -0400
commit8990df7d13871b388cbb51add034eb301e68956b (patch)
treeceb71448ac3812ae9c66f772671042d767158399 /tests/run-make/version-verbose-commit-hash
parent613a7a79e7ce7f733e622040d45e392c159d13e3 (diff)
rewrite and rename issue-107094 to rmake
Diffstat (limited to 'tests/run-make/version-verbose-commit-hash')
-rw-r--r--tests/run-make/version-verbose-commit-hash/rmake.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/run-make/version-verbose-commit-hash/rmake.rs b/tests/run-make/version-verbose-commit-hash/rmake.rs
new file mode 100644
index 00000000000..733c0e2cdb1
--- /dev/null
+++ b/tests/run-make/version-verbose-commit-hash/rmake.rs
@@ -0,0 +1,20 @@
+// `--version --verbose` should display the git-commit hashes of rustc and rustdoc, but this
+// functionality was lost due to #104184. After this feature was returned by #109981, this
+// test ensures it will not be broken again.
+// See https://github.com/rust-lang/rust/issues/107094
+
+//@ needs-git-hash
+
+use run_make_support::{bare_rustc, bare_rustdoc, regex};
+
+fn main() {
+    let out_rustc =
+        bare_rustc().arg("--version").arg("--verbose").run().stdout_utf8().to_lowercase();
+    let out_rustdoc =
+        bare_rustdoc().arg("--version").arg("--verbose").run().stdout_utf8().to_lowercase();
+    let re =
+        regex::Regex::new(r#"commit-hash: [0-9a-f]{40}\ncommit-date: [0-9]{4}-[0-9]{2}-[0-9]{2}"#)
+            .unwrap();
+    assert!(re.is_match(&out_rustc));
+    assert!(re.is_match(&out_rustdoc));
+}