Skip to content

Commit 774a98c

Browse files
author
automatic-merge
committed
Merge remote branch 'origin/master' into edge
2 parents b0b7e46 + 721328f commit 774a98c

File tree

4 files changed

+25
-10
lines changed

4 files changed

+25
-10
lines changed

Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,8 @@ endif
133133
@echo code --extensionDevelopmentPath=`pwd`/integration/vscode/ada/ `pwd`
134134

135135
vscode-test:
136-
# Run the VS Code grammar testsuite
137-
cd integration/vscode/ada ; ./run_grammar_tests.sh
138-
139136
# Run the VS Code integration testsuite.
140-
# This contains no useful test, so deactivated for now.
141-
# cd integration/vscode/ada; npm run compile && node out/runTests.js
137+
cd integration/vscode/ada; LD_LIBRARY_PATH= npm run test
142138

143139
check: all
144140
set -e; \

integration/vscode/ada/test/runTest.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as path from 'path';
22

33
import { runTests } from '@vscode/test-electron';
4+
import { TestOptions } from '@vscode/test-electron/out/runTest';
45

56
async function main() {
67
try {
@@ -13,13 +14,27 @@ async function main() {
1314
const extensionTestsPath = path.resolve(__dirname, '../test/suite');
1415
const testWorkspace = path.resolve(extensionDevelopmentPath, './test/TestWorkspace');
1516

16-
// Download VS Code, unzip it and run the integration test
17-
await runTests({
18-
version: 'stable',
17+
const testOptions: TestOptions = {
1918
extensionDevelopmentPath,
2019
extensionTestsPath,
2120
launchArgs: [testWorkspace],
22-
});
21+
};
22+
23+
if (process.env.VSCODE) {
24+
// If specified, use the VSCode executable provided externally. This
25+
// can be use to test with an externally installed VS Code version
26+
// such as in a CI environment for example.
27+
//
28+
// The expected value is the path to <install-dir>/code and not
29+
// <install-dir>/bin/code.
30+
testOptions.vscodeExecutablePath = process.env.VSCODE;
31+
} else {
32+
// Otherwise download the latest stable version and test using that.
33+
testOptions.version = 'stable';
34+
}
35+
36+
// Download VS Code, unzip it and run the integration test
37+
await runTests(testOptions);
2338
} catch (err) {
2439
console.error(err);
2540
console.error('Failed to run tests');

integration/vscode/ada/test/suite/highlighting.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ function testSyntaxHighlighting(absFilePath: string, syntax: Syntaxes) {
242242
}
243243

244244
const cmd = [
245+
'npx',
245246
'vscode-tmgrammar-snap',
246247
// We pass a non-existing language configuration, otherwise the tool
247248
// picks up the package.json file and always loads the grammar in

integration/vscode/ada/test/suite/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Glob, GlobOptionsWithFileTypesUnset } from 'glob';
22
import Mocha, { MochaOptions } from 'mocha';
3-
import path, { resolve } from 'path';
3+
import { resolve } from 'path';
44
import { env } from 'process';
55

66
export function run(): Promise<void> {
@@ -10,6 +10,9 @@ export function run(): Promise<void> {
1010
};
1111

1212
if (process.env.MOCHA_REPORTER) {
13+
// If a reporter was specified externally, use it. For example, the CI
14+
// environment could set this to 'mocha-junit-reporter' to produce JUnit
15+
// results.
1316
mochaOptions.reporter = process.env.MOCHA_REPORTER;
1417
}
1518

0 commit comments

Comments
 (0)