Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
86244d39
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
86244d39
编写于
1月 26, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add API tests that run on a workspace
上级
faa7f4c6
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
128 addition
and
12 deletion
+128
-12
.vscode/launch.json
.vscode/launch.json
+16
-2
build/gulpfile.hygiene.js
build/gulpfile.hygiene.js
+4
-1
extensions/vscode-api-tests/src/singlefolder-tests/commands.test.ts
.../vscode-api-tests/src/singlefolder-tests/commands.test.ts
+0
-0
extensions/vscode-api-tests/src/singlefolder-tests/configuration.test.ts
...de-api-tests/src/singlefolder-tests/configuration.test.ts
+0
-0
extensions/vscode-api-tests/src/singlefolder-tests/editor.test.ts
...ns/vscode-api-tests/src/singlefolder-tests/editor.test.ts
+1
-1
extensions/vscode-api-tests/src/singlefolder-tests/env.test.ts
...sions/vscode-api-tests/src/singlefolder-tests/env.test.ts
+0
-0
extensions/vscode-api-tests/src/singlefolder-tests/index.ts
extensions/vscode-api-tests/src/singlefolder-tests/index.ts
+0
-0
extensions/vscode-api-tests/src/singlefolder-tests/languages.test.ts
...vscode-api-tests/src/singlefolder-tests/languages.test.ts
+1
-1
extensions/vscode-api-tests/src/singlefolder-tests/window.test.ts
...ns/vscode-api-tests/src/singlefolder-tests/window.test.ts
+1
-1
extensions/vscode-api-tests/src/singlefolder-tests/workspace.test.ts
...vscode-api-tests/src/singlefolder-tests/workspace.test.ts
+19
-4
extensions/vscode-api-tests/src/workspace-tests/index.ts
extensions/vscode-api-tests/src/workspace-tests/index.ts
+28
-0
extensions/vscode-api-tests/src/workspace-tests/workspace.test.ts
...ns/vscode-api-tests/src/workspace-tests/workspace.test.ts
+40
-0
extensions/vscode-api-tests/testWorkspace2/simple.txt
extensions/vscode-api-tests/testWorkspace2/simple.txt
+1
-0
extensions/vscode-api-tests/testworkspace.code-workspace
extensions/vscode-api-tests/testworkspace.code-workspace
+11
-0
scripts/test-integration.bat
scripts/test-integration.bat
+4
-1
scripts/test-integration.sh
scripts/test-integration.sh
+2
-1
未找到文件。
.vscode/launch.json
浏览文件 @
86244d39
...
...
@@ -81,12 +81,26 @@
{
"type"
:
"extensionHost"
,
"request"
:
"launch"
,
"name"
:
"VS Code API Tests"
,
"name"
:
"VS Code API Tests
(single folder)
"
,
"runtimeExecutable"
:
"${execPath}"
,
"args"
:
[
"${workspaceFolder}/extensions/vscode-api-tests/testWorkspace"
,
"--extensionDevelopmentPath=${workspaceFolder}/extensions/vscode-api-tests"
,
"--extensionTestsPath=${workspaceFolder}/extensions/vscode-api-tests/out"
"--extensionTestsPath=${workspaceFolder}/extensions/vscode-api-tests/out/singlefolder-tests"
],
"outFiles"
:
[
"${workspaceFolder}/out/**/*.js"
]
},
{
"type"
:
"extensionHost"
,
"request"
:
"launch"
,
"name"
:
"VS Code API Tests (workspace)"
,
"runtimeExecutable"
:
"${execPath}"
,
"args"
:
[
"${workspaceFolder}/extensions/vscode-api-tests/testWorkspace.code-workspace"
,
"--extensionDevelopmentPath=${workspaceFolder}/extensions/vscode-api-tests"
,
"--extensionTestsPath=${workspaceFolder}/extensions/vscode-api-tests/out/workspace-tests"
],
"outFiles"
:
[
"${workspaceFolder}/out/**/*.js"
...
...
build/gulpfile.hygiene.js
浏览文件 @
86244d39
...
...
@@ -77,7 +77,8 @@ const indentationFilter = [
'
!extensions/**/syntaxes/**
'
,
'
!extensions/**/themes/**
'
,
'
!extensions/**/colorize-fixtures/**
'
,
'
!extensions/vscode-api-tests/testWorkspace/**
'
'
!extensions/vscode-api-tests/testWorkspace/**
'
,
'
!extensions/vscode-api-tests/testWorkspace2/**
'
];
const
copyrightFilter
=
[
...
...
@@ -95,6 +96,7 @@ const copyrightFilter = [
'
!**/*.xpm
'
,
'
!**/*.opts
'
,
'
!**/*.disabled
'
,
'
!**/*.code-workspace
'
,
'
!build/**/*.init
'
,
'
!resources/linux/snap/snapcraft.yaml
'
,
'
!resources/win32/bin/code.js
'
,
...
...
@@ -124,6 +126,7 @@ const tslintFilter = [
'
!**/node_modules/**
'
,
'
!extensions/typescript/test/colorize-fixtures/**
'
,
'
!extensions/vscode-api-tests/testWorkspace/**
'
,
'
!extensions/vscode-api-tests/testWorkspace2/**
'
,
'
!extensions/**/*.test.ts
'
,
'
!extensions/html/server/lib/jquery.d.ts
'
];
...
...
extensions/vscode-api-tests/src/commands.test.ts
→
extensions/vscode-api-tests/src/
singlefolder-tests/
commands.test.ts
浏览文件 @
86244d39
文件已移动
extensions/vscode-api-tests/src/configuration.test.ts
→
extensions/vscode-api-tests/src/
singlefolder-tests/
configuration.test.ts
浏览文件 @
86244d39
文件已移动
extensions/vscode-api-tests/src/editor.test.ts
→
extensions/vscode-api-tests/src/
singlefolder-tests/
editor.test.ts
浏览文件 @
86244d39
...
...
@@ -7,7 +7,7 @@
import
*
as
assert
from
'
assert
'
;
import
{
workspace
,
window
,
Position
,
Range
,
commands
,
TextEditor
,
TextDocument
,
TextEditorCursorStyle
,
TextEditorLineNumbersStyle
,
SnippetString
,
Selection
}
from
'
vscode
'
;
import
{
createRandomFile
,
deleteFile
,
closeAllEditors
}
from
'
./utils
'
;
import
{
createRandomFile
,
deleteFile
,
closeAllEditors
}
from
'
.
.
/utils
'
;
suite
(
'
editor tests
'
,
()
=>
{
...
...
extensions/vscode-api-tests/src/env.test.ts
→
extensions/vscode-api-tests/src/
singlefolder-tests/
env.test.ts
浏览文件 @
86244d39
文件已移动
extensions/vscode-api-tests/src/index.ts
→
extensions/vscode-api-tests/src/
singlefolder-tests/
index.ts
浏览文件 @
86244d39
文件已移动
extensions/vscode-api-tests/src/languages.test.ts
→
extensions/vscode-api-tests/src/
singlefolder-tests/
languages.test.ts
浏览文件 @
86244d39
...
...
@@ -21,7 +21,7 @@ suite('languages namespace tests', () => {
constructor
()
{
super
(
new
Range
(
0
,
2
,
0
,
7
),
'
sonntag
'
);
}
}
;
}
let
diag1
=
new
Diagnostic
(
new
Range
(
0
,
0
,
0
,
5
),
'
montag
'
);
let
diag2
=
new
D2
();
...
...
extensions/vscode-api-tests/src/window.test.ts
→
extensions/vscode-api-tests/src/
singlefolder-tests/
window.test.ts
浏览文件 @
86244d39
...
...
@@ -8,7 +8,7 @@
import
*
as
assert
from
'
assert
'
;
import
{
workspace
,
window
,
commands
,
ViewColumn
,
TextEditorViewColumnChangeEvent
,
Uri
,
Selection
,
Position
,
CancellationTokenSource
,
TextEditorSelectionChangeKind
}
from
'
vscode
'
;
import
{
join
}
from
'
path
'
;
import
{
closeAllEditors
,
pathEquals
,
createRandomFile
}
from
'
./utils
'
;
import
{
closeAllEditors
,
pathEquals
,
createRandomFile
}
from
'
.
.
/utils
'
;
suite
(
'
window namespace tests
'
,
()
=>
{
...
...
extensions/vscode-api-tests/src/workspace.test.ts
→
extensions/vscode-api-tests/src/
singlefolder-tests/
workspace.test.ts
浏览文件 @
86244d39
...
...
@@ -7,10 +7,9 @@
import
*
as
assert
from
'
assert
'
;
import
*
as
vscode
from
'
vscode
'
;
import
{
createRandomFile
,
deleteFile
,
closeAllEditors
,
pathEquals
}
from
'
./utils
'
;
import
{
createRandomFile
,
deleteFile
,
closeAllEditors
,
pathEquals
}
from
'
.
.
/utils
'
;
import
{
join
,
basename
}
from
'
path
'
;
import
*
as
fs
from
'
fs
'
;
import
{
Uri
}
from
'
vscode
'
;
suite
(
'
workspace-namespace
'
,
()
=>
{
...
...
@@ -39,11 +38,27 @@ suite('workspace-namespace', () => {
test
(
'
rootPath
'
,
()
=>
{
if
(
vscode
.
workspace
.
rootPath
)
{
assert
.
ok
(
pathEquals
(
vscode
.
workspace
.
rootPath
,
join
(
__dirname
,
'
../testWorkspace
'
)));
assert
.
ok
(
pathEquals
(
vscode
.
workspace
.
rootPath
,
join
(
__dirname
,
'
../
../
testWorkspace
'
)));
}
assert
.
throws
(()
=>
vscode
.
workspace
.
rootPath
=
'
farboo
'
);
});
test
(
'
workspaceFolders
'
,
()
=>
{
if
(
vscode
.
workspace
.
workspaceFolders
)
{
assert
.
equal
(
vscode
.
workspace
.
workspaceFolders
.
length
,
1
);
assert
.
ok
(
pathEquals
(
vscode
.
workspace
.
workspaceFolders
[
0
].
uri
.
fsPath
,
join
(
__dirname
,
'
../../testWorkspace
'
)));
}
});
test
(
'
getWorkspaceFolder
'
,
()
=>
{
const
folder
=
vscode
.
workspace
.
getWorkspaceFolder
(
vscode
.
Uri
.
file
(
join
(
__dirname
,
'
../../testWorkspace/far.js
'
)));
assert
.
ok
(
!!
folder
);
if
(
folder
)
{
assert
.
ok
(
pathEquals
(
folder
.
uri
.
fsPath
,
join
(
__dirname
,
'
../../testWorkspace
'
)));
}
});
test
(
'
openTextDocument
'
,
()
=>
{
let
len
=
vscode
.
workspace
.
textDocuments
.
length
;
return
vscode
.
workspace
.
openTextDocument
(
join
(
vscode
.
workspace
.
rootPath
||
''
,
'
./simple.txt
'
)).
then
(
doc
=>
{
...
...
@@ -536,7 +551,7 @@ suite('workspace-namespace', () => {
test
(
'
applyEdit should fail when editing renamed from resource
'
,
async
()
=>
{
const
resource
=
await
createRandomFile
();
const
newResource
=
Uri
.
parse
(
resource
.
fsPath
+
'
.1
'
);
const
newResource
=
vscode
.
Uri
.
parse
(
resource
.
fsPath
+
'
.1
'
);
const
edit
=
new
vscode
.
WorkspaceEdit
();
edit
.
renameResource
(
resource
,
newResource
);
try
{
...
...
extensions/vscode-api-tests/src/workspace-tests/index.ts
0 → 100644
浏览文件 @
86244d39
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
//
// PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING
//
// This file is providing the test runner to use when running extension tests.
// By default the test runner in use is Mocha based.
//
// You can provide your own test runner if you want to override it by exporting
// a function run(testRoot: string, clb: (error:Error) => void) that the extension
// host can call to run the tests. The test runner is expected to use console.log
// to report the results back to the caller. When the tests are finished, return
// a possible error to the callback or null if none.
const
testRunner
=
require
(
'
vscode/lib/testrunner
'
);
// You can directly control Mocha options by uncommenting the following lines
// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info
testRunner
.
configure
({
ui
:
'
tdd
'
,
// the TDD UI is being used in extension.test.ts (suite, test, etc.)
useColors
:
process
.
platform
!==
'
win32
'
,
// colored output from test results (only windows cannot handle)
timeout
:
60000
});
export
=
testRunner
;
extensions/vscode-api-tests/src/workspace-tests/workspace.test.ts
0 → 100644
浏览文件 @
86244d39
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
*
as
assert
from
'
assert
'
;
import
*
as
vscode
from
'
vscode
'
;
import
{
closeAllEditors
,
pathEquals
}
from
'
../utils
'
;
import
{
join
}
from
'
path
'
;
suite
(
'
workspace-namespace
'
,
()
=>
{
teardown
(
closeAllEditors
);
test
(
'
rootPath
'
,
()
=>
{
if
(
vscode
.
workspace
.
rootPath
)
{
assert
.
ok
(
pathEquals
(
vscode
.
workspace
.
rootPath
,
join
(
__dirname
,
'
../../testWorkspace
'
)));
}
});
test
(
'
workspaceFolders
'
,
()
=>
{
if
(
vscode
.
workspace
.
workspaceFolders
)
{
assert
.
equal
(
vscode
.
workspace
.
workspaceFolders
.
length
,
2
);
assert
.
ok
(
pathEquals
(
vscode
.
workspace
.
workspaceFolders
[
0
].
uri
.
fsPath
,
join
(
__dirname
,
'
../../testWorkspace
'
)));
assert
.
ok
(
pathEquals
(
vscode
.
workspace
.
workspaceFolders
[
1
].
uri
.
fsPath
,
join
(
__dirname
,
'
../../testWorkspace2
'
)));
assert
.
ok
(
pathEquals
(
vscode
.
workspace
.
workspaceFolders
[
1
].
name
,
'
Test Workspace 2
'
));
}
});
test
(
'
getWorkspaceFolder
'
,
()
=>
{
const
folder
=
vscode
.
workspace
.
getWorkspaceFolder
(
vscode
.
Uri
.
file
(
join
(
__dirname
,
'
../../testWorkspace2/far.js
'
)));
assert
.
ok
(
!!
folder
);
if
(
folder
)
{
assert
.
ok
(
pathEquals
(
folder
.
uri
.
fsPath
,
join
(
__dirname
,
'
../../testWorkspace2
'
)));
}
});
});
extensions/vscode-api-tests/testWorkspace2/simple.txt
0 → 100644
浏览文件 @
86244d39
Just a simple file...
\ No newline at end of file
extensions/vscode-api-tests/testworkspace.code-workspace
0 → 100644
浏览文件 @
86244d39
{
"folders": [
{
"path": "testWorkspace"
},
{
"path": "testWorkspace2",
"name": "Test Workspace 2"
}
]
}
\ No newline at end of file
scripts/test-integration.bat
浏览文件 @
86244d39
...
...
@@ -9,7 +9,10 @@ if not "%APPVEYOR%" == "" (
set
VSCODEUSERDATADIR
=
%TMP%
\vscodeuserfolder
-
%RANDOM%
-
%TIME
:
~
6
,
5
%
:: Tests in the extension host
call
.\scripts\code.bat
%~dp0
\..\extensions\vscode
-api-tests
\testWorkspace
--extensionDevelopmentPath
=
%~dp0
\..\extensions\vscode
-api-tests --extensionTestsPath
=
%~dp0
\..\extensions\vscode
-api-tests
\out
--disableExtensions --user-data-dir
=
%VSCODEUSERDATADIR%
call
.\scripts\code.bat
%~dp0
\..\extensions\vscode
-api-tests
\testWorkspace
--extensionDevelopmentPath
=
%~dp0
\..\extensions\vscode
-api-tests --extensionTestsPath
=
%~dp0
\..\extensions\vscode
-api-tests
\out\singlefolder
-tests --disableExtensions --user-data-dir
=
%VSCODEUSERDATADIR%
if
%errorlevel%
neq
0
exit
/b
%errorlevel%
call
.\scripts\code.bat
%~dp0
\..\extensions\vscode
-api-tests
\testWorkspace.code
-workspace --extensionDevelopmentPath
=
%~dp0
\..\extensions\vscode
-api-tests --extensionTestsPath
=
%~dp0
\..\extensions\vscode
-api-tests
\out\workspace
-tests --disableExtensions --user-data-dir
=
%VSCODEUSERDATADIR%
if
%errorlevel%
neq
0
exit
/b
%errorlevel%
call
.\scripts\code.bat
%~dp0
\..\extensions\vscode
-colorize-tests
\test
--extensionDevelopmentPath
=
%~dp0
\..\extensions\vscode
-colorize-tests --extensionTestsPath
=
%~dp0
\..\extensions\vscode
-colorize-tests
\out
--disableExtensions --user-data-dir
=
%VSCODEUSERDATADIR%
...
...
scripts/test-integration.sh
浏览文件 @
86244d39
...
...
@@ -13,7 +13,8 @@ fi
cd
$ROOT
# Tests in the extension host
./scripts/code.sh
$ROOT
/extensions/vscode-api-tests/testWorkspace
--extensionDevelopmentPath
=
$ROOT
/extensions/vscode-api-tests
--extensionTestsPath
=
$ROOT
/extensions/vscode-api-tests/out
--disableExtensions
--user-data-dir
=
$VSCODEUSERDATADIR
--skip-getting-started
./scripts/code.sh
$ROOT
/extensions/vscode-api-tests/testWorkspace
--extensionDevelopmentPath
=
$ROOT
/extensions/vscode-api-tests
--extensionTestsPath
=
$ROOT
/extensions/vscode-api-tests/out/singlefolder-tests
--disableExtensions
--user-data-dir
=
$VSCODEUSERDATADIR
--skip-getting-started
./scripts/code.sh
$ROOT
/extensions/vscode-api-tests/testWorkspace.code-workspace
--extensionDevelopmentPath
=
$ROOT
/extensions/vscode-api-tests
--extensionTestsPath
=
$ROOT
/extensions/vscode-api-tests/out/workspace-tests
--disableExtensions
--user-data-dir
=
$VSCODEUSERDATADIR
--skip-getting-started
./scripts/code.sh
$ROOT
/extensions/vscode-colorize-tests/test
--extensionDevelopmentPath
=
$ROOT
/extensions/vscode-colorize-tests
--extensionTestsPath
=
$ROOT
/extensions/vscode-colorize-tests/out
--disableExtensions
--user-data-dir
=
$VSCODEUSERDATADIR
--skip-getting-started
./scripts/code.sh
$ROOT
/extensions/emmet/test-fixtures
--extensionDevelopmentPath
=
$ROOT
/extensions/emmet
--extensionTestsPath
=
$ROOT
/extensions/emmet/out/test
--disableExtensions
--user-data-dir
=
$VSCODEUSERDATADIR
--skip-getting-started
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录