mirror of https://github.com/aminya/setup-cpp
test: test the default versions in the tests
This commit is contained in:
parent
00c79834f7
commit
09cdd6608c
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,7 @@
|
||||||
import { setupCmake } from "../cmake"
|
import { setupCmake } from "../cmake"
|
||||||
import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-helpers"
|
import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-helpers"
|
||||||
import { isGitHubCI } from "../../utils/env/isci"
|
import { isGitHubCI } from "../../utils/env/isci"
|
||||||
|
import { getVersion } from "../../default_versions"
|
||||||
|
|
||||||
jest.setTimeout(300000)
|
jest.setTimeout(300000)
|
||||||
|
|
||||||
|
@ -11,12 +12,12 @@ describe("setup-cmake", () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should setup CMake", async () => {
|
it("should setup CMake", async () => {
|
||||||
const { binDir } = await setupCmake("3.20.2", directory, process.arch)
|
const { binDir } = await setupCmake(getVersion("cmake", "true"), directory, process.arch)
|
||||||
await testBin("cmake", ["--version"], binDir)
|
await testBin("cmake", ["--version"], binDir)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should find CMake in the cache", async () => {
|
it("should find CMake in the cache", async () => {
|
||||||
const { binDir } = await setupCmake("3.20.2", directory, process.arch)
|
const { binDir } = await setupCmake(getVersion("cmake", "true"), directory, process.arch)
|
||||||
await testBin("cmake", ["--version"], binDir)
|
await testBin("cmake", ["--version"], binDir)
|
||||||
if (isGitHubCI()) {
|
if (isGitHubCI()) {
|
||||||
expect(binDir).toMatch(process.env.RUNNER_TOOL_CACHE ?? "hostedtoolcache")
|
expect(binDir).toMatch(process.env.RUNNER_TOOL_CACHE ?? "hostedtoolcache")
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
import { setupConan } from "../conan"
|
import { setupConan } from "../conan"
|
||||||
import { testBin } from "../../utils/tests/test-helpers"
|
import { testBin } from "../../utils/tests/test-helpers"
|
||||||
|
import { getVersion } from "../../default_versions"
|
||||||
|
|
||||||
jest.setTimeout(300000)
|
jest.setTimeout(300000)
|
||||||
describe("setup-conan", () => {
|
describe("setup-conan", () => {
|
||||||
it("should setup conan", async () => {
|
it("should setup conan", async () => {
|
||||||
const installInfo = await setupConan("", "", process.arch)
|
const installInfo = await setupConan(getVersion("conan", "true"), "", process.arch)
|
||||||
|
|
||||||
await testBin("conan", ["--version"], installInfo.binDir)
|
await testBin("conan", ["--version"], installInfo.binDir)
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
import { setupGcovr } from "../gcovr"
|
import { setupGcovr } from "../gcovr"
|
||||||
import { testBin } from "../../utils/tests/test-helpers"
|
import { testBin } from "../../utils/tests/test-helpers"
|
||||||
|
import { getVersion } from "../../default_versions"
|
||||||
|
|
||||||
jest.setTimeout(300000)
|
jest.setTimeout(300000)
|
||||||
describe("setup-gcovr", () => {
|
describe("setup-gcovr", () => {
|
||||||
it("should setup gcovr", async () => {
|
it("should setup gcovr", async () => {
|
||||||
const installInfo = await setupGcovr("", "", process.arch)
|
const installInfo = await setupGcovr(getVersion("gcovr", "true"), "", process.arch)
|
||||||
await testBin("gcovr", ["--version"], installInfo.binDir)
|
await testBin("gcovr", ["--version"], installInfo.binDir)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { setupKcov } from "../kcov"
|
import { setupKcov } from "../kcov"
|
||||||
import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-helpers"
|
import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-helpers"
|
||||||
import { InstallationInfo } from "../../utils/setup/setupBin"
|
import { InstallationInfo } from "../../utils/setup/setupBin"
|
||||||
|
import { getVersion } from "../../default_versions"
|
||||||
|
|
||||||
jest.setTimeout(300000)
|
jest.setTimeout(300000)
|
||||||
async function testKcov(version: string, directory: string) {
|
async function testKcov(version: string, directory: string) {
|
||||||
|
@ -15,10 +16,12 @@ describe("setup-Kcov", () => {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
it("should setup Kcov v39", async () => {
|
it("should setup Kcov", async () => {
|
||||||
const directory = await setupTmpDir("kcov-v39")
|
const version = getVersion("kcov", "true")
|
||||||
await testKcov("v39", directory)
|
|
||||||
await cleanupTmpDir("kcov-v39")
|
const directory = await setupTmpDir(`kcov-${version}`)
|
||||||
|
await testKcov(version, directory)
|
||||||
|
await cleanupTmpDir(`kcov-${version}`)
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
|
@ -7,6 +7,7 @@ import execa from "execa"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
import { addBinExtension } from "../../utils/extension/extension"
|
import { addBinExtension } from "../../utils/extension/extension"
|
||||||
import { chmodSync } from "fs"
|
import { chmodSync } from "fs"
|
||||||
|
import { getVersion } from "../../default_versions"
|
||||||
|
|
||||||
jest.setTimeout(400000)
|
jest.setTimeout(400000)
|
||||||
async function testUrl(version: string) {
|
async function testUrl(version: string) {
|
||||||
|
@ -26,6 +27,7 @@ describe("setup-llvm", () => {
|
||||||
it("Finds valid LLVM URLs", async () => {
|
it("Finds valid LLVM URLs", async () => {
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
[
|
[
|
||||||
|
"14.0.1",
|
||||||
"14.0.0",
|
"14.0.0",
|
||||||
"13.0.0",
|
"13.0.0",
|
||||||
"12.0.0",
|
"12.0.0",
|
||||||
|
@ -49,7 +51,7 @@ describe("setup-llvm", () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should setup LLVM", async () => {
|
it("should setup LLVM", async () => {
|
||||||
const { binDir } = await setupLLVM("13.0.0", directory, process.arch)
|
const { binDir } = await setupLLVM(getVersion("llvm", "true"), directory, process.arch)
|
||||||
await testBin("clang++", ["--version"], binDir)
|
await testBin("clang++", ["--version"], binDir)
|
||||||
|
|
||||||
expect(process.env.CC?.includes("clang")).toBeTruthy()
|
expect(process.env.CC?.includes("clang")).toBeTruthy()
|
||||||
|
@ -66,7 +68,7 @@ describe("setup-llvm", () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should find llvm in the cache", async () => {
|
it("should find llvm in the cache", async () => {
|
||||||
const { binDir } = await setupLLVM("13.0.0", directory, process.arch)
|
const { binDir } = await setupLLVM(getVersion("llvm", "true"), directory, process.arch)
|
||||||
await testBin("clang++", ["--version"], binDir)
|
await testBin("clang++", ["--version"], binDir)
|
||||||
|
|
||||||
if (isGitHubCI()) {
|
if (isGitHubCI()) {
|
||||||
|
@ -83,7 +85,7 @@ describe("setup-llvm", () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should setup clang-tidy and clang-format", async () => {
|
it("should setup clang-tidy and clang-format", async () => {
|
||||||
const { binDir } = await setupClangTools("13.0.0", directory, process.arch)
|
const { binDir } = await setupClangTools(getVersion("llvm", "true"), directory, process.arch)
|
||||||
await testBin("clang-tidy", ["--version"], binDir)
|
await testBin("clang-tidy", ["--version"], binDir)
|
||||||
await testBin("clang-format", ["--version"], binDir)
|
await testBin("clang-format", ["--version"], binDir)
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
import { setupMeson } from "../meson"
|
import { setupMeson } from "../meson"
|
||||||
import { testBin } from "../../utils/tests/test-helpers"
|
import { testBin } from "../../utils/tests/test-helpers"
|
||||||
|
import { getVersion } from "../../default_versions"
|
||||||
|
|
||||||
jest.setTimeout(300000)
|
jest.setTimeout(300000)
|
||||||
describe("setup-meson", () => {
|
describe("setup-meson", () => {
|
||||||
it("should setup meson", async () => {
|
it("should setup meson", async () => {
|
||||||
const installInfo = await setupMeson("", "", process.arch)
|
const installInfo = await setupMeson(getVersion("meson", "true"), "", process.arch)
|
||||||
|
|
||||||
await testBin("meson", ["--version"], installInfo.binDir)
|
await testBin("meson", ["--version"], installInfo.binDir)
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
import { setupNinja } from "../ninja"
|
import { setupNinja } from "../ninja"
|
||||||
import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-helpers"
|
import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-helpers"
|
||||||
import { isGitHubCI } from "../../utils/env/isci"
|
import { isGitHubCI } from "../../utils/env/isci"
|
||||||
|
import { getVersion } from "../../default_versions"
|
||||||
|
|
||||||
jest.setTimeout(300000)
|
jest.setTimeout(300000)
|
||||||
async function testNinja(directory: string) {
|
async function testNinja(directory: string) {
|
||||||
const { binDir } = await setupNinja("1.10.2", directory, process.arch)
|
const { binDir } = await setupNinja(getVersion("ninja", "true"), directory, process.arch)
|
||||||
await testBin("ninja", ["--version"], binDir)
|
await testBin("ninja", ["--version"], binDir)
|
||||||
return binDir
|
return binDir
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { setupTask } from "../task"
|
import { setupTask } from "../task"
|
||||||
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers"
|
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers"
|
||||||
import { isGitHubCI } from "../../utils/env/isci"
|
import { isGitHubCI } from "../../utils/env/isci"
|
||||||
|
import { getVersion } from "../../default_versions"
|
||||||
|
|
||||||
jest.setTimeout(300000)
|
jest.setTimeout(300000)
|
||||||
describe("setup-task", () => {
|
describe("setup-task", () => {
|
||||||
|
@ -10,13 +11,13 @@ describe("setup-task", () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should setup task", async () => {
|
it("should setup task", async () => {
|
||||||
const { binDir } = await setupTask("3.10.0", directory, process.arch)
|
const { binDir } = await setupTask(getVersion("task", "true"), directory, process.arch)
|
||||||
|
|
||||||
await testBin("task", ["--version"], binDir)
|
await testBin("task", ["--version"], binDir)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should find task in the cache", async () => {
|
it("should find task in the cache", async () => {
|
||||||
const { binDir } = await setupTask("3.10.0", directory, process.arch)
|
const { binDir } = await setupTask(getVersion("task", "true"), directory, process.arch)
|
||||||
if (isGitHubCI()) {
|
if (isGitHubCI()) {
|
||||||
expect(binDir).toMatch(process.env.RUNNER_TOOL_CACHE ?? "hostedtoolcache")
|
expect(binDir).toMatch(process.env.RUNNER_TOOL_CACHE ?? "hostedtoolcache")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue