Skip to content

Commit

Permalink
Merge pull request #154 from Discookie/ericsson/timeout
Browse files Browse the repository at this point in the history
Add analysis timeout parameter
  • Loading branch information
MiklosMagyari authored Sep 17, 2024
2 parents 775c8f1 + 752b1c0 commit 6033360
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ Since CodeChecker-related paths vary greatly between systems, the following sett
| CodeChecker > Editor > Enable CodeLens <br> (default: `on`) | Enable CodeLens for displaying the reproduction path in the editor. |
| CodeChecker > Executor > Enable notifications <br> (default: `on`) | Enable CodeChecker-related toast notifications. |
| CodeChecker > Executor > Executable path <br> (default: `CodeChecker`) | Path to the CodeChecker executable. Can be an executable in the `PATH` environment variable, or an absolute path to one. |
| CodeChecker > Executor > Analysis timeout <br> (default: *60*) | The timeout (in seconds) for each individual analysis run by the CodeChecker analyze command - set to 0 to disable the timeout. |
| CodeChecker > Executor > Thread count <br> (default: *(empty)*) | CodeChecker's thread count - leave empty to use all threads. |
| CodeChecker > Executor > Arguments <br> (default: *(empty)*) | Additional arguments to `CodeChecker analyze`. For example, if you want to use a config file for CodeChecker pass '--config <config.json>'. For supported arguments, run `CodeChecker analyze --help`. <br> *Note:* The resulting command-line can be previewed with the command `CodeChecker: Show full CodeChecker analyze command line`. |
| CodeChecker > Executor > Log build command <br> (default: `make`) | The default build command used when running `CodeChecker log` via commands or tasks. |
Expand Down
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@
"minimum": 1,
"order": 5
},
"codechecker.executor.analysisTimeout": {
"type": "number",
"description": "The timeout (in seconds) for each individual analysis run by the CodeChecker analyze command - set to 0 to disable the timeout",
"default": 60,
"order": 6
},
"codechecker.executor.logBuildCommand": {
"type": "string",
"description": "The build command passed to CodeChecker log.",
Expand All @@ -158,7 +164,7 @@
"type": "string",
"description": "The build command passed to CodeChecker log.",
"default": "make",
"order": 6
"order": 7
},
"codechecker.executor.logArguments": {
"type": "string",
Expand All @@ -169,7 +175,7 @@
"type": "string",
"description": "Additional arguments to CodeChecker log command. For supported arguments, run `CodeChecker log --help`. The command `CodeChecker: Preview CodeChecker log in terminal` command shows the resulting command line.",
"default": "",
"order": 7
"order": 8
},
"codechecker.editor.showDatabaseDialog": {
"type": "boolean",
Expand Down
6 changes: 6 additions & 0 deletions src/backend/executor/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ export class ExecutorBridge implements Disposable {
: executorConfig.has('threadCount') ? executorConfig.get<string>('threadCount') : undefined;
// FIXME: Add support for selecting a specific workspace folder

const ccTimeout = workspace.getConfiguration('codechecker.executor').get<number>('analysisTimeout') ?? 0;

const args = [
'analyze',
'--output', reportsFolder
Expand All @@ -206,6 +208,10 @@ export class ExecutorBridge implements Disposable {
args.push('-j', ccThreads);
}

if (ccTimeout > 0) {
args.push('--timeout', ccTimeout.toString());
}

if (this.checkedVersion < [6, 22, 0]) {
const ccCompileCmd = this.getCompileCommandsPath(
files.length
Expand Down

0 comments on commit 6033360

Please sign in to comment.