setup-cpp/src/gcovr/gcovr.ts

22 lines
749 B
TypeScript
Raw Normal View History

2022-11-09 09:01:31 +08:00
import { addEnv } from "../utils/env/addEnv"
import { setupPipPack } from "../utils/setup/setupPipPack"
2022-11-09 09:01:31 +08:00
import semverValid from "semver/functions/valid"
import semverMajor from "semver/functions/major"
2021-09-15 01:42:08 +08:00
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function setupGcovr(version: string | undefined, _setupDir: string, _arch: string) {
return setupPipPack("gcovr", version)
2021-09-15 01:42:08 +08:00
}
2022-11-09 09:01:31 +08:00
export function activateGcovLLVM() {
return addEnv("GCOV", "llvm-cov gcov")
}
export function activateGcovGCC(gccVersion: string) {
const gccSemver = semverValid(gccVersion)
const gccMajor = gccSemver !== null ? semverMajor(gccSemver) : gccVersion
const gcov = gccMajor !== "" ? `gcov-${gccMajor}` : "gcov"
return addEnv("GCOV", gcov)
}