about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJacob Kiesel <jake@bitcrafters.co>2024-09-29 01:22:30 -0600
committerJacob Kiesel <jake@bitcrafters.co>2024-10-01 21:24:07 -0600
commit0069649c3d23282942e44ee9d5d60546ae920070 (patch)
treec0a3eed0de2a89fec47bf6c24ba8ee43c8d80614
parent6fd9ef606f61f3162590ce66e1aa79319b44f2e9 (diff)
downloadrust-0069649c3d23282942e44ee9d5d60546ae920070.tar.gz
rust-0069649c3d23282942e44ee9d5d60546ae920070.zip
Add basic integration test for checksum-hash-algorithm feature
-rw-r--r--tests/run-make/checksum-freshness/expected.d3
-rw-r--r--tests/run-make/checksum-freshness/lib.rs5
-rw-r--r--tests/run-make/checksum-freshness/rmake.rs9
3 files changed, 17 insertions, 0 deletions
diff --git a/tests/run-make/checksum-freshness/expected.d b/tests/run-make/checksum-freshness/expected.d
new file mode 100644
index 00000000000..c79bc8ff7de
--- /dev/null
+++ b/tests/run-make/checksum-freshness/expected.d
@@ -0,0 +1,3 @@
+lib.d: lib.rs # checksum:blake3=5fd6328c93a3360bc580567aec10731ab3e5efc4a0f957b1bba0db0d27af3767 file_len:110
+
+lib.rs:
diff --git a/tests/run-make/checksum-freshness/lib.rs b/tests/run-make/checksum-freshness/lib.rs
new file mode 100644
index 00000000000..c2895dc2613
--- /dev/null
+++ b/tests/run-make/checksum-freshness/lib.rs
@@ -0,0 +1,5 @@
+// A basic library to be used in tests with no real purpose.
+
+pub fn sum(a: i32, b: i32) -> i32 {
+    a + b
+}
diff --git a/tests/run-make/checksum-freshness/rmake.rs b/tests/run-make/checksum-freshness/rmake.rs
new file mode 100644
index 00000000000..071db6b145b
--- /dev/null
+++ b/tests/run-make/checksum-freshness/rmake.rs
@@ -0,0 +1,9 @@
+use run_make_support::{rfs, rustc};
+
+fn main() {
+    rustc().input("lib.rs").arg("-Zchecksum-hash-algorithm=blake3").emit("dep-info").run();
+    let make_file_contents = rfs::read_to_string("lib.d");
+    let expected_contents = rfs::read_to_string("expected.d");
+    assert_eq!(make_file_contents, expected_contents);
+    assert!(!expected_contents.is_empty());
+}