-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote branch 'origin/master' into edge
- Loading branch information
Showing
27 changed files
with
940 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import { defineConfig } from '@vscode/test-cli'; | ||
import { mkdtempSync } from 'fs'; | ||
import * as os from 'os'; | ||
import { join } from 'path'; | ||
|
||
let baseMochaOptions = { | ||
ui: 'tdd', | ||
color: true, | ||
}; | ||
|
||
if (process.env.MOCHA_REPORTER) { | ||
// If a reporter was specified externally, use it. For example, the CI | ||
// environment could set this to 'mocha-junit-reporter' to produce JUnit | ||
// results. | ||
baseMochaOptions.reporter = process.env.MOCHA_REPORTER; | ||
} | ||
|
||
if (!baseMochaOptions.reporterOptions) { | ||
baseMochaOptions.reporterOptions = { | ||
maxDiffSize: 0, | ||
}; | ||
} | ||
|
||
if (process.env['MOCHA_TIMEOUT']) { | ||
baseMochaOptions.timeout = process.env['MOCHA_TIMEOUT']; | ||
} else { | ||
/** | ||
* Some tests involve calling gprbuild which takes time. So we disable test | ||
* timeouts altogether. | ||
*/ | ||
baseMochaOptions.timeout = '0'; | ||
} | ||
|
||
if (process.env['MOCHA_GREP']) { | ||
baseMochaOptions.grep = process.env['MOCHA_GREP']; | ||
} | ||
|
||
const testsuites = ['general', 'gnattest', 'workspace_missing_dirs']; | ||
|
||
export default defineConfig( | ||
testsuites.map((suiteName) => { | ||
// --user-data-dir is set to a unique directory under the OS | ||
// default tmp directory for temporary files to avoid | ||
// warnings related to longs paths in IPC sockets created by | ||
// VSCode. The directory is made unique to avoid | ||
// interference between successive runs. | ||
// | ||
// It also allows multiple testsuites to run concurrently with each VS | ||
// Code instance using a different User data directory. This can happen | ||
// when tests are launched from the VS Code UI. | ||
const tmpdir = mkdtempSync(`${os.tmpdir()}/vsc-ada-test-`); | ||
|
||
// Create a mocha options objects by copying the base one | ||
let mochaOptions = { ...baseMochaOptions }; | ||
|
||
if (process.env.MOCHA_REPORTER) { | ||
/** | ||
* Produce results for each testsuite separately | ||
*/ | ||
const mochaFile = process.env.MOCHA_RESULTS_DIR | ||
? join(process.env.MOCHA_RESULTS_DIR, `${suiteName}.xml`) | ||
: `${suiteName}.xml`; | ||
mochaOptions.reporterOptions = { mochaFile: mochaFile }; | ||
} | ||
|
||
return { | ||
label: `Ada extension testsuite: ${suiteName}`, | ||
files: `out/test/suite/${suiteName}/**/*.test.js`, | ||
workspaceFolder: `./test/workspaces/${suiteName}`, | ||
mocha: mochaOptions, | ||
env: { | ||
// When working remotely on Linux, it is necessary to have "Xvfb | ||
// :99" running in the background, and this env variable set for | ||
// the VS Code instances spawned for testing. | ||
// | ||
// This may prevent running locally on Linux and having the test | ||
// windows visible, but we consider this a minor use case for | ||
// now. A workaround is to remove this line. | ||
DISPLAY: ':99', | ||
}, | ||
launchArgs: ['--user-data-dir', tmpdir], | ||
// Use external installation if provided in the VSCODE env variable | ||
useInstallation: process.env.VSCODE ? { fromPath: process.env.VSCODE } : undefined, | ||
}; | ||
}) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
integration/vscode/ada/test/suite/workspace_missing_dirs/index.ts
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
integration/vscode/ada/test/suite/workspace_missing_dirs/workspace_missing_dirs.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
testsuite/ada_lsp/Did_Rename_Files.context_corruption/foo-bar1.ads
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package Foo.Bar1 is | ||
procedure N is null; | ||
end Foo.Bar1; |
3 changes: 3 additions & 0 deletions
3
testsuite/ada_lsp/Did_Rename_Files.context_corruption/foo.ads
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package Foo is | ||
procedure Do_Nothing is null; | ||
end Foo; |
6 changes: 6 additions & 0 deletions
6
testsuite/ada_lsp/Did_Rename_Files.context_corruption/main.adb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
with Foo.Bar1; | ||
|
||
procedure Main is | ||
begin | ||
Foo.Bar1.N; | ||
end Main; |
3 changes: 3 additions & 0 deletions
3
testsuite/ada_lsp/Did_Rename_Files.context_corruption/test.gpr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
project Test is | ||
for Main use ("main.adb"); | ||
end Test; |
Oops, something went wrong.