mirror of https://github.com/aminya/setup-cpp
test: simplify cmake test
This commit is contained in:
parent
b492a11246
commit
0705a52b46
|
@ -2,11 +2,6 @@ import { setupCmake } from "../cmake"
|
||||||
import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-helpers"
|
import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-helpers"
|
||||||
|
|
||||||
jest.setTimeout(200000)
|
jest.setTimeout(200000)
|
||||||
async function testCmake(directory: string) {
|
|
||||||
const { binDir } = await setupCmake("3.20.2", directory, "")
|
|
||||||
await testBin("cmake", ["--version"], binDir)
|
|
||||||
return binDir
|
|
||||||
}
|
|
||||||
|
|
||||||
describe("setup-cmake", () => {
|
describe("setup-cmake", () => {
|
||||||
let directory: string
|
let directory: string
|
||||||
|
@ -15,11 +10,13 @@ describe("setup-cmake", () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should setup CMake", async () => {
|
it("should setup CMake", async () => {
|
||||||
await testCmake(directory)
|
const { binDir } = await setupCmake("3.20.2", directory, "")
|
||||||
|
await testBin("cmake", ["--version"], binDir)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should find CMake in the cache", async () => {
|
it("should find CMake in the cache", async () => {
|
||||||
const binDir = await testCmake(directory)
|
const { binDir } = await setupCmake("3.20.2", directory, "")
|
||||||
|
await testBin("cmake", ["--version"], binDir)
|
||||||
expect(binDir.includes("ToolCache")).toBeTruthy()
|
expect(binDir.includes("ToolCache")).toBeTruthy()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,4 @@ export async function testBin(name: string, args: string[] = ["--version"], binD
|
||||||
expect(status).toBe(0)
|
expect(status).toBe(0)
|
||||||
|
|
||||||
expect(await io.which(name, true)).toBe(bin)
|
expect(await io.which(name, true)).toBe(bin)
|
||||||
|
|
||||||
return binDir
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue