forked from denoland/deno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add test for Linux shared libraries (denoland#18461)
Closes denoland#18266
- Loading branch information
1 parent
795ecfa
commit d0a0ff6
Showing
2 changed files
with
37 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. | ||
|
||
#[cfg(target_os = "linux")] | ||
#[test] | ||
// https://github.com/denoland/deno/issues/18266 | ||
fn linux_shared_libraries() { | ||
use test_util as util; | ||
|
||
const EXPECTED: [&str; 7] = [ | ||
"linux-vdso.so.1", | ||
"libdl.so.2", | ||
"libgcc_s.so.1", | ||
"libpthread.so.0", | ||
"libm.so.6", | ||
"libc.so.6", | ||
"/lib64/ld-linux-x86-64.so.2", | ||
]; | ||
|
||
let ldd = std::process::Command::new("ldd") | ||
.arg("-L") | ||
.arg(util::deno_exe_path()) | ||
.output() | ||
.expect("Failed to execute ldd"); | ||
|
||
let output = std::str::from_utf8(&ldd.stdout).unwrap(); | ||
// Ensure that the output contains only the expected shared libraries. | ||
for line in output.lines().skip(1) { | ||
let path = line.split_whitespace().next().unwrap(); | ||
assert!( | ||
EXPECTED.contains(&path), | ||
"Unexpected shared library: {}", | ||
path | ||
); | ||
} | ||
} |
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