mirror of https://github.com/aminya/setup-cpp
feat: add opencppcoverage
This commit is contained in:
parent
c8b9b73c4e
commit
ea280dfd67
|
@ -42,6 +42,9 @@ inputs:
|
|||
cppcheck:
|
||||
description: "The cppcheck version to install."
|
||||
required: false
|
||||
opencppcoverage:
|
||||
description: "The opencppcoverage version to install."
|
||||
required: false
|
||||
|
||||
runs:
|
||||
using: "node12"
|
||||
|
|
|
@ -11,6 +11,7 @@ import { setupLLVM } from "./llvm/llvm"
|
|||
import { setupMeson } from "./meson/meson"
|
||||
import { setupMSVC } from "./msvc/msvc"
|
||||
import { setupNinja } from "./ninja/ninja"
|
||||
import { setupOpencppcoverage } from "./opencppcoverage/opencppcoverage"
|
||||
import { setupPython } from "./python/python"
|
||||
|
||||
function maybeGetInput(key: string) {
|
||||
|
@ -61,6 +62,12 @@ export async function main(): Promise<number> {
|
|||
await setupGcovr(gcovrVersion)
|
||||
}
|
||||
|
||||
// setup opencppCoverage
|
||||
const opencppCoverageVersion = maybeGetInput("opencppcoverage")
|
||||
if (opencppCoverageVersion !== undefined) {
|
||||
await setupOpencppcoverage(gcovrVersion)
|
||||
}
|
||||
|
||||
// setup llvm
|
||||
const llvmVersion = maybeGetInput("llvm")
|
||||
if (llvmVersion !== undefined) {
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
import { setupOpencppcoverage } from "../opencppcoverage"
|
||||
import { spawnSync as spawn } from "child_process"
|
||||
|
||||
jest.setTimeout(200000)
|
||||
describe("setup-OpenCppCoverage", () => {
|
||||
it("should setup OpenCppCoverage", async () => {
|
||||
if (process.platform !== "win32") {
|
||||
return
|
||||
}
|
||||
await setupOpencppcoverage()
|
||||
|
||||
const { status } = spawn("OpenCppCoverage", ["--version"], {
|
||||
encoding: "utf8",
|
||||
})
|
||||
expect(status).toBe(0)
|
||||
})
|
||||
})
|
|
@ -0,0 +1,10 @@
|
|||
import { addPath } from "@actions/core"
|
||||
import { setupChocoPack } from "../utils/setup/setupChocoPack"
|
||||
|
||||
export async function setupOpencppcoverage(version?: string) {
|
||||
if (process.platform !== "win32") {
|
||||
return
|
||||
}
|
||||
await setupChocoPack("opencppcoverage", version)
|
||||
addPath("C:/Program Files/OpenCppCoverage")
|
||||
}
|
Loading…
Reference in New Issue