Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
a005d688
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a005d688
编写于
9月 19, 2017
作者:
A
Ashley Hauck
提交者:
GitHub
9月 19, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #22145 from khyperia/twiddle_tests_sh
Refactor tests.sh to be a bit cleaner
上级
065bc332
0867cd49
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
42 addition
and
51 deletion
+42
-51
build/scripts/build-utils.sh
build/scripts/build-utils.sh
+1
-7
build/scripts/tests.sh
build/scripts/tests.sh
+31
-36
cibuild.sh
cibuild.sh
+10
-8
未找到文件。
build/scripts/build-utils.sh
浏览文件 @
a005d688
...
@@ -7,13 +7,7 @@ set -u
...
@@ -7,13 +7,7 @@ set -u
get_repo_dir
()
get_repo_dir
()
{
{
local
d
=
$(
cd
-P
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
cd
-P
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
/../.."
&&
pwd
pushd
$d
>
/dev/null
cd
..
cd
..
local
repoDir
=
$(
pwd
)
popd
>
/dev/null
echo
$repoDir
}
}
# This function will give you the current version number for the specified string in the
# This function will give you the current version number for the specified string in the
...
...
build/scripts/tests.sh
浏览文件 @
a005d688
...
@@ -5,58 +5,53 @@
...
@@ -5,58 +5,53 @@
set
-e
set
-e
set
-u
set
-u
BUILD_CONFIGURATION
=
${
1
:-
Debug
}
build_configuration
=
${
1
:-
Debug
}
THIS_DIR
=
$(
cd
-P
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
this_dir
=
$(
cd
-P
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
source
${
THIS_DIR
}
/build-utils.sh
source
${
this_dir
}
/build-utils.sh
BINARIES_PATH
=
${
THIS_DIR
}
/../../Binaries
root_path
=
$(
get_repo_dir
)
SRC_PATH
=
${
THIS_DIR
}
/../..
binaries_path
=
${
root_path
}
/Binaries
UNITTEST_DIR
=
${
BINARIES_PATH
}
/
${
BUILD_CONFIGURATION
}
/UnitTests
unittest_dir
=
${
binaries_path
}
/
${
build_configuration
}
/UnitTests
LOG_DIR
=
${
BINARIES_PATH
}
/
${
BUILD_CONFIGURATION
}
/xUnitResults
log_dir
=
${
binaries_path
}
/
${
build_configuration
}
/xUnitResults
NUGET_DIR
=
${
HOME
}
/.nuget/packages
nuget_dir
=
${
HOME
}
/.nuget/packages
RUNTIME_ID
=
$(
dotnet
--info
|
awk
'/RID:/{print $2;}'
)
runtime_id
=
$(
dotnet
--info
|
awk
'/RID:/{print $2;}'
)
TARGET_FRAMEWORK
=
netcoreapp2.0
target_framework
=
netcoreapp2.0
XUNIT_CONSOLE_VERSION
=
$(
get_package_version dotnet-xunit
)
xunit_console_version
=
$(
get_package_version dotnet-xunit
)
XUNIT_CONSOLE
=
${
NUGET_DIR
}
/dotnet-xunit/
${
XUNIT_CONSOLE_VERSION
}
/tools/
${
TARGET_FRAMEWORK
}
/xunit.console.dll
xunit_console
=
${
nuget_dir
}
/dotnet-xunit/
${
xunit_console_version
}
/tools/
${
target_framework
}
/xunit.console.dll
echo
Using
$XUNIT_CONSOLE
echo
"Using
${
xunit_console
}
"
# Need to publish projects that have runtime assets before running tests
# Need to publish projects that have runtime assets before running tests
NEED_PUBLISH
=(
need_publish
=(
'src
\Compilers\CSharp\Test\Symbol\
CSharpCompilerSymbolTest.csproj'
'src
/Compilers/CSharp/Test/Symbol/
CSharpCompilerSymbolTest.csproj'
)
)
for
p
in
$NEED_PUBLISH
for
project
in
$need_publish
do
do
echo
Publishing
${
p
}
echo
"Publishing
${
project
}
"
dotnet publish
--no-restore
${
SRC_PATH
}
/
${
p
}
-p
:RuntimeIdentifier
=
${
RUNTIME_ID
}
-p
:TargetFramework
=
${
TARGET_FRAMEWORK
}
-p
:SelfContained
=
true
dotnet publish
--no-restore
${
root_path
}
/
${
project
}
-r
${
runtime_id
}
-f
${
target_framework
}
-p
:SelfContained
=
true
done
done
# Discover and run the tests
# Discover and run the tests
mkdir
-p
${
LOG_DIR
}
mkdir
-p
"
${
log_dir
}
"
pushd
${
UNITTEST_DIR
}
for
d
in
*
for
test_path
in
${
unittest_dir
}
/
*
/
${
target_framework
}
do
do
TEST_PATH
=
${
UNITTEST_DIR
}
/
${
d
}
/
${
TARGET_FRAMEWORK
}
publish_test_path
=
${
test_path
}
/
${
runtime_id
}
/publish
PUBLISH_TEST_PATH
=
${
TEST_PATH
}
/
${
RUNTIME_ID
}
/publish
if
[
-d
${
publish_test_path
}
]
if
[
-d
${
PUBLISH_TEST_PATH
}
]
then
then
TEST_PATH
=
${
PUBLISH_TEST_PATH
}
test_path
=
${
publish_test_path
}
fi
fi
pushd
$TEST_PATH
file_name
=(
${
test_path
}
/
*
.UnitTests.dll
)
FILE_NAME
=
$(
ls
*
.UnitTests.dll
)
log_file
=
"
${
log_dir
}
/
$(
basename
"
${
file_name
%.*
}
.xml"
)
"
LOG_NAME
=
"
${
FILE_NAME
%.*
}
.xml"
deps_json
=
"
${
file_name
%.*
}
.deps.json"
echo
Running
${
TEST_PATH
}
/
${
FILE_NAME
}
runtimeconfig_json
=
"
${
file_name
%.*
}
.runtimeconfig.json"
dotnet
exec
--depsfile
"
${
FILE_NAME
%.*
}
.deps.json"
--runtimeconfig
"
${
FILE_NAME
%.*
}
.runtimeconfig.json"
${
XUNIT_CONSOLE
}
$FILE_NAME
-xml
${
LOG_DIR
}
/
${
LOG_NAME
}
echo
"Running
${
file_name
}
"
if
[
$?
-ne
0
]
;
then
dotnet
exec
--depsfile
"
${
deps_json
}
"
--runtimeconfig
"
${
runtimeconfig_json
}
"
${
xunit_console
}
"
$file_name
"
-xml
"
${
log_file
}
"
if
[[
$?
-ne
0
]]
;
then
echo
Unit
test
failed
echo
Unit
test
failed
exit
1
exit
1
fi
fi
popd
done
done
popd
cibuild.sh
浏览文件 @
a005d688
...
@@ -19,9 +19,11 @@ usage()
...
@@ -19,9 +19,11 @@ usage()
}
}
THIS_DIR
=
$(
cd
-P
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
THIS_DIR
=
$(
cd
-P
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
BINARIES_PATH
=
${
THIS_DIR
}
/Binaries
source
${
THIS_DIR
}
/build/scripts/build-utils.sh
ROOT_PATH
=
$(
get_repo_dir
)
BINARIES_PATH
=
${
ROOT_PATH
}
/Binaries
BOOTSTRAP_PATH
=
${
BINARIES_PATH
}
/Bootstrap
BOOTSTRAP_PATH
=
${
BINARIES_PATH
}
/Bootstrap
SRC_PATH
=
${
THIS_DIR
}
/src
SRC_PATH
=
${
ROOT_PATH
}
/src
BUILD_LOG_PATH
=
${
BINARIES_PATH
}
/Build.log
BUILD_LOG_PATH
=
${
BINARIES_PATH
}
/Build.log
TARGET_FRAMEWORK
=
netcoreapp2.0
TARGET_FRAMEWORK
=
netcoreapp2.0
...
@@ -95,18 +97,18 @@ fi
...
@@ -95,18 +97,18 @@ fi
# obtain_dotnet.sh puts the right dotnet on the PATH
# obtain_dotnet.sh puts the right dotnet on the PATH
FORCE_DOWNLOAD
=
true
FORCE_DOWNLOAD
=
true
source
${
THIS_DIR
}
/build/scripts/obtain_dotnet.sh
source
${
ROOT_PATH
}
/build/scripts/obtain_dotnet.sh
RUNTIME_ID
=
$(
dotnet
--info
|
awk
'/RID:/{print $2;}'
)
RUNTIME_ID
=
$(
dotnet
--info
|
awk
'/RID:/{print $2;}'
)
echo
"Using Runtime Identifier:
${
RUNTIME_ID
}
"
echo
"Using Runtime Identifier:
${
RUNTIME_ID
}
"
RESTORE_ARGS
=
"-r
${
RUNTIME_ID
}
-v Minimal --disable-parallel"
RESTORE_ARGS
=
"-r
${
RUNTIME_ID
}
-v Minimal --disable-parallel"
echo
"Restoring BaseToolset.csproj"
echo
"Restoring BaseToolset.csproj"
dotnet restore
${
RESTORE_ARGS
}
${
THIS_DIR
}
/build/ToolsetPackages/BaseToolset.csproj
dotnet restore
${
RESTORE_ARGS
}
${
ROOT_PATH
}
/build/ToolsetPackages/BaseToolset.csproj
echo
"Restoring CoreToolset.csproj"
echo
"Restoring CoreToolset.csproj"
dotnet restore
${
RESTORE_ARGS
}
${
THIS_DIR
}
/build/ToolsetPackages/CoreToolset.csproj
dotnet restore
${
RESTORE_ARGS
}
${
ROOT_PATH
}
/build/ToolsetPackages/CoreToolset.csproj
echo
"Restoring CrossPlatform.sln"
echo
"Restoring CrossPlatform.sln"
dotnet restore
${
RESTORE_ARGS
}
${
THIS_DIR
}
/CrossPlatform.sln
dotnet restore
${
RESTORE_ARGS
}
${
ROOT_PATH
}
/CrossPlatform.sln
BUILD_ARGS
=
"--no-restore -c
${
BUILD_CONFIGURATION
}
/nologo /consoleloggerparameters:Verbosity=minimal;summary /filelogger /fileloggerparameters:Verbosity=normal;logFile=
${
BUILD_LOG_PATH
}
/maxcpucount:1"
BUILD_ARGS
=
"--no-restore -c
${
BUILD_CONFIGURATION
}
/nologo /consoleloggerparameters:Verbosity=minimal;summary /filelogger /fileloggerparameters:Verbosity=normal;logFile=
${
BUILD_LOG_PATH
}
/maxcpucount:1"
PUBLISH_ARGS
=
"-f
${
TARGET_FRAMEWORK
}
-r
${
RUNTIME_ID
}
${
BUILD_ARGS
}
"
PUBLISH_ARGS
=
"-f
${
TARGET_FRAMEWORK
}
-r
${
RUNTIME_ID
}
${
BUILD_ARGS
}
"
...
@@ -119,10 +121,10 @@ rm -rf ${BINARIES_PATH}/${BUILD_CONFIGURATION}
...
@@ -119,10 +121,10 @@ rm -rf ${BINARIES_PATH}/${BUILD_CONFIGURATION}
BUILD_ARGS+
=
" /p:CscToolPath=
${
BOOTSTRAP_PATH
}
/csc /p:CscToolExe=csc /p:VbcToolPath=
${
BOOTSTRAP_PATH
}
/vbc /p:VbcToolExe=vbc"
BUILD_ARGS+
=
" /p:CscToolPath=
${
BOOTSTRAP_PATH
}
/csc /p:CscToolExe=csc /p:VbcToolPath=
${
BOOTSTRAP_PATH
}
/vbc /p:VbcToolExe=vbc"
echo
"Building CrossPlatform.sln"
echo
"Building CrossPlatform.sln"
dotnet build
${
THIS_DIR
}
/CrossPlatform.sln
${
BUILD_ARGS
}
dotnet build
${
ROOT_PATH
}
/CrossPlatform.sln
${
BUILD_ARGS
}
if
[[
"
${
SKIP_TESTS
}
"
==
false
]]
if
[[
"
${
SKIP_TESTS
}
"
==
false
]]
then
then
echo
"Running tests"
echo
"Running tests"
${
THIS_DIR
}
/build/scripts/tests.sh
${
BUILD_CONFIGURATION
}
${
ROOT_PATH
}
/build/scripts/tests.sh
${
BUILD_CONFIGURATION
}
fi
fi
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录