Skip to content

Commit 18e040a

Browse files
author
automatic-merge
committed
Merge remote branch 'origin/master' into edge
2 parents 3e25f5c + 9b1d82f commit 18e040a

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

integration/vscode/ada/src/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ async function restartLanguageServers() {
524524
* @param snippetName - the name of the snippet to insert in the newly created editor.
525525
*/
526526
async function createNewFile(langId: string, snippetName: string) {
527-
const doc = await vscode.workspace.openTextDocument({ language: 'ada' });
527+
const doc = await vscode.workspace.openTextDocument({ language: langId });
528528
await vscode.window.showTextDocument(doc);
529529
await vscode.commands.executeCommand('editor.action.insertSnippet', {
530530
langId: langId,

integration/vscode/ada/src/gnattest.ts

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,14 @@ async function buildTestDriverAndReportErrors(
869869
await getGnatTestDriverProjectPath(),
870870
]
871871
.concat(getScenarioArgs())
872-
.concat(['-cargs', '-g', '-fdump-scos', '-fpreserve-control-flow']),
872+
.concat([
873+
"'-cargs:ada'",
874+
'-gnatef',
875+
'-cargs',
876+
'-g',
877+
'-fdump-scos',
878+
'-fpreserve-control-flow',
879+
]),
873880
};
874881
buildTask = (await adaTP.resolveTask(
875882
new vscode.Task(
@@ -893,32 +900,40 @@ async function buildTestDriverAndReportErrors(
893900
const result = await runTaskSequence(buildTasks, new WriteEmitter(run));
894901

895902
if (result != 0) {
896-
let msg =
897-
`Error while building the test harness project.` +
903+
let markdownMsg =
904+
`Failed to build the test harness project.` +
898905
` Check the [Problems](command:workbench.panel.markers.view.focus) view` +
899906
` and the [Terminal](command:terminal.focus) view for more information.`;
900907

901908
if (coverage) {
902909
const taskName = `${TASK_TYPE_ADA}: ${TASK_GNATCOV_SETUP.label}`;
903910
const taskNameEncoded = taskName.replace(/:/g, '%3A').replace(/ /g, '%20');
904-
msg +=
911+
markdownMsg +=
905912
`\n\nIf the errors relate to the GNATcoverage runtime library,` +
906913
` remember to set it up using the` +
907914
` [${taskName}]` +
908915
`(command:workbench.action.tasks.runTask?%22${taskNameEncoded}%22) task.`;
909916
}
910917

911-
prepareAndAppendOutput(run, msg);
918+
// Display a simple error message in the Tests Results view
919+
prepareAndAppendOutput(
920+
run,
921+
'Failed to build the test harness project: check the ' +
922+
'Problems and the Terminal views for more information.',
923+
);
912924

913-
const md = new vscode.MarkdownString(msg);
914-
md.isTrusted = true;
915-
const testMsg = new vscode.TestMessage(md);
916925
/**
917926
* Mark each test as errored, not failed, since the tests can't run
918927
* because of the build error.
928+
* Attach a proper markdown message to each failed test, with hyperlinks
929+
* pointing the user to the Problems and the Terminal views.
919930
*/
931+
const md = new vscode.MarkdownString(markdownMsg);
932+
md.isTrusted = true;
933+
const testMsg = new vscode.TestMessage(md);
920934
testsToRun.forEach((test) => run.errored(test, testMsg));
921-
throw Error(msg);
935+
936+
throw Error(markdownMsg);
922937
}
923938
}
924939

0 commit comments

Comments
 (0)