-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #126629 - GuillaumeGomez:migrate-run-make-compressed-…
…debuginfo, r=jieyouxu Migrate `run-make/compressed-debuginfo` to `rmake.rs` Part of #121876. r? ````@jieyouxu````
- Loading branch information
Showing
3 changed files
with
36 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Checks the `debuginfo-compression` option. | ||
|
||
//@ only-linux | ||
//@ ignore-cross-compile | ||
|
||
// FIXME: This test isn't comprehensive and isn't covering all possible combinations. | ||
|
||
use run_make_support::{assert_contains, cmd, run_in_tmpdir, rustc}; | ||
|
||
fn check_compression(compression: &str, to_find: &str) { | ||
run_in_tmpdir(|| { | ||
let out = rustc() | ||
.crate_name("foo") | ||
.crate_type("lib") | ||
.emit("obj") | ||
.arg("-Cdebuginfo=full") | ||
.arg(&format!("-Zdebuginfo-compression={compression}")) | ||
.input("foo.rs") | ||
.run(); | ||
let stderr = out.stderr_utf8(); | ||
if stderr.is_empty() { | ||
// FIXME: `readelf` might need to be replaced with `llvm-readelf`. | ||
cmd("readelf").arg("-t").arg("foo.o").run().assert_stdout_contains(to_find); | ||
} else { | ||
assert_contains( | ||
&stderr, | ||
&format!("unknown debuginfo compression algorithm {compression}"), | ||
); | ||
} | ||
}); | ||
} | ||
|
||
fn main() { | ||
check_compression("zlib", "ZLIB"); | ||
check_compression("zstd", "ZSTD"); | ||
} |