Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2259b5264 | ||
|
|
3698e4f899 | ||
|
|
a89ce212d6 | ||
|
|
74195532be | ||
|
|
f62632e7a6 |
@@ -1,5 +1,5 @@
|
||||
import { access, chmod, mkdir, readFile, writeFile } from "node:fs/promises";
|
||||
import { delimiter, join } from "node:path";
|
||||
import { access, chmod, mkdir, writeFile } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
|
||||
import { expect } from "vitest";
|
||||
|
||||
@@ -18,35 +18,11 @@ cliTest.skipIf(!["darwin", "linux"].includes(process.platform))(
|
||||
'#!/bin/sh\nprintf launched > "$REA_HOPPER_TEST_MARKER"\nexit 99\n',
|
||||
);
|
||||
await chmod(launcher, 0o700);
|
||||
const loaderMarker = join(home, "loader-checked-launcher");
|
||||
if (process.platform === "linux") {
|
||||
// A shell fixture needs controlled loader diagnostics on Linux. This
|
||||
// checks discovery and path preservation, not actual Hopper compatibility.
|
||||
const loader = join(home, "bin", "ldd");
|
||||
await writeFile(
|
||||
loader,
|
||||
[
|
||||
"#!/bin/sh",
|
||||
'test "$#" -eq 1 || exit 87',
|
||||
'test "$1" = "$HOPPER_LAUNCHER_PATH" || exit 88',
|
||||
'printf "%s" "$1" > "$REA_HOPPER_LDD_TEST_MARKER"',
|
||||
'printf "%s\\n" "libc.so.6 => /fixture/libc.so.6 (0x1)"',
|
||||
"",
|
||||
].join("\n"),
|
||||
);
|
||||
await chmod(loader, 0o700);
|
||||
}
|
||||
|
||||
const result = await cli.run({
|
||||
arguments: ["doctor", "--provider", "hopper", "--json"],
|
||||
cwd: home,
|
||||
environment: {
|
||||
...(process.platform === "linux"
|
||||
? {
|
||||
PATH: [join(home, "bin"), process.env.PATH ?? ""].join(delimiter),
|
||||
REA_HOPPER_LDD_TEST_MARKER: loaderMarker,
|
||||
}
|
||||
: {}),
|
||||
HOME: home,
|
||||
USERPROFILE: home,
|
||||
HOPPER_LAUNCHER_PATH: launcher,
|
||||
@@ -79,7 +55,5 @@ cliTest.skipIf(!["darwin", "linux"].includes(process.platform))(
|
||||
await expect(access(launchMarker)).rejects.toMatchObject({
|
||||
code: "ENOENT",
|
||||
});
|
||||
if (process.platform === "linux")
|
||||
expect(await readFile(loaderMarker, "utf8")).toBe(launcher);
|
||||
},
|
||||
);
|
||||
Reference in new issue
Block a user