2022-11-09 09:01:31 +08:00
|
|
|
import { addEnv } from "../utils/env/addEnv"
|
2021-09-15 16:21:28 +08:00
|
|
|
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
|
|
|
|
2021-09-16 19:57:37 +08:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
2021-11-22 02:46:34 +08:00
|
|
|
export function setupGcovr(version: string | undefined, _setupDir: string, _arch: string) {
|
2021-09-17 00:54:36 +08:00
|
|
|
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)
|
|
|
|
}
|