diff options
author | Andrew Nester <andrew.nester.dev@gmail.com> | 2023-03-28 11:00:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-28 09:00:19 +0000 |
commit | d0a0ff680eb02dddb7cea06fa0e26ecd08eab00a (patch) | |
tree | 6c58afa6974e44c903a716ca0b738cc6dc144693 /cli/tests/integration/linux_tests.rs | |
parent | 795ecfa146c7b6c49be4b11f7064b2b5500296ff (diff) |
chore: add test for Linux shared libraries (#18461)
Closes #18266
Diffstat (limited to 'cli/tests/integration/linux_tests.rs')
-rw-r--r-- | cli/tests/integration/linux_tests.rs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/cli/tests/integration/linux_tests.rs b/cli/tests/integration/linux_tests.rs new file mode 100644 index 000000000..c12454e23 --- /dev/null +++ b/cli/tests/integration/linux_tests.rs @@ -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 + ); + } +} |