mirror of https://github.com/aminya/setup-cpp
fix: fix the version check for vcpkg
This commit is contained in:
parent
040d33199e
commit
7e559c044f
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,20 +1,28 @@
|
||||||
import { setupTmpDir, testBin } from "../../utils/tests/test-helpers"
|
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers"
|
||||||
import { setupVcpkg } from "../vcpkg"
|
import { setupVcpkg } from "../vcpkg"
|
||||||
|
|
||||||
jest.setTimeout(300000)
|
jest.setTimeout(300000)
|
||||||
async function testVcpkg(directory: string) {
|
|
||||||
const { binDir } = await setupVcpkg("", directory, "")
|
|
||||||
await testBin("vcpkg", ["--version"], binDir)
|
|
||||||
return binDir
|
|
||||||
}
|
|
||||||
|
|
||||||
describe("setup-vcpkg", () => {
|
describe("setup-vcpkg", () => {
|
||||||
let directory: string
|
let directory: string
|
||||||
beforeAll(async () => {
|
beforeEach(async () => {
|
||||||
directory = await setupTmpDir("vcpkg")
|
directory = await setupTmpDir("vcpkg")
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should setup vcpkg", async () => {
|
it("should setup vcpkg", async () => {
|
||||||
await testVcpkg(directory)
|
console.log(!("true" in ["", "true"]))
|
||||||
|
const { binDir } = await setupVcpkg("", directory, "")
|
||||||
|
await testBin("vcpkg", ["--version"], binDir)
|
||||||
|
return binDir
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should setup vcpkg with specific version", async () => {
|
||||||
|
const { binDir } = await setupVcpkg("e590c2b30c08caf1dd8d612ec602a003f9784b7d", directory, "")
|
||||||
|
await testBin("vcpkg", ["--version"], binDir)
|
||||||
|
return binDir
|
||||||
|
})
|
||||||
|
|
||||||
|
afterEach(async () => {
|
||||||
|
await cleanupTmpDir(directory)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -58,7 +58,7 @@ export async function setupVcpkg(version: string, setupDir: string, _arch: strin
|
||||||
}
|
}
|
||||||
|
|
||||||
// if version specified, checkout the version
|
// if version specified, checkout the version
|
||||||
if (!(version in ["", "true"])) {
|
if (version !== "" && version !== "true") {
|
||||||
info(`Checking out vcpkg version ${version}`)
|
info(`Checking out vcpkg version ${version}`)
|
||||||
execaSync("git", ["checkout", version], {
|
execaSync("git", ["checkout", version], {
|
||||||
cwd: setupDir,
|
cwd: setupDir,
|
||||||
|
|
Loading…
Reference in New Issue