Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit de80d1e

Browse files
authoredJun 19, 2024
Rollup merge of rust-lang#126629 - GuillaumeGomez:migrate-run-make-compressed-debuginfo, r=jieyouxu
Migrate `run-make/compressed-debuginfo` to `rmake.rs` Part of rust-lang#121876. r? ```@jieyouxu```
2 parents f0af381 + 62431b7 commit de80d1e

File tree

3 files changed

+36
-15
lines changed

3 files changed

+36
-15
lines changed
 

‎src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ run-make/cdylib-fewer-symbols/Makefile
1313
run-make/compiler-lookup-paths-2/Makefile
1414
run-make/compiler-lookup-paths/Makefile
1515
run-make/compiler-rt-works-on-mingw/Makefile
16-
run-make/compressed-debuginfo/Makefile
1716
run-make/crate-hash-rustc-version/Makefile
1817
run-make/crate-name-priority/Makefile
1918
run-make/cross-lang-lto-clang/Makefile

‎tests/run-make/compressed-debuginfo/Makefile

-14
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Checks the `debuginfo-compression` option.
2+
3+
//@ only-linux
4+
//@ ignore-cross-compile
5+
6+
// FIXME: This test isn't comprehensive and isn't covering all possible combinations.
7+
8+
use run_make_support::{assert_contains, cmd, run_in_tmpdir, rustc};
9+
10+
fn check_compression(compression: &str, to_find: &str) {
11+
run_in_tmpdir(|| {
12+
let out = rustc()
13+
.crate_name("foo")
14+
.crate_type("lib")
15+
.emit("obj")
16+
.arg("-Cdebuginfo=full")
17+
.arg(&format!("-Zdebuginfo-compression={compression}"))
18+
.input("foo.rs")
19+
.run();
20+
let stderr = out.stderr_utf8();
21+
if stderr.is_empty() {
22+
// FIXME: `readelf` might need to be replaced with `llvm-readelf`.
23+
cmd("readelf").arg("-t").arg("foo.o").run().assert_stdout_contains(to_find);
24+
} else {
25+
assert_contains(
26+
&stderr,
27+
&format!("unknown debuginfo compression algorithm {compression}"),
28+
);
29+
}
30+
});
31+
}
32+
33+
fn main() {
34+
check_compression("zlib", "ZLIB");
35+
check_compression("zstd", "ZSTD");
36+
}

0 commit comments

Comments
 (0)
Failed to load comments.