mirror of https://github.com/aminya/setup-cpp
feat: add cppcheck
This commit is contained in:
parent
7957d7f52a
commit
a614cdbf27
|
@ -21,8 +21,8 @@ The package will be usable from any environment (locally, GitHub Actions, etc).
|
|||
- [x] setup gcovr
|
||||
- [x] setup python
|
||||
- [x] setup msvc
|
||||
- [x] setup cppcheck
|
||||
- [ ] setup gcc/mingw
|
||||
- [ ] setup OpenCppCoverage
|
||||
- [ ] setup cppcheck
|
||||
- [ ] setup doxygen
|
||||
- [ ] setup vcpkg
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
import { setupCppcheck } from "../cppcheck"
|
||||
import { spawnSync as spawn } from "child_process"
|
||||
|
||||
jest.setTimeout(200000)
|
||||
describe("setup-cppcheck", () => {
|
||||
it("should setup cppcheck", async () => {
|
||||
await setupCppcheck()
|
||||
|
||||
const { status } = spawn("cppcheck", ["--version"], {
|
||||
encoding: "utf8",
|
||||
})
|
||||
expect(status).toBe(0)
|
||||
})
|
||||
})
|
|
@ -0,0 +1,20 @@
|
|||
import { setupAptPack } from "../utils/setup/setupAptPack"
|
||||
import { setupBrewPack } from "../utils/setup/setupBrewPack"
|
||||
import { setupChocoPack } from "../utils/setup/setupChocoPack"
|
||||
|
||||
export function setupCppcheck(version?: string) {
|
||||
switch (process.platform) {
|
||||
case "win32": {
|
||||
return setupChocoPack("cppcheck", version)
|
||||
}
|
||||
case "darwin": {
|
||||
return setupBrewPack("cppcheck", version)
|
||||
}
|
||||
case "linux": {
|
||||
return setupAptPack("cppcheck", version)
|
||||
}
|
||||
default: {
|
||||
throw new Error(`Unsupported platform`)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue