Skip to content

Commit

Permalink
Merge remote branch 'origin/master' into edge
Browse files Browse the repository at this point in the history
  • Loading branch information
automatic-merge committed Jun 27, 2024
2 parents f056f83 + 951d78d commit 4219b09
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
33 changes: 33 additions & 0 deletions integration/vscode/ada/src/taskProviders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,24 @@ const predefinedTasks: PredefinedTask[] = [
},
problemMatchers: DEFAULT_PROBLEM_MATCHER,
},
{
label: 'Compile current file',
taskDef: {
type: TASK_TYPE_ADA,
command: 'gprbuild',
args: [
'-q',
'-f',
'-c',
'-u',
'${command:ada.gprProjectArgs}',
'${fileBasename}',
'-cargs:ada',
'-gnatef',
],
},
problemMatchers: DEFAULT_PROBLEM_MATCHER,
},
{
label: 'Analyze the project with GNAT SAS',
taskDef: {
Expand Down Expand Up @@ -170,6 +188,21 @@ const predefinedTasks: PredefinedTask[] = [
*/
problemMatchers: '',
},
{
label: 'Analyze the current file with GNAT SAS and produce a report',
taskDef: {
type: TASK_TYPE_ADA,
compound: [
'Analyze the current file with GNAT SAS',
'Create a report after a GNAT SAS analysis',
],
},
/**
* Analysis results are not printed on stdio so no need to parse them
* with a problem matcher.
*/
problemMatchers: '',
},
{
label: 'Generate documentation from the project',
taskDef: {
Expand Down
1 change: 1 addition & 0 deletions integration/vscode/ada/test/suite/general/codelens.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ suite('CodeLens', function () {
});
});

// eslint-disable-next-line @typescript-eslint/no-unused-vars
function toString(codelenses: import('vscode').CodeLens[] | null | undefined): unknown {
return JSON.stringify(
codelenses?.map((cl) => ({
Expand Down
18 changes: 17 additions & 1 deletion integration/vscode/ada/test/suite/general/tasks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ import {
createAdaTaskProvider,
getConventionalTaskLabel,
} from '../../../src/taskProviders';
import { activate, getCmdLine, getCommandLines, runTaskAndGetResult, testTask } from '../utils';
import {
activate,
closeAllEditors,
getCmdLine,
getCommandLines,
runTaskAndGetResult,
testTask,
} from '../utils';

suite('Task Providers', function () {
let projectPath: string;
Expand All @@ -31,10 +38,12 @@ suite('Task Providers', function () {
ada: Clean current project
ada: Build current project
ada: Check current file
ada: Compile current file
ada: Analyze the project with GNAT SAS
ada: Analyze the current file with GNAT SAS
ada: Create a report after a GNAT SAS analysis
ada: Analyze the project with GNAT SAS and produce a report
ada: Analyze the current file with GNAT SAS and produce a report
ada: Generate documentation from the project
ada: Create/update test skeletons for the project
ada: Build main - src/main1.adb
Expand All @@ -54,6 +63,7 @@ ada: Build and run main - src/test.adb
ada: Clean current project - gprclean -P ${projectPath}
ada: Build current project - gprbuild -P ${projectPath} -cargs:ada -gnatef
ada: Check current file - gprbuild -q -f -c -u -gnatc -P ${projectPath} \${fileBasename} -cargs:ada -gnatef
ada: Compile current file - gprbuild -q -f -c -u -P ${projectPath} \${fileBasename} -cargs:ada -gnatef
ada: Analyze the project with GNAT SAS - gnatsas analyze -P ${projectPath}
ada: Analyze the current file with GNAT SAS - gnatsas analyze -P ${projectPath} --file=\${fileBasename}
ada: Create a report after a GNAT SAS analysis - gnatsas report sarif -P ${projectPath} -o report.sarif
Expand Down Expand Up @@ -212,10 +222,15 @@ suite('Task Execution', function () {
allProvidedTasks.push(...(await createAdaTaskProvider().provideTasks()));
});

this.beforeEach(async function () {
await closeAllEditors();
});

declTaskTest('ada: Build current project');
declTaskTest('ada: Run main - src/main1.adb');
declTaskTest('ada: Run main - src/test.adb');
declTaskTest('ada: Check current file', openSrcFile);
declTaskTest('ada: Compile current file', openSrcFile);
declTaskTest('ada: Clean current project');
declTaskTest('ada: Build main - src/main1.adb');
declTaskTest('ada: Build main - src/test.adb');
Expand All @@ -224,6 +239,7 @@ suite('Task Execution', function () {
declTaskTest('ada: Analyze the project with GNAT SAS');
declTaskTest('ada: Create a report after a GNAT SAS analysis');
declTaskTest('ada: Analyze the project with GNAT SAS and produce a report');
declTaskTest('ada: Analyze the current file with GNAT SAS and produce a report', openSrcFile);
declTaskTest('ada: Analyze the current file with GNAT SAS', openSrcFile);
declTaskTest('ada: Generate documentation from the project');
declTaskTest('ada: Create/update test skeletons for the project');
Expand Down

0 comments on commit 4219b09

Please sign in to comment.