set __unprocessedBuildArgs=
set __RunArgs=
set __BuildAgainstPackagesArg=
+set __BuildAgainstPackagesMsbuildArg=
set __SkipRestorePackages=
set __SkipManaged=
set __SkipNative=
@REM appears to CMD parsing as "-priority 1". Handle -priority specially to avoid problems,
@REM and allow the "-priority=1" syntax.
set __Priority=0
+set __PriorityArg=
+set __PassThroughArg=
:Arg_Loop
if "%1" == "" goto ArgsDone
if /i "%1" == "skipnative" (set __SkipNative=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "buildtesthostonly" (set __SkipNative=1&set __SkipManaged=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "toolset_dir" (set __ToolsetDir=%2&set __PassThroughArgs=%__PassThroughArgs% %2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
-if /i "%1" == "buildagainstpackages" (set __ZipTests=1&set __BuildAgainstPackagesArg=-BuildTestsAgainstPackages&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
+if /i "%1" == "buildagainstpackages" (set __ZipTests=1&set __BuildAgainstPackagesArg=-BuildTestsAgainstPackages&set __BuildAgainstPackagesMsbuildArg=/p:BuildTestsAgainstPackages=true&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "skiprestorepackages" (set __SkipRestorePackages=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "ziptests" (set __ZipTests=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "crossgen" (set __DoCrossgen=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "targetsNonWindows" (set __TargetsWindows=0&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "Exclude" (set __Exclude=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
if /i "%1" == "-priority" (set __Priority=%2&shift&set processedArgs=!processedArgs! %1=%2&shift&goto Arg_Loop)
+if /i "%1" == "--" (set __PassThroughArg=%1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if [!processedArgs!]==[] (
set __UnprocessedBuildArgs=%__args%
:ArgsDone
@REM Special handling for -priority=N argument.
-if %__Priority% GTR 0 (set "__UnprocessedBuildArgs=!__UnprocessedBuildArgs! -priority=%__Priority%")
+if %__Priority% GTR 0 (set "__PriorityArg=-priority=%__Priority%")
if defined __BuildAgainstPackagesArg (
if not defined __RuntimeID (
@if defined _echo @echo on
set __RunArgs=-BuildOS=%__BuildOS% -BuildType=%__BuildType% -BuildArch=%__BuildArch%
+REM As we move from buildtools to arcade, __RunArgs should be replaced with __msbuildArgs
+set __msbuildArgs=/p:__BuildOS=%__BuildOS% /p:__BuildType=%__BuildType% /p:__BuildArch=%__BuildArch%
if defined __ToolsetDir (
rem arm64 builds currently use private toolset which has not been released yet
REM =========================================================================================
call "%__ProjectDir%\init-tools.cmd"
@if defined _echo @echo on
+set "__ToolsDir=%__ProjectDir%\Tools"
+set "__DotnetHost=%__ToolsDir%\dotnetcli\dotnet.exe"
+if not exist "%__DotnetHost%" (
+ echo %__DotnetHost% not found after init-tools.
+ exit /b 1
+)
REM =========================================================================================
REM ===
set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
-call "%__ProjectDir%\run.cmd" build -Project="%__NativeTestIntermediatesDir%\install.vcxproj" -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__msbuildNativeArgs% %__RunArgs% %__unprocessedBuildArgs%
+call "%__ProjectDir%\run.cmd" build -Project="%__NativeTestIntermediatesDir%\install.vcxproj" -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__msbuildNativeArgs% %__RunArgs% %__PriorityArg% %__PassThroughArg% %__unprocessedBuildArgs%
if errorlevel 1 (
echo %__MsgPrefix%Error: build failed. Refer to the build log files for details:
echo %__BuildLog%
set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
-call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\build.proj -BatchRestorePackages -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs%
+call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\build.proj -BatchRestorePackages -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__PriorityArg% %__PassThroughArg% %__unprocessedBuildArgs%
if not defined __BuildAgainstPackagesArg goto SkipRestoreProduct
set __BuildLogRootName=Tests_GenerateRuntimeLayout
set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
-call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\runtest.proj -BinPlaceRef -BinPlaceProduct -CopyCrossgenToProduct -RuntimeId="%__RuntimeId%" -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs%
+call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\runtest.proj -BinPlaceRef -BinPlaceProduct -CopyCrossgenToProduct -RuntimeId="%__RuntimeId%" -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__PriorityArg% %__PassThroughArg% %__unprocessedBuildArgs%
if errorlevel 1 (
echo BinPlace of mscorlib.dll failed
exit /b 1
set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%";Append=!__AppendToLog!
set TestBuildSlice=%%G
- call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\build.proj -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__unprocessedBuildArgs%
+ call "%__ProjectDir%\run.cmd" build -Project=%__ProjectDir%\tests\build.proj -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %__PriorityArg% %__PassThroughArg% %__unprocessedBuildArgs%
if errorlevel 1 (
echo %__MsgPrefix%Error: build failed. Refer to the build log files for details:
)
set TargetsWindowsArg=
+set TargetsWindowsMsbuildArg=
if "%__TargetsWindows%"=="1" (
set TargetsWindowsArg=-TargetsWindows=true
+ set TargetsWindowsMsbuildArg=/p:TargetsWindows=true
) else if "%__TargetsWindows%"=="0" (
set TargetsWindowsArg=-TargetsWindows=false
+ set TargetsWindowsMsbuildArg=/p:TargetsWindows=false
)
echo %__MsgPrefix%Creating test overlay...
set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
-call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\runtest.proj -testOverlay -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %RuntimeIdArg% %__unprocessedBuildArgs%
+call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\runtest.proj -testOverlay -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %RuntimeIdArg% %__PriorityArg% %__PassThroughArg% %__unprocessedBuildArgs%
if errorlevel 1 (
echo %__MsgPrefix%Error: build failed. Refer to the build log files for details:
echo %__BuildLog%
set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
-call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\runtest.proj -testHost -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %RuntimeIdArg% %__unprocessedBuildArgs%
+call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\runtest.proj -testHost -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %RuntimeIdArg% %__PriorityArg% %__PassThroughArg% %__unprocessedBuildArgs%
if errorlevel 1 (
echo %__MsgPrefix%Error: build failed. Refer to the build log files for details:
echo %__BuildLog%
set __msbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
set __msbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
-call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\runtest.proj -BuildWrappers -MsBuildEventLogging=" " -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %TargetsWindowsArg% %__unprocessedBuildArgs%
+REM Build wrappers using the local SDK's msbuild. As we move to arcade, the other builds should be moved away from run.exe as well.
+call %__DotnetHost% msbuild %__ProjectDir%\tests\runtest.proj /p:BuildWrappers=true !__msbuildLog! !__msbuildWrn! !__msbuildErr! %__msbuildArgs% %TargetsWindowsMsbuildArg% %__BuildAgainstPackagesMsbuildArg% %__unprocessedBuildArgs%
if errorlevel 1 (
echo Xunit Wrapper build failed
exit /b 1
REM ===
REM =========================================================================================
-call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\helixprep.proj -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %RuntimeIdArg% %TargetsWindowsArg% %__CrossgenArg% %__unprocessedBuildArgs%
+call %__ProjectDir%\run.cmd build -Project=%__ProjectDir%\tests\helixprep.proj -MsBuildLog=!__msbuildLog! -MsBuildWrn=!__msbuildWrn! -MsBuildErr=!__msbuildErr! %__RunArgs% %__BuildAgainstPackagesArg% %RuntimeIdArg% %TargetsWindowsArg% %__CrossgenArg% %__PriorityArg% %__PassThroughArg% %__unprocessedBuildArgs%
if errorlevel 1 (
echo %__MsgPrefix%Error: build failed. Refer to the build log files for details:
echo %__BuildLog%
# ===
# =========================================================================================
- build_Tests_internal "Restore_Packages" "${__ProjectDir}/tests/build.proj" " -BatchRestorePackages" "Restore product binaries (build tests)"
+ build_Tests_internal "Restore_Packages" "${__ProjectDir}/tests/build.proj" "Restore product binaries (build tests)" "-BatchRestorePackages"
if [ -n "$__UpdateInvalidPackagesArg" ]; then
__up=-updateinvalidpackageversion
mkdir -p $CORE_ROOT
- build_Tests_internal "Tests_Overlay_Managed" "${__ProjectDir}/tests/runtest.proj" "-testOverlay" "Creating test overlay"
+ build_Tests_internal "Tests_Overlay_Managed" "${__ProjectDir}/tests/runtest.proj" "Creating test overlay" "-testOverlay"
chmod +x $__BinDir/corerun
chmod +x $__BinDir/crossgen
# Make sure to copy over the pulled down packages
cp -r $__BinDir/* $CORE_ROOT/ > /dev/null
- # Work hardcoded path around
- if [ ! -f "${__BuildToolsDir}/Microsoft.CSharp.Core.Targets" ]; then
- ln -s "${__BuildToolsDir}/Microsoft.CSharp.Core.targets" "${__BuildToolsDir}/Microsoft.CSharp.Core.Targets"
- fi
- if [ ! -f "${__BuildToolsDir}/Microsoft.CSharp.targets" ]; then
- ln -s "${__BuildToolsDir}/Microsoft.CSharp.Targets" "${__BuildToolsDir}/Microsoft.CSharp.targets"
- fi
-
}
generate_testhost()
echo "${__MsgPrefix}Creating test overlay..."
mkdir -p $TEST_HOST
- build_Tests_internal "Tests_Generate_TestHost" "${__ProjectDir}/tests/runtest.proj" "-testHost" "Creating test host"
+ build_Tests_internal "Tests_Generate_TestHost" "${__ProjectDir}/tests/runtest.proj" "Creating test host" "-testHost"
}
# ===
# =========================================================================================
- build_Tests_internal "Restore_Product" "${__ProjectDir}/tests/build.proj" " -BatchRestorePackages" "Restore product binaries (build tests)"
+ build_Tests_internal "Restore_Product" "${__ProjectDir}/tests/build.proj" "Restore product binaries (build tests)" "-BatchRestorePackages"
if [ -n "$__BuildAgainstPackagesArg" ]; then
- build_Tests_internal "Tests_GenerateRuntimeLayout" "${__ProjectDir}/tests/runtest.proj" "-BinPlaceRef -BinPlaceProduct -CopyCrossgenToProduct" "Restore product binaries (run tests)"
+ build_Tests_internal "Tests_GenerateRuntimeLayout" "${__ProjectDir}/tests/runtest.proj" "Restore product binaries (run tests)" "-BinPlaceRef" "-BinPlaceProduct" "-CopyCrossgenToProduct"
fi
echo "Starting the Managed Tests Build..."
- build_Tests_internal "Tests_Managed" "$__ProjectDir/tests/build.proj" "$__up" "Managed tests build (build tests)"
+ build_Tests_internal "Tests_Managed" "$__ProjectDir/tests/build.proj" "Managed tests build (build tests)" "$__up"
if [ $? -ne 0 ]; then
echo "${__MsgPrefix}Error: build failed. Refer to the build log files for details (above)"
if [ ! -f $__XUnitWrapperBuiltMarker ]; then
- build_Tests_internal "Tests_XunitWrapper" "$__ProjectDir/tests/runtest.proj" "-BuildWrappers -MsBuildEventLogging=\" \" " "Test Xunit Wrapper"
+ build_Tests_internal "Tests_XunitWrapper" "$__ProjectDir/tests/runtest.proj" "Test Xunit Wrapper" "-BuildWrappers" "-MsBuildEventLogging= " "-TargetsWindows=false"
if [ $? -ne 0 ]; then
echo "${__MsgPrefix}Error: build failed. Refer to the build log files for details (above)"
if [ $__ZipTests -ne 0 ]; then
echo "${__MsgPrefix}ZIP tests packages..."
- build_Tests_internal "Helix_Prep" "$__ProjectDir/tests/helixprep.proj" " " "Prep test binaries for Helix publishing"
+ build_Tests_internal "Helix_Prep" "$__ProjectDir/tests/helixprep.proj" "Prep test binaries for Helix publishing" " "
fi
}
build_Tests_internal()
{
subDirectoryName=$1
- projectName=$2
- extraBuildParameters=$3
- stepName="$4"
+ shift
+ projectName=$1
+ shift
+ stepName="$1"
+ shift
+ extraBuildParameters=("$@")
# Set up directories and file names
__BuildLogRootName=$subDirectoryName
__BuildWrn="$__LogsDir/${__BuildLogRootName}.${__BuildOS}.${__BuildArch}.${__BuildType}.wrn"
__BuildErr="$__LogsDir/${__BuildLogRootName}.${__BuildOS}.${__BuildArch}.${__BuildType}.err"
+ # Use binclashlogger by default if no other logger is specified
+ if [[ "${extraBuildParameters[*]}" == *"-MsBuildEventLogging"* ]]; then
+ msbuildEventLogging=""
+ else
+ msbuildEventLogging="-MsBuildEventLogging=\"/l:BinClashLogger,Tools/Microsoft.DotNet.Build.Tasks.dll;LogFile=binclash.log\""
+ fi
+
if [[ "$subDirectoryName" == "Tests_Managed" ]]; then
# Execute msbuild managed test build in stages - workaround for excessive data retention in MSBuild ConfigCache
# See https://github.com/Microsoft/msbuild/issues/2993
export TestBuildSlice=$slice
# Generate build command
- buildCommand="$__ProjectRoot/run.sh build -Project=$projectName -MsBuildLog=${__msbuildLog} -MsBuildWrn=${__msbuildWrn} -MsBuildErr=${__msbuildErr} -MsBuildEventLogging=\"/l:BinClashLogger,Tools/Microsoft.DotNet.Build.Tasks.dll;LogFile=binclash.log\" $extraBuildParameters $__RunArgs $__UnprocessedBuildArgs"
+ buildArgs=("-Project=$projectName" "-MsBuildLog=${__msbuildLog}" "-MsBuildWrn=${__msbuildWrn}" "-MsBuildErr=${__msbuildErr}")
+ buildArgs+=("$msbuildEventLogging")
+ buildArgs+=("${extraBuildParameters[@]}")
+ buildArgs+=("${__RunArgs[@]}")
+ buildArgs+=("${__UnprocessedBuildArgs[@]}")
echo "Building step '$stepName' slice=$slice via $buildCommand"
# Invoke MSBuild
- eval $buildCommand
+ "$__ProjectRoot/run.sh" build "${buildArgs[@]}"
# Make sure everything is OK
if [ $? -ne 0 ]; then
__msbuildErr="\"/flp2:ErrorsOnly;LogFile=${__BuildErr}\""
# Generate build command
- buildCommand="$__ProjectRoot/run.sh build -Project=$projectName -MsBuildLog=${__msbuildLog} -MsBuildWrn=${__msbuildWrn} -MsBuildErr=${__msbuildErr} -MsBuildEventLogging=\"/l:BinClashLogger,Tools/Microsoft.DotNet.Build.Tasks.dll;LogFile=binclash.log\" $extraBuildParameters $__RunArgs $__UnprocessedBuildArgs"
+ buildArgs=("-Project=$projectName" "-MsBuildLog=${__msbuildLog}" "-MsBuildWrn=${__msbuildWrn}" "-MsBuildErr=${__msbuildErr}")
+ buildArgs+=("$msbuildEventLogging")
+ buildArgs+=("${extraBuildParameters[@]}")
+ buildArgs+=("${__RunArgs[@]}")
+ buildArgs+=("${__UnprocessedBuildArgs[@]}")
echo "Building step '$stepName' via $buildCommand"
# Invoke MSBuild
- eval $buildCommand
-
- # Invoke MSBuild
- # $__ProjectRoot/run.sh build -Project=$projectName -MsBuildLog="$__msbuildLog" -MsBuildWrn="$__msbuildWrn" -MsBuildErr="$__msbuildErr" $extraBuildParameters $__RunArgs $__UnprocessedBuildArgs
+ "$__ProjectRoot/run.sh" build "${buildArgs[@]}"
# Make sure everything is OK
if [ $? -ne 0 ]; then
__NativeTestIntermediatesDir=
__RunTests=0
__RebuildTests=0
-__BuildTestWrappers=0
+__BuildTestWrappers=1
__GenerateLayoutOnly=
__GenerateTestHostOnly=
__priority1=
;;
priority1)
__priority1=1
- __UnprocessedBuildArgs="$__UnprocessedBuildArgs -priority=1"
+ __UnprocessedBuildArgs+=("-priority=1")
;;
*)
- __UnprocessedBuildArgs="$__UnprocessedBuildArgs $1"
+ __UnprocessedBuildArgs+=("$1")
;;
esac
done
-__RunArgs="-BuildArch=$__BuildArch -BuildType=$__BuildType -BuildOS=$__BuildOS"
+__RunArgs=("-BuildArch=$__BuildArch" "-BuildType=$__BuildType" "-BuildOS=$__BuildOS")
# Configure environment if we are doing a verbose build
if [ $__VerboseBuild == 1 ]; then
export VERBOSE=1
- __RunArgs="$__RunArgs -verbose"
+ __RunArgs+=("-verbose")
fi
# Set default clang version
isMSBuildOnNETCoreSupported
-# CI_SPECIFIC - On CI machines, $HOME may not be set. In such a case, create a subfolder and set the variable to set.
+# CI_SPECIFIC - On CI machines, $HOME may not be set. In such a case, create a subfolder and set the variable to it.
# This is needed by CLI to function.
if [ -z "$HOME" ]; then
if [ ! -d "$__ProjectDir/temp_home" ]; then
},
"inputs": {
"filename": "build-test.cmd",
- "arguments": "$(ParentBuildType) $(Architecture) buildagainstpackages runtimeid $(Rid) $(TargetsNonWindowsArg)$(CrossgenArg)-OfficialBuildId=$(ParentOfficialBuildId) -OverwriteCoreClrPackageVersion -Priority=$(Priority) -- /p:IntermediateAzureFeed=$(IntermediateAzureFeed)",
+ "arguments": "$(ParentBuildType) $(Architecture) buildagainstpackages runtimeid $(Rid) $(TargetsNonWindowsArg) $(CrossgenArg) -Priority=$(Priority) -- /p:OfficialBuildId=$(ParentOfficialBuildId) /p:OverwriteCoreClrPackageVersion=true /p:IntermediateAzureFeed=$(IntermediateAzureFeed)",
"workingFolder": "",
"failOnStandardError": "false"
}
<MicrosoftNETCorePlatformsPackageVersion>3.0.0-preview1-26717-04</MicrosoftNETCorePlatformsPackageVersion>
<PgoDataPackageVersion>99.99.99-master-20180718-0214</PgoDataPackageVersion>
<MicrosoftNETCoreRuntimeCoreCLRPackageVersion>3.0.0-preview1-26719-01</MicrosoftNETCoreRuntimeCoreCLRPackageVersion>
- <XunitPackageVersion>2.2.0-beta2-build3300</XunitPackageVersion>
- <XunitConsoleNetcorePackageVersion>2.2.0-preview1-02830-02</XunitConsoleNetcorePackageVersion>
+ <XunitPackageVersion>2.4.0-beta.2.build4010</XunitPackageVersion>
<XunitPerformanceApiPackageVersion>1.0.0-beta-build0015</XunitPerformanceApiPackageVersion>
<MicrosoftDiagnosticsTracingTraceEventPackageVersion>2.0.4</MicrosoftDiagnosticsTracingTraceEventPackageVersion>
<CommandLineParserVersion>2.2.0</CommandLineParserVersion>
<Version>$(XunitPerformanceApiPackageVersion)</Version>
</StaticDependency>
- <StaticDependency Include="xunit.console.netcore">
- <Version>$(XunitConsoleNetcorePackageVersion)</Version>
- </StaticDependency>
-
<DependencyBuildInfo Include="@(StaticDependency)">
<PackageId>%(Identity)</PackageId>
<UpdateStableVersions>true</UpdateStableVersions>
--- /dev/null
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <!-- This file contains build properties that apply to product
+ projects and test projects. It's imported by
+ tests/dir.common.props, and the global dir.props. -->
+
+ <PropertyGroup>
+ <CoreclrDir>$(MSBuildThisFileDirectory)</CoreclrDir>
+ <PackagesDir>$(CoreclrDir)/packages</PackagesDir>
+ </PropertyGroup>
+
+ <!-- Set default Configuration and Platform -->
+ <PropertyGroup>
+ <BuildArch>$(__BuildArch)</BuildArch>
+ <BuildArch Condition="'$(__BuildArch)'==''">x64</BuildArch>
+ <BuildArch Condition="'$(__BuildArch)' == 'amd64'">x64</BuildArch>
+
+ <BuildType>$(__BuildType)</BuildType>
+ <BuildType Condition="'$(__BuildType)'==''">Debug</BuildType>
+ <BuildType Condition="'$(__BuildType)' == 'debug'">Debug</BuildType>
+ <BuildType Condition="'$(__BuildType)' == 'release'">Release</BuildType>
+ <BuildType Condition="'$(__BuildType)' == 'checked'">Checked</BuildType>
+
+ <BuildOS>$(__BuildOS)</BuildOS>
+ <BuildOS Condition="'$(__BuildOS)' == ''">Windows_NT</BuildOS>
+
+ <Configuration Condition="'$(Configuration)' == ''">$(BuildType)</Configuration>
+ <Platform Condition="'$(Platform)' == ''">$(BuildArch)</Platform>
+ </PropertyGroup>
+
+ <PropertyGroup>
+ <RestorePackagesPath>$(PackagesDir)</RestorePackagesPath>
+ </PropertyGroup>
+
+
+</Project>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Condition="Exists('..\dir.props')" Project="..\dir.props" />
+ <Import Project="dir.common.props" />
+
<!--
$(OS) is set to Unix/Windows_NT. This comes from an environment variable on Windows and MSBuild on Unix.
-->
<!-- Common properties -->
<PropertyGroup>
- <!-- Set basic properties and normalize -->
- <BuildArch>$(__BuildArch)</BuildArch>
- <BuildArch Condition="'$(__BuildArch)'==''">x64</BuildArch>
- <BuildArch Condition="'$(__BuildArch)' == 'amd64'">x64</BuildArch>
-
- <BuildType Condition="'$(__BuildType)'==''">Debug</BuildType>
- <BuildType Condition="'$(__BuildType)' == 'debug'">Debug</BuildType>
- <BuildType Condition="'$(__BuildType)' == 'release'">Release</BuildType>
- <BuildType Condition="'$(__BuildType)' == 'checked'">Checked</BuildType>
-
- <BuildOS>$(__BuildOS)</BuildOS>
- <BuildOS Condition="'$(__BuildOS)' == ''">Windows_NT</BuildOS>
<ProjectDir>$(__ProjectDir)\</ProjectDir>
<ProjectDir Condition="'$(__ProjectDir)'==''">$(MSBuildThisFileDirectory)</ProjectDir>
dotnet=$toolRuntime/dotnetcli/dotnet
echo "Running: $dotnet $toolRuntime/run.exe $working_tree_root/config.json $*"
-$dotnet $toolRuntime/run.exe $working_tree_root/config.json $*
+$dotnet $toolRuntime/run.exe $working_tree_root/config.json "$@"
if [ $? -ne 0 ]
then
echo "ERROR: An error occured in $dotnet $toolRuntime/run $#. Check $# logs under $working_tree_root."
<RestoreProjects Include="$(MSBuildThisFileDirectory)src\JIT\config\benchmark+serialize\benchmark+serialize.csproj" />
<RestoreProjects Include="$(MSBuildThisFileDirectory)src\JIT\config\benchmark\benchmark.csproj" />
<RestoreProjects Include="$(MSBuildThisFileDirectory)src\performance\performance.csproj" />
- <RestoreProjects Include="$(MSBuildThisFileDirectory)src\TestWrappersConfig\TestWrappersConfig.csproj" />
</ItemGroup>
<Target Name="BuildTargetingPack" AfterTargets="BatchRestorePackages" Condition="$(__SkipTargetingPackBuild) != 'true'">
--- /dev/null
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="../dir.common.props" />
+
+ <!-- This file contains common build properties for projects under
+ the test tree, and also generated test projects in
+ bin/tests. It currently has only those properties that are
+ shared between buildtools test projects and SDK-style test
+ projects. Eventually every test project should build using the
+ SDK. Some test projects still bypass this by importing
+ tests/dir.props directly - these should eventually go away. -->
+
+ <PropertyGroup>
+ <OSPlatformConfig>$(BuildOS).$(Platform).$(Configuration)</OSPlatformConfig>
+
+ <TestSrcDir>$(CoreclrDir)/tests/src</TestSrcDir>
+ <BuildProjectRelativeDir>$([System.String]::Copy('$(MSBuildProjectDirectary)').Replace($(TestSrcDir),''))/$(MSBuildProjectName)</BuildProjectRelativeDir>
+
+ <!-- BaseIntermediateOutputPath is used by the SDK as the location
+ for the lock file, and props/targets from nuget packages. -->
+ <BaseIntermediateOutputPath>$(CoreclrDir)/bin/tests/obj/$(OSPlatformConfig)/Managed/$(BuildProjectRelativeDir)</BaseIntermediateOutputPath>
+ <IntermediateOutputPath>$(BaseIntermediateOutputPath)</IntermediateOutputPath>
+
+ <BaseOutputPath>$(CoreclrDir)/bin/tests/$(OSPlatformConfig)/$(BuildProjectRelativeDir)</BaseOutputPath>
+ <OutputPath>$(BaseOutputPath)</OutputPath>
+
+ </PropertyGroup>
+
+</Project>
<BuildToolsTargets45>$(BuildToolsTargetsDesktop)</BuildToolsTargets45>
<RunningOnUnix Condition="('$(RunningOnUnix)' == '') And ('$(MSBuildRuntimeType)' == 'Core') And ('$(OS)'!='Windows_NT')">true</RunningOnUnix>
<UseBuildTools>true</UseBuildTools>
- <UseBuildTools Condition="'$(OS)'=='Windows_NT' And '$(RunningOnCore)' == 'true'">false</UseBuildTools>
</PropertyGroup>
<!-- Common repo directories -->
<DotnetCliPath Condition="'$(DotnetCliPath)'==''">$(ToolsDir)dotnetcli\</DotnetCliPath>
<BuildToolsTaskDir Condition="'$(BuildToolsTargets45)' == 'true'">$(ToolsDir)net46\</BuildToolsTaskDir>
<OverrideToolHost Condition="'$(OS)' != 'Windows_NT'">$(DotnetCliPath)dotnet</OverrideToolHost>
- <CSharpCoreTargetsPath Condition="('$(BuildToolsTargetsDesktop)' != 'true') And ('$(UseBuildTools)'=='true')">$(ToolsDir)\Microsoft.CSharp.Core.targets</CSharpCoreTargetsPath>
<!-- We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two properties to any folder that exists to skip
the GenerateReferenceAssemblyPaths task (not target) and to prevent it from outputting a warning (MSB3644). -->
<_TargetFrameworkDirectories Condition="'$(BuildToolsTargetsDesktop)' != 'true'">$(MSBuildThisFileDirectory)/Documentation</_TargetFrameworkDirectories>
</PropertyGroup>
<!-- Use Roslyn Compilers to build -->
- <Import Project="$(RoslynPropsFile)" Condition="'$(RunningOnUnix)'!='true' and Exists('$(RoslynPropsFile)') and '$(UseRoslynCompilers)'!='false' and '$(RoslynIncompatibleMsbuildVersion)' != 'true'" />
- <Import Project="$(RoslynPropsFile)" Condition="'$(RunningOnUnix)'=='true' and Exists('$(RoslynPropsFile)') and '$(RoslynIncompatibleMsbuildVersion)' != 'true'" />
+ <Import Project="$(RoslynPropsFile)" Condition="Exists('$(RoslynPropsFile)') and '$(RoslynIncompatibleMsbuildVersion)' != 'true'" />
<PropertyGroup Condition="'$(BuildAllProjects)'=='true'">
<!-- When we do a traversal build we get all packages up front, don't restore them again -->
--- /dev/null
+<Project>
+ <Import Project="dir.common.props" />
+
+ <!-- This file contains build properties that apply only to
+ SDK-style test projects. Properties that are shared between SDK
+ and buildtools projects should go in dir.common.props. -->
+
+ <PropertyGroup>
+ <TargetFramework>netcoreapp2.0</TargetFramework>
+ <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
+ <EnableDefaultCompileItems>false</EnableDefaultCompileItems>
+ </PropertyGroup>
+
+</Project>
Inputs="@(XunitDlls)"
Outputs="$(TestWorkingDir)archive\**" >
- <Copy SourceFiles="$(CORE_ROOT)\xunit.console.netcore.exe"
+ <Copy SourceFiles="$(CORE_ROOT)\xunit.console.dll"
DestinationFolder="%(XunitDlls.RootDir)%(XunitDlls.Directory)"
/>
<Message Text="Deleting '.requires_signing' files to avoid file name lengths exceeding MAX_PATH" Importance="Low" />
$(CmdCrossgenVar)
ECHO BEGIN EXECUTION
-ECHO %HELIX_CORRELATION_PAYLOAD%\CoreRun.exe %HELIX_WORKITEM_PAYLOAD%\xunit.console.netcore.exe %HELIX_WORKITEM_PAYLOAD%\$(ProjectName) -noshadow -xml testResults.xml -notrait category=outerloop -notrait category=failing
-%HELIX_CORRELATION_PAYLOAD%\CoreRun.exe %HELIX_WORKITEM_PAYLOAD%\xunit.console.netcore.exe %HELIX_WORKITEM_PAYLOAD%\$(ProjectName) -noshadow -xml testResults.xml -notrait category=outerloop -notrait category=failing
+ECHO %HELIX_CORRELATION_PAYLOAD%\CoreRun.exe %HELIX_WORKITEM_PAYLOAD%\xunit.console.dll %HELIX_WORKITEM_PAYLOAD%\$(ProjectName) -noshadow -xml testResults.xml -notrait category=outerloop -notrait category=failing
+%HELIX_CORRELATION_PAYLOAD%\CoreRun.exe %HELIX_WORKITEM_PAYLOAD%\xunit.console.dll %HELIX_WORKITEM_PAYLOAD%\$(ProjectName) -noshadow -xml testResults.xml -notrait category=outerloop -notrait category=failing
echo Finished running tests. Exit code = %ERRORLEVEL%
EXIT /B %ERRORLEVEL%
<WrapperShContents Condition="'$(Crossgen)' == 'true'">$(WrapperShContents)%0a</WrapperShContents>
<WrapperShContents>$(WrapperShContents)echo BEGIN EXECUTION%0a</WrapperShContents>
- <WrapperShContents>$(WrapperShContents)echo "%24{HELIX_CORRELATION_PAYLOAD}/corerun" %24HELIX_WORKITEM_PAYLOAD/xunit.console.netcore.exe %24HELIX_WORKITEM_PAYLOAD/$(ProjectName) -noshadow -xml testResults.xml -notrait category=outerloop -notrait category=failing%0a</WrapperShContents>
- <WrapperShContents>$(WrapperShContents)"%24{HELIX_CORRELATION_PAYLOAD}/corerun" %24HELIX_WORKITEM_PAYLOAD/xunit.console.netcore.exe %24HELIX_WORKITEM_PAYLOAD/$(ProjectName) -noshadow -xml testResults.xml -notrait category=outerloop -notrait category=failing%0a</WrapperShContents>
+ <WrapperShContents>$(WrapperShContents)echo "%24{HELIX_CORRELATION_PAYLOAD}/corerun" %24HELIX_WORKITEM_PAYLOAD/xunit.console.dll %24HELIX_WORKITEM_PAYLOAD/$(ProjectName) -noshadow -xml testResults.xml -notrait category=outerloop -notrait category=failing%0a</WrapperShContents>
+ <WrapperShContents>$(WrapperShContents)"%24{HELIX_CORRELATION_PAYLOAD}/corerun" %24HELIX_WORKITEM_PAYLOAD/xunit.console.dll %24HELIX_WORKITEM_PAYLOAD/$(ProjectName) -noshadow -xml testResults.xml -notrait category=outerloop -notrait category=failing%0a</WrapperShContents>
<WrapperShContents>$(WrapperShContents)ErrorLevel=%24%3F%0a</WrapperShContents>
<WrapperShContents>$(WrapperShContents)%0a</WrapperShContents>
<WrapperShContents>$(WrapperShContents)echo Finished running tests. Exit code = %24ErrorLevel%0a</WrapperShContents>
Overrides for all other targets (including build tools) can go in this file.
-->
- <!-- Contains overrides for the nuget reference resolution. The regular nuget reference resolution will not
- copy references local, which we need in order to correctly execute the xunit project -->
- <Import Project="xunitwrapper.targets" Condition="'$(IsXunitWrapperProject)'=='true'" />
-
<!-- Override the AddDesignTimeFacadeReferences target to add the ability to reference System.Private.CoreLib.
Some tests use functionality not available in the portable reference assemblies.
For portability reasons it's generally a good idea to reference the facades instead of the
<PropertyGroup>
<XunitTestBinBase Condition="'$(XunitTestBinBase)'==''" >$(BaseOutputPathWithConfig)</XunitTestBinBase>
<XunitWrapperGeneratedCSDirBase>$(XunitTestBinBase)\TestWrappers\</XunitWrapperGeneratedCSDirBase>
- <XunitWrapperOutputIntermediatedDirBase>$(XunitTestBinBase)\Tests\</XunitWrapperOutputIntermediatedDirBase>
<MSBuildEnableAllPropertyFunctions>1</MSBuildEnableAllPropertyFunctions>
</PropertyGroup>
</_XunitWrapperGen>
<XunitWrapperGenCsProj>
<![CDATA[
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project>
+
+ <Import Project="$(ProjectDir)dir.sdkbuild.props" />
- <Import Project="$(SourceDir)dir.props" />
<PropertyGroup>
- <Configuration Condition=" '%24(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '%24(Platform)' == '' ">AnyCPU</Platform>
- <AssemblyName>$(XunitWrapper)</AssemblyName>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <OutputType>Library</OutputType>
- <TargetFrameworkIdentifier Condition ="('$(BuildTestsAgainstPackages)' != 'true') And ('$(BuildOS)' == 'Windows_NT')">.NETFramework</TargetFrameworkIdentifier>
- <TargetFrameworkVersion Condition ="('$(BuildTestsAgainstPackages)' != 'true') And ('$(BuildOS)' == 'Windows_NT')">v4.5</TargetFrameworkVersion>
- <NugetTargetMonikerShort Condition ="'$(BuildTestsAgainstPackages)' != 'true'">net45</NugetTargetMonikerShort>
- <IsXunitWrapperProject>true</IsXunitWrapperProject>
- <SkipSigning>true</SkipSigning>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB}%3B{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <SolutionDir Condition="%24(SolutionDir) == '' Or %24(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <IsTestProject>true</IsTestProject>
- </PropertyGroup>
- <!-- Default configurations to help VS understand the configurations -->
- <PropertyGroup Condition=" '%24(Configuration)|%24(Platform)' == 'Debug|AnyCPU' ">
- </PropertyGroup>
- <PropertyGroup Condition=" '%24(Configuration)|%24(Platform)' == 'Release|AnyCPU' ">
+ <OutputPath>$(XUnitTestBinBase)\$(CategoryWithSlash)</OutputPath>
</PropertyGroup>
+
+ <Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />
+
<ItemGroup>
<Compile Include="$(XunitWrapper).cs" />
</ItemGroup>
+
<ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="$(SourceDir)Common\Desktop.Coreclr.TestWrapper\Desktop.Coreclr.TestWrapper.csproj" Condition="('$(BuildTestsAgainstPackages)' != 'true') And ('$(BuildOS)' == 'Windows_NT')">
- <Project>{8ffe99c0-22f8-4462-b839-970eac1b3472}</Project>
- <Name>coreclr</Name>
- </ProjectReference>
- <ProjectReference Include="$(SourceDir)Common\Coreclr.TestWrapper\Coreclr.TestWrapper.csproj" Condition="('$(BuildTestsAgainstPackages)' == 'true') Or ('$(BuildOS)' != 'Windows_NT')">
- <Project>{8ffe99c0-22f8-4462-b839-970eac1b3472}</Project>
- <Name>coreclr</Name>
- </ProjectReference>
+ <ProjectReference Include="$(SourceDir)Common\Coreclr.TestWrapper\Coreclr.TestWrapper.csproj" />
</ItemGroup>
<ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Runtime" />
- <Reference Include="mscorlib" />
+ <PackageReference Include="xunit" Version="$(XunitPackageVersion)" />
+ <PackageReference Include="xunit.runner.console" Version="$(XunitPackageVersion)" />
</ItemGroup>
- <Import Project="$(SourceDir)dir.targets" />
- <PropertyGroup>
- <OutDir>$(XunitTestBinBase)\$(CategoryWithSlash)\</OutDir>
- <ProjectAssetsFile Condition="'$(BuildTestsAgainstPackages)' != 'true'">%24(TestWrappersPackagesConfigFileDirectory)obj/project.assets.json</ProjectAssetsFile>
- </PropertyGroup>
+
+ <Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
+
</Project>
- ]]>
+]]>
</XunitWrapperGenCsProj>
-
</PropertyGroup>
<!-- <Exec Command="md" -->
</Target>
<Target Name="BuildXunitWrapper">
- <MSBuild Projects="$(XunitWrapperSrcDir)\$(XunitWrapper).csproj"/>
+ <MSBuild Projects="$(XunitWrapperSrcDir)\$(XunitWrapper).csproj" Targets="Restore;Build" />
</Target>
<Target Name="CreateXunitFacts">
<Category Condition="'$(RunningOnUnix)' == 'true'" >$([System.String]::Copy('$(CategoryWithSlash)').Replace('/','.'))</Category>
<XunitWrapper>$(Category).XUnitWrapper</XunitWrapper>
<XunitWrapperSrcDir>$(XunitWrapperGeneratedCSDirBase)$(Category)</XunitWrapperSrcDir>
- <XunitWrapperOutputDir>$(XunitWrapperOutputIntermediatedDirBase)$(Category)</XunitWrapperOutputDir>
</PropertyGroup>
<PropertyGroup>
<_XunitProlog Condition=" '$(_XunitProlog)'=='' ">
{
reportBase = System.Environment.GetEnvironmentVariable(%22XunitTestReportDirBase%22)%3B
testBinaryBase = System.IO.Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath)%3B
- coreRoot = System.IO.Path.GetFullPath(System.Environment.GetEnvironmentVariable(%22CORE_ROOT%22))%3B
+ coreRoot = System.Environment.GetEnvironmentVariable(%22CORE_ROOT%22)%3B
if (String.IsNullOrEmpty(reportBase)) {
reportBase = System.IO.Path.Combine(testBinaryBase, "Reports")%3B
throw new ArgumentException("Environment variable CORE_ROOT is not set")%3B
}
+ coreRoot = System.IO.Path.GetFullPath(coreRoot)%3B
+
string operatingSystem = System.Environment.GetEnvironmentVariable("OS")%3B
runningInWindows = (operatingSystem != null && operatingSystem.StartsWith("Windows"))%3B
}
try
{
CoreclrTestWrapperLib wrapper = new CoreclrTestWrapperLib()%3B
- string testSubfolder = @"\$(Category)\$([System.String]::Copy('%(AllCMDs.RelativeDir)').Replace("$(_CMDDIR)\",''))"%3B
+ string testSubfolder = @"\$(Category)\$([System.String]::Copy('%(AllCMDs.RelativeDir)').Replace("$(_CMDDIR)$([System.IO.Path]::DirectorySeparatorChar)",''))"%3B
outputFile = System.IO.Path.GetFullPath(_Global.reportBase + testSubfolder + @"%(AllCMDs.FileName).output.txt")%3B
errorFile = System.IO.Path.GetFullPath(_Global.reportBase + testSubfolder + @"%(AllCMDs.FileName).error.txt")%3B
testExecutable = System.IO.Path.GetFullPath(_Global.testBinaryBase + @"$([System.String]::Copy('%(AllCMDs.FullPath)').Replace("$(_CMDDIR)",''))")%3B
outputText = "Unable to read output file: " + outputFile%3B
}
- string msg = infraEx != null ? "Test Infrastructure Failure: " + infraEx.Message
+ string msg = infraEx != null ? "Test Infrastructure Failure: " + infraEx.ToString()
: sErrorText + "\n\n" +
"Return code: " + ret + "\n" +
"Raw output file: " + outputFile + "\n" +
<Target Name="GetListOfTestCmds">
<ItemGroup>
- <AllRunnableTestPaths Include="$(XunitTestBinBase)\**\*.cmd" />
+ <AllRunnableTestPaths Include="$(XunitTestBinBase)\**\*.cmd" Condition="'$(BuildOS)' == 'Windows_NT'" />
+ <AllRunnableTestPaths Include="$(XunitTestBinBase)\**\*.sh" Condition="'$(BuildOS)' != 'Windows_NT'" />
</ItemGroup>
</Target>
<!-- Workaround for packages on which Microsoft.NetCoreApp expresses a dependency
The <PackageToInclude> element doesn't allow a version to be specified and we end up with clashing assembly versions in Core_Root-->
<NetCoreAppPackagedAssemblies Include="System.Text.Encoding.CodePages.dll"/>
+ <!-- Use xunit dependencies defined in CoreFX.depproj instead of conflicting versions from test dependencies. -->
+ <TestDependenciesToExclude Include="$(CORE_ROOT)\**\xunit*"/>
+ <CoreCLRBinariesToExclude Include="@(NetCoreAppPackagedAssemblies);@(TestDependenciesToExclude -> '%(Identity)')" />
</ItemGroup>
<ItemGroup>
- <CoreCLRBinaries Include="$(CORE_ROOT)\**\*.*" Exclude="$(CORE_ROOT)\**\@(NetCoreAppPackagedAssemblies -> '%(Identity)' )" />
+ <CoreCLRBinaries Include="$(CORE_ROOT)\**\*.*" Exclude="$(CORE_ROOT)\**\@(CoreCLRBinariesToExclude -> '%(Identity)' )" />
<HostFxFile Include="$(ToolsDir)\dotnetcli\**\$(HostFxrFileName).$(HostFxrFileExtension)" />
<DotnetExe Include="$(ToolsDir)\dotnetcli\$(DotnetExecutableName)" />
<HostPolicyFile Include="$(ToolsDir)\dotnetcli\**\$(HostPolicyFileName).$(HostPolicyExtension)" />
</Target>
<Target Name="Clean">
- <RemoveDir Condition=" '$(BuildWrappers)'=='true'" Directories="$(XunitWrapperGeneratedCSDirBase);$(XunitWrapperOutputIntermediatedDirBase)" ContinueOnError="WarnAndContinue" />
+ <RemoveDir Condition=" '$(BuildWrappers)'=='true'" Directories="$(XunitWrapperGeneratedCSDirBase);" ContinueOnError="WarnAndContinue" />
</Target>
</Project>
--- /dev/null
+#!/usr/bin/env python
+################################################################################
+################################################################################
+#
+# Module: runtest.py
+#
+# Notes:
+#
+# Universal script to setup and run the xunit msbuild test runner.
+#
+# Use the instructions here:
+# https://github.com/dotnet/coreclr/blob/master/Documentation/building/windows-test-instructions.md
+# https://github.com/dotnet/coreclr/blob/master/Documentation/building/unix-test-instructions.md
+#
+################################################################################
+################################################################################
+
+import argparse
+import json
+import os
+import platform
+import shutil
+import subprocess
+import sys
+import tempfile
+
+from collections import defaultdict
+from sys import platform as _platform
+
+################################################################################
+# Argument Parser
+################################################################################
+
+description = ("""Simple script that essentially sets up and runs either runtest.cmd
+ or runtests.sh. This wrapper is necessary to do all the setup work.
+
+ Note that this is required because there is not a unified test runner
+ for coreclr.""")
+
+# Use either - or / to designate switches.
+parser = argparse.ArgumentParser(description=description, prefix_chars='-/')
+
+parser.add_argument("-arch", dest="arch", nargs='?', default="x64")
+parser.add_argument("-build_type", dest="build_type", nargs='?', default="Debug")
+parser.add_argument("-test_location", dest="test_location", nargs="?", default=None)
+parser.add_argument("-core_root", dest="core_root", nargs='?', default=None)
+parser.add_argument("-coreclr_repo_location", dest="coreclr_repo_location", default=os.getcwd())
+
+# Only used on Unix
+parser.add_argument("-test_native_bin_location", dest="test_native_bin_location", nargs='?', default=None)
+
+################################################################################
+# Helper Functions
+################################################################################
+
+def create_and_use_test_env(_os, env, func):
+ """ Create a test env based on the env passed
+
+ Args:
+ _os(str) : OS name
+ env(defaultdict(lambda: None)) : complus variables, key,value dict
+ func(lambda) : lambda to call, after creating the
+ : test_env
+
+ Notes:
+ Using the env passed, create a temporary file to use as the
+ test_env to be passed for runtest.cmd. Note that this only happens
+ on windows, until xunit is used on unix there is no managed code run
+ in runtest.sh.
+ """
+
+ complus_vars = defaultdict(lambda: None)
+
+ for key in env:
+ value = env[key]
+ if "complus" in key.lower():
+ complus_vars[key] = value
+
+ if len(complus_vars.keys()) > 0:
+ print "Found COMPlus variables in the current environment"
+ print
+
+ file_header = None
+
+ if _os == "Windows_NT":
+ file_header = \
+"""@echo off
+REM Temporary test env for test run.
+
+"""
+ else:
+ file_header = \
+"""# Temporary test env for test run.
+
+"""
+
+ with tempfile.NamedTemporaryFile() as test_env:
+ with open(test_env.name, 'w') as file_handle:
+ file_handle.write(file_header)
+
+ for key in complus_vars:
+ value = complus_vars[key]
+ command = None
+ if _os == "Windows_NT":
+ command = "set"
+ else:
+ command = "export"
+
+ print "Unset %s" % key
+ os.environ[key] = ""
+
+ file_handle.write("%s %s=%s%s" % (command, key, value, os.linesep))
+
+ contents = None
+ with open(test_env.name) as file_handle:
+ contents = file_handle.read()
+
+ print
+ print "TestEnv: %s" % test_env.name
+ print
+ print "Contents:"
+ print
+ print contents
+ print
+
+ func(test_env.name)
+
+ else:
+ func(None)
+
+def get_environment():
+ """ Get all the COMPlus_* Environment variables
+
+ Notes:
+ Windows uses msbuild for its test runner. Therefore, all COMPlus
+ variables will need to be captured as a test_env script and passed
+ to runtest.cmd.
+ """
+
+ complus_vars = defaultdict(lambda: "")
+
+ for key in os.environ:
+ if "complus" in key.lower():
+ complus_vars[key] = os.environ[key]
+ os.environ[key] = ''
+ elif "superpmi" in key.lower():
+ complus_vars[key] = os.environ[key]
+ os.environ[key] = ''
+
+ return complus_vars
+
+def call_msbuild(coreclr_repo_location,
+ msbuild_location,
+ host_os,
+ arch,
+ build_type,
+ sequential=False):
+ """ Call msbuild to run the tests built.
+
+ Args:
+ coreclr_repo_location(str) : path to coreclr repo
+ msbuild_location(str) : path to msbuild
+ sequential(bool) : run sequentially if True
+
+ host_os(str) : os
+ arch(str) : architecture
+ build_type(str) : configuration
+
+ Notes:
+ At this point the environment should be setup correctly, including
+ the test_env, should it need to be passed.
+
+ """
+
+ common_msbuild_arguments = ["/nologo", "/nodeReuse:false", "/p:Platform=%s" % arch]
+
+ if sequential:
+ common_msbuild_arguments += ["/p:ParallelRun=false"]
+ else:
+ common_msbuild_arguments += ["/maxcpucount"]
+
+ logs_dir = os.path.join(coreclr_repo_location, "bin", "Logs")
+ if not os.path.isdir(logs_dir):
+ os.makedirs(logs_dir)
+
+ command = [msbuild_location,
+ os.path.join(coreclr_repo_location, "tests", "runtest.proj"),
+ "/p:Runtests=true",
+ "/clp:showcommandline"]
+
+ log_path = os.path.join(logs_dir, "TestRunResults_%s_%s_%s" % (host_os, arch, build_type))
+ build_log = log_path + ".log"
+ wrn_log = log_path + ".wrn"
+ err_log = log_path + ".err"
+
+ msbuild_log_args = ["/fileloggerparameters:\"Verbosity=normal;LogFile=%s\"" % build_log,
+ "/fileloggerparameters1:\"WarningsOnly;LogFile=%s\"" % wrn_log,
+ "/fileloggerparameters2:\"ErrorsOnly;LogFile=%s\"" % err_log,
+ "/consoleloggerparameters:Summary",
+ "/verbosity:diag"]
+
+ command += msbuild_log_args
+
+ command += ["/p:__BuildOS=%s" % host_os,
+ "/p:__BuildArch=%s" % arch,
+ "/p:__BuildType=%s" % build_type,
+ "/p:__LogsDir=%s" % logs_dir]
+
+ if host_os != "Windows_NT":
+ command = ["bash"] + command
+
+ print " ".join(command)
+ subprocess.check_output(command)
+
+def copy_native_test_bin_to_core_root(host_os, path, core_root):
+ """ Recursively copy all files to core_root
+
+ Args:
+ host_os(str) : os
+ path(str) : native test bin location
+ core_root(str) : core_root location
+ """
+ assert os.path.isdir(path) or os.path.isfile(path)
+ assert os.path.isdir(core_root)
+
+ extension = "so" if host_os == "Linux" else "dylib"
+
+ if os.path.isdir(path):
+ for item in os.listdir(path):
+ copy_native_test_bin_to_core_root(host_os, os.path.join(path, item), core_root)
+ elif path.endswith(extension):
+ print "cp -p %s %s" % (path, core_root)
+ shutil.copy2(path, core_root)
+
+def run_tests(host_os,
+ arch,
+ build_type,
+ core_root,
+ coreclr_repo_location,
+ test_location,
+ test_native_bin_location,
+ test_env=None,
+ is_long_gc=False,
+ is_gcsimulator=False,
+ is_jitdasm=False,
+ is_ilasm=False,
+ run_sequential=False):
+ """ Run the coreclr tests
+
+ Args:
+ host_os(str) : os
+ arch(str) : arch
+ build_type(str) : configuration
+ coreclr_repo_location(str) : path to the root of the repo
+ core_root(str) : Core_Root path
+ test_location(str) : Test bin, location
+ test_native_bin_location : Native test components, None and windows.
+ test_env(str) : path to the test_env to be used
+ """
+
+ # Copy all the native libs to core_root
+ if host_os != "Windows_NT":
+ copy_native_test_bin_to_core_root(host_os, os.path.join(test_native_bin_location, "src"), core_root)
+
+ # Setup the msbuild location
+ msbuild_location = os.path.join(coreclr_repo_location, "Tools", "msbuild.%s" % ("cmd" if host_os == "Windows_NT" else "sh"))
+
+ # Setup the environment
+ if is_long_gc:
+ print "Running Long GC Tests, extending timeout to 20 minutes."
+ os.environ["__TestTimeout"] = "1200000" # 1,200,000
+ os.environ["RunningLongGCTests"] = "1"
+
+ if is_gcsimulator:
+ print "Running GCSimulator tests, extending timeout to one hour."
+ os.environ["__TestTimeout"] = "3600000" # 3,600,000
+ os.environ["RunningGCSimulatorTests"] = "1"
+
+ if is_jitdasm:
+ print "Running jit disasm on framework and test assemblies."
+ os.environ["RunningJitDisasm"] = "1"
+
+ if is_ilasm:
+ print "Running ILasm round trip."
+ os.environ["RunningIlasmRoundTrip"] = "1"
+
+ # Set Core_Root
+ os.environ["CORE_ROOT"] = core_root
+
+ # Call msbuild.
+ call_msbuild(coreclr_repo_location,
+ msbuild_location,
+ host_os,
+ arch,
+ build_type,
+ sequential=run_sequential)
+
+
+def setup_args(args):
+ """ Setup the args based on the argparser obj
+
+ Args:
+ args(ArgParser): Parsed arguments
+
+ Notes:
+ If there is no core_root, or test location passed, create a default
+ location using the build type and the arch.
+ """
+
+ host_os = None
+ arch = args.arch
+ build_type = args.build_type
+
+ test_location = args.test_location
+ core_root = args.core_root
+ test_native_bin_location = args.test_native_bin_location
+
+ coreclr_repo_location = args.coreclr_repo_location
+ if os.path.basename(coreclr_repo_location) == "tests":
+ coreclr_repo_location = os.path.dirname(coreclr_repo_location)
+
+ if _platform == "linux" or _platform == "linux2":
+ host_os = "Linux"
+ elif _platform == "darwin":
+ host_os = "OSX"
+ elif _platform == "win32":
+ host_os = "Windows_NT"
+ else:
+ print "Unknown OS: %s" % host_os
+ sys.exit(1)
+
+ assert os.path.isdir(coreclr_repo_location)
+
+ if test_location is None:
+ print "Using default test location."
+ test_location = os.path.join(coreclr_repo_location, "bin", "tests", "%s.%s.%s" % (host_os, arch, build_type))
+ print "TestLocation: %s" % test_location
+ print
+
+ if core_root is None:
+ print "Using default location for core_root."
+ core_root = os.path.join(test_location, "Tests", "Core_Root")
+ print "Core_Root: %s" % core_root
+ print
+
+ if host_os != "Windows_NT":
+ if test_native_bin_location is None:
+ print "Using default location for test_native_bin_location."
+ test_native_bin_location = os.path.join(os.path.join(coreclr_repo_location, "bin", "obj", "%s.%s.%s" % (host_os, arch, build_type), "tests"))
+ print "Native bin location: %s" % test_native_bin_location
+ print
+
+ valid_arches = ["x64", "x86", "arm", "arm64"]
+ if not arch in valid_arches:
+ print "Unsupported architecture: %s." % arch
+ print "Supported architectures: %s" % "[%s]" % ", ".join(valid_arches)
+ sys.exit(1)
+
+ valid_build_types = ["Debug", "Checked", "Release"]
+ if not build_type in valid_build_types:
+ print "Unsupported configuration: %s." % build_type
+ print "Supported configurations: %s" % "[%s]" % ", ".join(valid_build_types)
+ sys.exit(1)
+
+ if not os.path.isdir(test_location):
+ print "Error, test location: %s, does not exist." % test_location
+ sys.exit(1)
+
+ if not os.path.isdir(core_root):
+ print "Error, core_root: %s, does not exist." % core_root
+ sys.exit(1)
+
+ if host_os != "Windows_NT":
+ if not os.path.isdir(test_native_bin_location):
+ print "Error, test_native_bin_location: %s, does not exist." % test_native_bin_location
+ sys.exit(1)
+
+ return host_os, arch, build_type, coreclr_repo_location, core_root, test_location, test_native_bin_location
+
+def setup_tools(host_os, coreclr_repo_location):
+ """ Setup the tools for the repo
+
+ Args:
+ host_os(str) : os
+ coreclr_repo_location(str) : path to coreclr repo
+
+ """
+
+ # Is the tools dir setup
+ setup = False
+ tools_dir = os.path.join(coreclr_repo_location, "Tools")
+
+ is_windows = host_os == "Windows_NT"
+
+ if os.path.isfile(os.path.join(tools_dir, "msbuild.%s" % ("cmd" if is_windows else "sh"))):
+ setup = True
+
+ # init the tools for the repo
+ if not setup:
+ command = None
+ if is_windows:
+ command = [os.path.join(coreclr_repo_location, "init_tools.cmd")]
+ else:
+ command = ["sh", os.path.join(coreclr_repo_location, "init_tools.sh")]
+
+ print " ".join(command)
+ subprocess.check_output(command)
+
+ setup = True
+
+ return setup
+
+################################################################################
+# Main
+################################################################################
+
+def main(args):
+ host_os, arch, build_type, coreclr_repo_location, core_root, test_location, test_native_bin_location = setup_args(args)
+
+ # Setup the tools for the repo.
+ setup_tools(host_os, coreclr_repo_location)
+
+ env = get_environment()
+ ret_code = create_and_use_test_env(host_os,
+ env,
+ lambda path: run_tests(host_os,
+ arch,
+ build_type,
+ core_root,
+ coreclr_repo_location,
+ test_location,
+ test_native_bin_location,
+ test_env=path))
+
+################################################################################
+# __main__
+################################################################################
+
+if __name__ == "__main__":
+ args = parser.parse_args()
+ sys.exit(main(args))
\ No newline at end of file
<PackageReference Include="Microsoft.DotNet.xunit.performance">
<Version>1.0.0-alpha-build0040</Version>
</PackageReference>
- <PackageReference Include="xunit.console.netcore">
- <Version>1.0.2-prerelease-00177</Version>
+ <PackageReference Include="xunit.runner.console">
+ <Version>$(XunitPackageVersion)</Version>
</PackageReference>
<PackageReference Include="Microsoft.DotNet.BuildTools.TestSuite">
<Version>1.0.0-prerelease-00629-04</Version>
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+<Project>
+
+ <Import Project="$([MSBuild]::GetPathOfFileAbove('dir.sdkbuild.props', '$(MSBuildThisFileDirectory)../'))" />
+
+ <Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />
+
<PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <AssemblyName>CoreclrTestWrapperLib</AssemblyName>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <OutputType>Library</OutputType>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <GenerateRunScript>false</GenerateRunScript>
- <CLRTestKind>BuildOnly</CLRTestKind>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
- <!-- Default configurations to help VS understand the configurations -->
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- </PropertyGroup>
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
+
<ItemGroup>
<Compile Include="CoreclrTestWrapperLib.cs" />
</ItemGroup>
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+
+ <Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
+
</Project>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <!-- dir.common.props was deliberately created so that Desktop and .Net Core can share most of the properties do not change it to dir.props-->
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.common.props))\dir.common.props" />
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProjectGuid>{5259DD45-EA34-4EE7-B5C5-430B80384544}</ProjectGuid>
- <OutputType>Library</OutputType>
- <RootNamespace>Coreclr.TestWrapper</RootNamespace>
- <AssemblyName>Coreclr.TestWrapper</AssemblyName>
- <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
- <SkipSigning>true</SkipSigning>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <ProjectJson></ProjectJson>
- <ProjectLockJson></ProjectLockJson>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="mscorlib" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="..\Coreclr.TestWrapper\CoreclrTestWrapperLib.cs" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-</Project>
<NugetRuntimeIdentifier>win7-x64</NugetRuntimeIdentifier>
<ContainsPackageReferences>true</ContainsPackageReferences>
<OutputPath>$(TargetingPackPath)</OutputPath>
- <XUnitRunnerPackageId Condition="'$(TargetGroup)' != 'netfx'">xunit.console.netcore</XUnitRunnerPackageId>
- <XUnitRunnerPackageId Condition="'$(TargetGroup)' == 'netfx'">xunit.runner.console</XUnitRunnerPackageId>
+ <XUnitRunnerPackageId>xunit.runner.console</XUnitRunnerPackageId>
+ <XUnitRunnerTargetFramework>netcoreapp1.0</XUnitRunnerTargetFramework>
<CLRTestKind>SharedLibrary</CLRTestKind>
<IsTestProject>false</IsTestProject>
</PropertyGroup>
<PackageReference Include="xunit">
<Version>$(XunitPackageVersion)</Version>
</PackageReference>
- <PackageReference Include="xunit.console.netcore">
- <Version>$(XunitConsoleNetcorePackageVersion)</Version>
+ <PackageReference Include="$(XUnitRunnerPackageId)">
+ <Version>$(XunitPackageVersion)</Version>
</PackageReference>
<PackageReference Include="xunit.runner.utility">
<Version>$(XunitPackageVersion)</Version>
<PackageToInclude Include="Microsoft.CodeAnalysis.CSharp"/>
<PackageToInclude Include="Microsoft.CodeAnalysis.VisualBasic"/>
<PackageToInclude Include="CommandLineParser"/>
- <PackageToInclude Include="$(XUnitRunnerPackageId)" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<ProjectAssetsFile>$(SourceDir)Common\external\obj\project.assets.json</ProjectAssetsFile>
</PropertyGroup>
- <Target Name="AddXunitConsoleRunner" BeforeTargets="ResolveReferences" Condition="'$(TargetGroup)' == 'netfx'">
- <Error Condition="!Exists('$(PackagesDir)$(XUnitRunnerPackageId)\$(XUnitPackageVersion)\tools\xunit.console.exe')"
- Text="Error: looks the package $(PackagesDir)$(XUnitRunnerPackageId)\$(XUnitPackageVersion) not restored or missing xunit.console.exe."
+ <Target Name="AddXunitConsoleRunner" BeforeTargets="ResolveReferences">
+ <Error Condition="!Exists('$(PackagesDir)\$(XUnitRunnerPackageId)\$(XUnitPackageVersion)\tools\$(XUnitRunnerTargetFramework)\xunit.console.dll')"
+ Text="Error: looks the package $(PackagesDir)\$(XUnitRunnerPackageId)\$(XUnitPackageVersion) not restored or missing xunit.console.dll."
/>
<ItemGroup>
<ReferenceCopyLocalPaths
- Include="$(PackagesDir)$(XUnitRunnerPackageId)\$(XUnitPackageVersion)\tools\*.*"
- Exclude="$(PackagesDir)$(XUnitRunnerPackageId)\$(XUnitPackageVersion)\tools\xunit.console.exe.config"
+ Include="$(PackagesDir)\$(XUnitRunnerPackageId)\$(XUnitPackageVersion)\tools\$(XUnitRunnerTargetFramework)\*.*"
+ Exclude="$(PackagesDir)\$(XUnitRunnerPackageId)\$(XUnitPackageVersion)\tools\$(XUnitRunnerTargetFramework)\xunit.console.dll.config"
>
<Private>false</Private>
<NuGetPackageId>$(XUnitRunnerPackageId)</NuGetPackageId>
</ReferenceCopyLocalPaths>
</ItemGroup>
</Target>
-</Project>
\ No newline at end of file
+</Project>
}
[Benchmark(InnerIterationCount = 20000000)]
- public void LoopReturn()
+ public void LoopReturnIter()
{
Benchmark.Iterate(() => LoopReturn(test1, test2));
}
[Benchmark(InnerIterationCount = 20000000)]
- public void LoopGoto()
+ public void LoopGotoIter()
{
Benchmark.Iterate(() => LoopGoto(test1, test2));
}
// Entrypoint for xunit-perf to call the benchmark
[Benchmark]
[MemberData(nameof(ArrayedBoxedIndicesToTest))]
- public static bool Test(object boxedIndex)
+ public static bool TestWithXunit(object boxedIndex)
{
return Test((int)boxedIndex, true);
}
<PackageReference Include="xunit">
<Version>$(XunitPackageVersion)</Version>
</PackageReference>
- <PackageReference Include="xunit.console.netcore">
- <Version>$(XunitConsoleNetcorePackageVersion)</Version>
+ <PackageReference Include="xunit.runner.console">
+ <Version>$(XunitPackageVersion)</Version>
</PackageReference>
<PackageReference Include="xunit.runner.utility">
<Version>$(XunitPackageVersion)</Version>
<PackageReference Include="xunit">
<Version>$(XunitPackageVersion)</Version>
</PackageReference>
- <PackageReference Include="xunit.console.netcore">
- <Version>$(XunitConsoleNetcorePackageVersion)</Version>
+ <PackageReference Include="xunit.runner.console">
+ <Version>$(XunitPackageVersion)</Version>
</PackageReference>
<PackageReference Include="xunit.runner.utility">
<Version>$(XunitPackageVersion)</Version>
<PackageReference Include="xunit">
<Version>$(XunitPackageVersion)</Version>
</PackageReference>
- <PackageReference Include="xunit.console.netcore">
- <Version>$(XunitConsoleNetcorePackageVersion)</Version>
+ <PackageReference Include="xunit.runner.console">
+ <Version>$(XunitPackageVersion)</Version>
</PackageReference>
<PackageReference Include="xunit.runner.utility">
<Version>$(XunitPackageVersion)</Version>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <IsTestProject>false</IsTestProject>
- </PropertyGroup>
- <ItemGroup>
- <PackageReference Include="Microsoft.NETCore.Platforms">
- <Version>$(MicrosoftNETCorePlatformsPackageVersion)</Version>
- </PackageReference>
- <PackageReference Include="xunit">
- <Version>$(XunitPackageVersion)</Version>
- </PackageReference>
- <PackageReference Include="xunit.assert">
- <Version>$(XunitPackageVersion)</Version>
- </PackageReference>
- <PackageReference Include="xunit.core">
- <Version>$(XunitPackageVersion)</Version>
- </PackageReference>
- <PackageReference Include="xunit.runner.msbuild">
- <Version>$(XunitPackageVersion)</Version>
- </PackageReference>
- </ItemGroup>
- <PropertyGroup>
- <TargetFrameworks>netcoreapp1.1;net45</TargetFrameworks>
- <TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
- <PackageTargetFallback>$(PackageTargetFallback);dnxcore50;portable-net45+win8</PackageTargetFallback>
- <RuntimeIdentifiers>$(TargetRid)</RuntimeIdentifiers>
- <ContainsPackageReferences>true</ContainsPackageReferences>
- <PrereleaseResolveNuGetPackages>false</PrereleaseResolveNuGetPackages>
- </PropertyGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <Target Name="Build"
- DependsOnTargets="ResolveReferences" />
-</Project>
\ No newline at end of file
+++ /dev/null
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="..\dir.props" />
-
- <!-- Set default Configuration and Platform -->
- <PropertyGroup>
- <__BuildArch Condition="'$(__BuildArch)' == ''">x64</__BuildArch>
- <__BuildType Condition="'$(__BuildType)' == ''">Debug</__BuildType>
- <__BuildOS Condition="'$(__BuildOS)' == ''">Windows_NT</__BuildOS>
- <BuildArch>$(__BuildArch)</BuildArch>
- <BuildType>$(__BuildType)</BuildType>
- <BuildOS>$(__BuildOS)</BuildOS>
- <Configuration Condition="'$(Configuration)' ==''">$(BuildType)</Configuration>
- <Platform Condition="'$(Platform)'==''">$(BuildArch)</Platform>
- </PropertyGroup>
-
- <!-- Setup Default symbol and optimization for Configuration -->
- <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
- <DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
- <Optimize Condition="'$(Optimize)' == ''">false</Optimize>
- <DebugType Condition="'$(DebugType)' == ''">full</DebugType>
- <DefineConstants>$(DefineConstants);DEBUG;TRACE;XUNIT_PERF</DefineConstants>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)' == 'Release'">
- <DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
- <Optimize Condition="'$(Optimize)' == ''">true</Optimize>
- <DebugType Condition="'$(DebugType)' == ''">pdbonly</DebugType>
- <DefineConstants>$(DefineConstants);TRACE;XUNIT_PERF</DefineConstants>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)' == 'Checked'">
- <DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
- <Optimize Condition="'$(Optimize)' == ''">true</Optimize>
- <DebugType Condition="'$(DebugType)' == ''">full</DebugType>
- <DefineConstants>$(DefineConstants);DEBUG;TRACE;XUNIT_PERF</DefineConstants>
- </PropertyGroup>
-
- <!-- Setup target platform pointer size in bit-->
- <PropertyGroup>
- <PointerSize Condition="'$(Platform)'=='x64'">64</PointerSize>
- <PointerSize Condition="'$(Platform)'=='arm64'">64</PointerSize>
- <PointerSize Condition="'$(Platform)'=='x86'">32</PointerSize>
- <PointerSize Condition="'$(Platform)'=='arm'">32</PointerSize>
- </PropertyGroup>
-
-<!-- Setup the default output and intermediate paths -->
- <PropertyGroup>
- <OSPlatformConfig>$(BuildOS).$(Platform).$(Configuration)</OSPlatformConfig>
- <BaseOutputPath>$(ProjectDir)\..\bin\tests</BaseOutputPath>
- <BaseOutputPath Condition="'$(__TestRootDir)' != ''">$(__TestRootDir)</BaseOutputPath>
- <BaseOutputPathWithConfig>$(BaseOutputPath)\$(OSPlatformConfig)\</BaseOutputPathWithConfig>
- <BinDir>$(BaseOutputPathWithConfig)</BinDir>
- <BaseIntermediateOutputPath>$(ProjectDir)\..\bin\tests\obj\$(OSPlatformConfig)\Managed\</BaseIntermediateOutputPath>
- <BaseIntermediateOutputPath Condition="'$(__ManagedTestIntermediatesDir)' != ''">$(__ManagedTestIntermediatesDir)\</BaseIntermediateOutputPath>
- <__NativeTestIntermediatesDir Condition="'$(__NativeTestIntermediatesDir)' == ''">$([System.IO.Path]::GetFullPath($(BaseOutputPathWithConfig)..\obj\$(BuildOS).$(Platform).$(Configuration)\Native\))</__NativeTestIntermediatesDir>
- <BuildProjectRelativeDir>$(MSBuildProjectName)\</BuildProjectRelativeDir>
- <BuildProjectRelativeDir Condition="'$(MSBuildProjectDirectory.Contains($(SourceDir)))'">$([System.String]::Copy('$(MSBuildProjectDirectory)').Replace($(SourceDir),''))\$(MSBuildProjectName)</BuildProjectRelativeDir>
- <IntermediateOutputPath>$(BaseIntermediateOutputPath)$(BuildProjectRelativeDir)\</IntermediateOutputPath>
- <OutputPath>$(BaseOutputPathWithConfig)$(BuildProjectRelativeDir)\</OutputPath>
- <TestWorkingDir Condition="'$(TestWorkingDir)'==''">$(BaseOutputPath)\testStagingDir\</TestWorkingDir>
- <TestPath Condition="'$(TestPath)'==''">$(TestWorkingDir)$(OSPlatformConfig)\$(MSBuildProjectName)/</TestPath>
- </PropertyGroup>
-
-</Project>
-
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="dir.common.props" />
+ <Import Project="..\dir.props" />
+
+ <Import Project="..\dir.common.props" />
+
+ <!-- Setup Default symbol and optimization for Configuration -->
+ <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
+ <DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
+ <Optimize Condition="'$(Optimize)' == ''">false</Optimize>
+ <DebugType Condition="'$(DebugType)' == ''">full</DebugType>
+ <DefineConstants>$(DefineConstants);DEBUG;TRACE;XUNIT_PERF</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)' == 'Release'">
+ <DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
+ <Optimize Condition="'$(Optimize)' == ''">true</Optimize>
+ <DebugType Condition="'$(DebugType)' == ''">pdbonly</DebugType>
+ <DefineConstants>$(DefineConstants);TRACE;XUNIT_PERF</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)' == 'Checked'">
+ <DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
+ <Optimize Condition="'$(Optimize)' == ''">true</Optimize>
+ <DebugType Condition="'$(DebugType)' == ''">full</DebugType>
+ <DefineConstants>$(DefineConstants);DEBUG;TRACE;XUNIT_PERF</DefineConstants>
+ </PropertyGroup>
+
+ <!-- Setup target platform pointer size in bit-->
+ <PropertyGroup>
+ <PointerSize Condition="'$(Platform)'=='x64'">64</PointerSize>
+ <PointerSize Condition="'$(Platform)'=='arm64'">64</PointerSize>
+ <PointerSize Condition="'$(Platform)'=='x86'">32</PointerSize>
+ <PointerSize Condition="'$(Platform)'=='arm'">32</PointerSize>
+ </PropertyGroup>
+
+<!-- Setup the default output and intermediate paths -->
+ <PropertyGroup>
+ <BaseOutputPath>$(ProjectDir)\..\bin\tests</BaseOutputPath>
+ <BaseOutputPath Condition="'$(__TestRootDir)' != ''">$(__TestRootDir)</BaseOutputPath>
+ <BaseOutputPathWithConfig>$(BaseOutputPath)\$(OSPlatformConfig)\</BaseOutputPathWithConfig>
+ <BinDir>$(BaseOutputPathWithConfig)</BinDir>
+ <BaseIntermediateOutputPath>$(ProjectDir)\..\bin\tests\obj\$(OSPlatformConfig)\Managed\</BaseIntermediateOutputPath>
+ <BaseIntermediateOutputPath Condition="'$(__ManagedTestIntermediatesDir)' != ''">$(__ManagedTestIntermediatesDir)\</BaseIntermediateOutputPath>
+ <__NativeTestIntermediatesDir Condition="'$(__NativeTestIntermediatesDir)' == ''">$([System.IO.Path]::GetFullPath($(BaseOutputPathWithConfig)..\obj\$(BuildOS).$(Platform).$(Configuration)\Native\))</__NativeTestIntermediatesDir>
+ <BuildProjectRelativeDir>$(MSBuildProjectName)\</BuildProjectRelativeDir>
+ <BuildProjectRelativeDir Condition="'$(MSBuildProjectDirectory.Contains($(SourceDir)))'">$([System.String]::Copy('$(MSBuildProjectDirectory)').Replace($(SourceDir),''))\$(MSBuildProjectName)</BuildProjectRelativeDir>
+ <IntermediateOutputPath>$(BaseIntermediateOutputPath)$(BuildProjectRelativeDir)\</IntermediateOutputPath>
+ <OutputPath>$(BaseOutputPathWithConfig)$(BuildProjectRelativeDir)\</OutputPath>
+ <TestWorkingDir Condition="'$(TestWorkingDir)'==''">$(BaseOutputPath)\testStagingDir\</TestWorkingDir>
+ <TestPath Condition="'$(TestPath)'==''">$(TestWorkingDir)$(OSPlatformConfig)\$(MSBuildProjectName)/</TestPath>
+ </PropertyGroup>
<!-- Disable some standard properties for building our projects -->
<PropertyGroup>
<NoWarn>78,162,164,168,169,219,251,252,414,429,642,649,652,675,1691,1717,1718,3001,3002,3003,3005,3008</NoWarn>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<SkipSigning Condition="'$(CrossGen)' == 'true'">true</SkipSigning>
- <!-- Set the project.json directory for generated TestWrappers. -->
- <TestWrappersPackagesConfigFileDirectory>$(MSBuildThisFileDirectory)TestWrappersConfig\</TestWrappersPackagesConfigFileDirectory>
<AssemblyKey>Test</AssemblyKey>
</PropertyGroup>
<ItemGroup>
<DisabledProjects Include="TestWrappers*\**\*.csproj" />
<DisabledProjects Include="*\**\cs_template.csproj" />
- <DisabledProjects Include="Common\Coreclr.TestWrapper\Coreclr.TestWrapper.csproj" Condition="('$(BuildTestsAgainstPackages)' != 'true') And ('$(BuildOS)' == 'Windows_NT')" />
- <DisabledProjects Include="Common\Desktop.Coreclr.TestWrapper\Desktop.Coreclr.TestWrapper.csproj" Condition="('$(BuildTestsAgainstPackages)' == 'true') Or ('$(BuildOS)' != 'Windows_NT')" />
+ <DisabledProjects Include="Common\Coreclr.TestWrapper\Coreclr.TestWrapper.csproj" />
<DisabledProjects Include="Common\test_runtime\test_runtime.csproj" />
<DisabledProjects Include="Common\test_dependencies\test_dependencies.csproj" />
<DisabledProjects Include="Common\CoreFX\TestFileSetup\CoreFX.TestUtils.TestFileSetup.csproj" />
<PackageReference Include="xunit">
<Version>$(XunitPackageVersion)</Version>
</PackageReference>
- <PackageReference Include="xunit.console.netcore">
- <Version>$(XunitConsoleNetcorePackageVersion)</Version>
+ <PackageReference Include="xunit.runner.console">
+ <Version>$(XunitPackageVersion)</Version>
</PackageReference>
<PackageReference Include="xunit.runner.utility">
<Version>$(XunitPackageVersion)</Version>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <UsingTask AssemblyFile="$(PackagesDir)xunit.runner.msbuild\$(XunitPackageVersion)\build\portable-net45+win8+wp8+wpa81\xunit.runner.msbuild.dll" TaskName="Xunit.Runner.MSBuild.xunit" />
-
<ItemGroup>
<_SkipTestAssemblies Include="$(SkipTestAssemblies)" />
</ItemGroup>
<Message Text= "_SkipTestAssemblies= @(_SkipTestAssemblies -> '$(TestAssemblyDir)%(Identity)\%(Identity).XUnitWrapper.dll')"/>
</Target>
- <UsingTask
- AssemblyFile="$(SourceDir)\packages\xunit.runner.msbuild\$(XunitPackageVersion)\build\portable-net45+win8+wp8+wpa81\xunit.runner.msbuild.dll"
- TaskName="Xunit.Runner.MSBuild.xunit" />
-
<Target Name="RunTests"
DependsOnTargets="FindTestDirectories"
Condition="'$(SkipTests)' != 'True'">
<PropertyGroup>
<ExcludeTraits Condition="'$(ExcludeTraits)'==''">category=outerloop;category=failing</ExcludeTraits>
- <ParallelRun Condition="'$(ParallelRun)'==''">true</ParallelRun>
+ <ParallelRun Condition="'$(ParallelRun)'==''">all</ParallelRun>
</PropertyGroup>
<ItemGroup>
<IncludeTraitsItems Include="$(IncludeTraits)" />
<ExcludeTraitsItems Include="$(ExcludeTraits)" />
</ItemGroup>
- <xunit Assemblies="@(TestAssemblies)"
- ParallelizeAssemblies="$(ParallelRun)"
- ParallelizeTestCollections="$(ParallelRun)"
- Html="$(__TestRunHtmlLog)"
- Xml="$(__TestRunXmlLog)"
- IncludeTraits="@(IncludeTraitsItems)"
- ExcludeTraits="@(ExcludeTraitsItems)" />
+ <Error Condition="'$(CORE_ROOT)' == ''" Text="CORE_ROOT is not set." />
+ <PropertyGroup>
+ <XunitConsoleRunner>$(CORE_ROOT)\xunit.console.dll</XunitConsoleRunner>
+
+ <XunitArgs>-parallel $(ParallelRun)</XunitArgs>
+ <XunitArgs>$(XunitArgs) -html $(__TestRunHtmlLog)</XunitArgs>
+ <XunitArgs>$(XunitArgs) -xml $(__TestRunXmlLog)</XunitArgs>
+ <XunitArgs>$(XunitArgs) @(IncludeTraitsItems->'-trait %(Identity)', ' ')</XunitArgs>
+ <XunitArgs>$(XunitArgs) @(ExcludeTraitsItems->'-notrait %(Identity)', ' ')</XunitArgs>
+
+ <CorerunExecutable Condition="'$(RunningOnUnix)' == 'true'">$(CORE_ROOT)\corerun</CorerunExecutable>
+ <CorerunExecutable Condition="'$(RunningOnUnix)' != 'true'">$(CORE_ROOT)\corerun.exe</CorerunExecutable>
+ <XunitCommandLine>$(CorerunExecutable) $(XunitConsoleRunner) @(TestAssemblies->'%(Identity)', ' ') $(XunitArgs)</XunitCommandLine>
+ </PropertyGroup>
+ <Exec Command="$(XunitCommandLine)" />
</Target>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!-- This overrides the typical ResolveNuGetPackages so that it does copy local of the
- referenced items. This is used so that we can correctly resolve and copy the libraries necessary
- to the core_root directory -->
-
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Target Name="ResolveNuGetPackages">
-
- <PrereleaseResolveNuGetPackageAssets Condition="Exists($(ProjectAssetsFile))"
- AllowFallbackOnTargetSelection="true"
- IncludeFrameworkReferences="false"
- NuGetPackagesDirectory="$(PackagesDir)"
- RuntimeIdentifier="$(TestNugetRuntimeId)"
- ProjectLanguage="$(Language)"
- ProjectLockFile="$(ProjectAssetsFile)"
- TargetMonikers="$(TargetFrameworkMoniker)">
- <Output TaskParameter="ResolvedAnalyzers" ItemName="Analyzer" />
- <Output TaskParameter="ResolvedReferences" ItemName="Reference" />
- <Output TaskParameter="ResolvedCopyLocalItems" ItemName="CopyLocal" />
- </PrereleaseResolveNuGetPackageAssets>
-
- <!-- We may have an indirect package reference that we want to replace with a project reference -->
- <ItemGroup>
- <!-- Convert to file names so that we can intersect -->
- <_ProjectReferenceFilenames Include="@(_ResolvedProjectReferencePaths->'%(FileName)%(Extension)')">
- <OriginalIdentity>%(Identity)</OriginalIdentity>
- </_ProjectReferenceFilenames>
-
- <_ReferencesFileNames Include="@(Reference->'%(FileName)%(Extension)')">
- <OriginalIdentity>%(Identity)</OriginalIdentity>
- </_ReferencesFileNames>
-
- <_CopyLocalFileNames Include="@(CopyLocal->'%(FileName)%(Extension)')">
- <OriginalIdentity>%(Identity)</OriginalIdentity>
- </_CopyLocalFileNames>
-
- <!-- Intersect project-refs with package-refs -->
- <_ReferenceFileNamesToRemove Include="@(_ReferencesFileNames->'%(OriginalIdentity)')" Condition="'@(_ProjectReferenceFilenames)' == '@(_ReferencesFileNames)' and '%(Identity)' != ''"/>
- <_CopyLocalFileNamesToRemove Include="@(_CopyLocalFileNames->'%(OriginalIdentity)')" Condition="'@(_ProjectReferenceFilenames)' == '@(_CopyLocalFileNames)' and '%(Identity)' != ''"/>
-
- <Reference Remove="@(_ReferenceFileNamesToRemove)" />
- <CopyLocal Remove="@(_CopyLocalFileNamesToRemove)"/>
- </ItemGroup>
-
- <Message Text="Excluding @(_ReferenceFileNamesToRemove);@(_CopyLocalFileNamesToRemove) from package references since the same file is provided by a project reference."
- Condition="'@(_ReferenceFileNamesToRemove)' != '' or '@(_CopyLocalFileNamesToRemove)' != ''"/>
-
- <Copy
- SourceFiles="@(CopyLocal)"
- DestinationFolder="$(OutDir)"
- SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
- OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
- Retries="$(CopyRetryCount)"
- RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
- UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)">
-
- <Output TaskParameter="DestinationFiles" ItemName="FileWrites" />
- </Copy>
-
- </Target>
-</Project>