mirror of
https://github.com/threeal/cmake-action.git
synced 2025-06-09 18:51:21 +00:00
feat: run CTest if run-test
is true
This commit is contained in:
parent
421f12e1db
commit
e57f0f2848
12
main/index.mjs
generated
12
main/index.mjs
generated
@ -27251,6 +27251,18 @@ async function main() {
|
||||
.flatMap((args) => args.split(" "));
|
||||
await _actions_exec__WEBPACK_IMPORTED_MODULE_1__.exec("cmake", ["--build", buildDir || "build", ...buildArgs]);
|
||||
}
|
||||
const runTest = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getBooleanInput("run-test");
|
||||
if (runTest) {
|
||||
const testArgs = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getMultilineInput("test-args")
|
||||
.flatMap((args) => args.split(" "));
|
||||
await _actions_exec__WEBPACK_IMPORTED_MODULE_1__.exec("ctest", [
|
||||
"--test-dir",
|
||||
buildDir || "build",
|
||||
"--output-on-failure",
|
||||
"--no-tests=error",
|
||||
...testArgs,
|
||||
]);
|
||||
}
|
||||
}
|
||||
main();
|
||||
//# sourceMappingURL=main.mjs.map
|
||||
|
14
src/main.mts
14
src/main.mts
@ -14,6 +14,20 @@ async function main() {
|
||||
.flatMap((args) => args.split(" "));
|
||||
await exec.exec("cmake", ["--build", buildDir || "build", ...buildArgs]);
|
||||
}
|
||||
|
||||
const runTest = core.getBooleanInput("run-test");
|
||||
if (runTest) {
|
||||
const testArgs = core
|
||||
.getMultilineInput("test-args")
|
||||
.flatMap((args) => args.split(" "));
|
||||
await exec.exec("ctest", [
|
||||
"--test-dir",
|
||||
buildDir || "build",
|
||||
"--output-on-failure",
|
||||
"--no-tests=error",
|
||||
...testArgs,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
|
Loading…
Reference in New Issue
Block a user