mirror of https://github.com/aminya/setup-cpp
test: fix the ubuntu-specific gcovr, doxygen, meson tests
This commit is contained in:
parent
86e88d8ce2
commit
870172d8c1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,4 +1,4 @@
|
||||||
import { syncVersions } from "../default_versions"
|
import { syncVersions, getVersion } from "../default_versions"
|
||||||
import { getCompilerInfo, Inputs, parseArgs } from "../main"
|
import { getCompilerInfo, Inputs, parseArgs } from "../main"
|
||||||
|
|
||||||
jest.setTimeout(300000)
|
jest.setTimeout(300000)
|
||||||
|
@ -33,4 +33,23 @@ describe("syncVersion", () => {
|
||||||
expect(syncVersions(opts, llvmTools)).toBe(true)
|
expect(syncVersions(opts, llvmTools)).toBe(true)
|
||||||
expect(opts.llvm).toBe(opts.clangtidy)
|
expect(opts.llvm).toBe(opts.clangtidy)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe("getVersion", () => {
|
||||||
|
it("gcovr", () => {
|
||||||
|
expect(getVersion("gcovr", "5.0")).toBe("5.0")
|
||||||
|
if (process.platform === "linux") {
|
||||||
|
expect(getVersion("gcovr", "true", [20, 4])).toBe("5.1")
|
||||||
|
expect(getVersion("gcovr", "true", [18, 4])).toBe("5.0")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
it("llvm", () => {
|
||||||
|
expect(getVersion("llvm", "13.0.0")).toBe("13.0.0")
|
||||||
|
if (process.platform === "linux") {
|
||||||
|
expect(getVersion("llvm", "true", [20, 4])).toBe("13.0.0-ubuntu-20.04")
|
||||||
|
expect(getVersion("llvm", "true", [18, 4])).toBe("13.0.1-ubuntu-18.04")
|
||||||
|
expect(getVersion("llvm", "true", [16, 4])).toBe("13.0.0-ubuntu-16.04")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -25,17 +25,18 @@ export function getVersion(name: string, version: string | undefined, osVersion:
|
||||||
if ([20, 18, 16].includes(osVersion[0]) && osVersion[1] === 4) {
|
if ([20, 18, 16].includes(osVersion[0]) && osVersion[1] === 4) {
|
||||||
return `${osVersion[0] === 18 ? "13.0.1" : "13.0.0"}-ubuntu-${osVersion[0]}.0${osVersion[1]}`
|
return `${osVersion[0] === 18 ? "13.0.1" : "13.0.0"}-ubuntu-${osVersion[0]}.0${osVersion[1]}`
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
if (osVersion[0] < 20) {
|
if (osVersion[0] < 20) {
|
||||||
switch (name) {
|
switch (name) {
|
||||||
case "gcovr":
|
case "gcovr":
|
||||||
return "5.0"
|
return "5.0"
|
||||||
case "meson":
|
case "meson":
|
||||||
return "0.61.4"
|
return "0.61.4"
|
||||||
case "doxygen":
|
case "doxygen":
|
||||||
return "1.9.1"
|
return "1.9.1"
|
||||||
default: {
|
default: {
|
||||||
// nothing
|
// nothing
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-help
|
||||||
import { InstallationInfo } from "../../utils/setup/setupBin"
|
import { InstallationInfo } from "../../utils/setup/setupBin"
|
||||||
import { getVersion } from "../../default_versions"
|
import { getVersion } from "../../default_versions"
|
||||||
import which from "which"
|
import which from "which"
|
||||||
|
import { ubuntuVersion } from "../../utils/env/ubuntu_version"
|
||||||
|
|
||||||
jest.setTimeout(300000)
|
jest.setTimeout(300000)
|
||||||
describe("setup-doxygen", () => {
|
describe("setup-doxygen", () => {
|
||||||
|
@ -12,7 +13,11 @@ describe("setup-doxygen", () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should setup doxygen and dot", async () => {
|
it("should setup doxygen and dot", async () => {
|
||||||
const installInfo = await setupDoxygen(getVersion("doxygen", undefined), directory, process.arch)
|
const installInfo = await setupDoxygen(
|
||||||
|
getVersion("doxygen", undefined, await ubuntuVersion()),
|
||||||
|
directory,
|
||||||
|
process.arch
|
||||||
|
)
|
||||||
|
|
||||||
await testBin("doxygen", ["--version"], (installInfo as InstallationInfo | undefined)?.binDir)
|
await testBin("doxygen", ["--version"], (installInfo as InstallationInfo | undefined)?.binDir)
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
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"
|
import { getVersion } from "../../default_versions"
|
||||||
|
import { ubuntuVersion } from "../../utils/env/ubuntu_version"
|
||||||
|
|
||||||
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(getVersion("gcovr", "true"), "", process.arch)
|
const installInfo = await setupGcovr(getVersion("gcovr", "true", await ubuntuVersion()), "", process.arch)
|
||||||
await testBin("gcovr", ["--version"], installInfo.binDir)
|
await testBin("gcovr", ["--version"], installInfo.binDir)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
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"
|
import { getVersion } from "../../default_versions"
|
||||||
|
import { ubuntuVersion } from "../../utils/env/ubuntu_version"
|
||||||
|
|
||||||
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(getVersion("meson", "true"), "", process.arch)
|
const installInfo = await setupMeson(getVersion("meson", "true", await ubuntuVersion()), "", process.arch)
|
||||||
|
|
||||||
await testBin("meson", ["--version"], installInfo.binDir)
|
await testBin("meson", ["--version"], installInfo.binDir)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue