Skip to content

Commit 97b65fa

Browse files
committed
test: fix the mingw setupDir
1 parent c667a3f commit 97b65fa

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

dist/setup_cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup_cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/gcc/__tests__/gcc.test.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { testBin } from "../../utils/tests/test-helpers"
1+
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers"
22
import { setupGcc } from "../gcc"
33
import { getVersion } from "../../default_versions"
44
import path from "path"
@@ -8,9 +8,14 @@ import { chmodSync } from "fs"
88

99
jest.setTimeout(3000000)
1010
describe("setup-gcc", () => {
11+
let directory: string
12+
beforeAll(async () => {
13+
directory = await setupTmpDir("doxygen")
14+
})
15+
1116
it("should setup gcc", async () => {
12-
const version = getVersion("gcc", undefined) || "11"
13-
const installInfo = await setupGcc(version, "", process.arch)
17+
const version = getVersion("gcc", undefined)
18+
const installInfo = await setupGcc(version, directory, process.arch)
1419

1520
let gpp = "g++"
1621
if (process.platform !== "win32") {
@@ -30,4 +35,8 @@ describe("setup-gcc", () => {
3035
}
3136
execa.sync(main_exe, { cwd: __dirname, stdio: "inherit" })
3237
})
38+
39+
afterAll(async () => {
40+
await cleanupTmpDir("doxygen")
41+
}, 100000)
3342
})

src/gcc/__tests__/main.exe

111 KB
Binary file not shown.

src/gcc/gcc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function getGccPackageInfo(version: string, platform: NodeJS.Platform, arch: str
4444
const mingwArch = arch === "ia32" ? "i686" : "x86_64"
4545
const exceptionModel: "seh" | "dwarf" = "seh" // SEH is native windows exception model https://github.com/brechtsanders/winlibs_mingw/issues/4#issuecomment-599296483
4646
return {
47-
binRelativeDir: "./bin",
47+
binRelativeDir: "bin/",
4848
binFileName: addBinExtension("g++"),
4949
extractedFolderName: "mingw64",
5050
extractFunction: extract7Zip,

0 commit comments

Comments
 (0)