From 313449f6182bf5918eb761253fbeee65e6877d59 Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Wed, 20 Jun 2018 13:59:57 -0700 Subject: [PATCH 01/45] Only include Build.Common.targets when using buildtools --- tests/src/dir.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/dir.targets b/tests/src/dir.targets index e6845e0fd173..d2ac60c2c892 100644 --- a/tests/src/dir.targets +++ b/tests/src/dir.targets @@ -90,7 +90,7 @@ - + From 78b00de8559cf979afcd6905d040cc37362bffae Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Wed, 20 Jun 2018 14:00:37 -0700 Subject: [PATCH 02/45] Move some dir.targets into a diffent file so we can exclude them for SDK style projects --- tests/src/dir.targets | 11 +++-------- tests/src/nonsdk.targets | 10 ++++++++++ 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 tests/src/nonsdk.targets diff --git a/tests/src/dir.targets b/tests/src/dir.targets index d2ac60c2c892..a2da7a5891b5 100644 --- a/tests/src/dir.targets +++ b/tests/src/dir.targets @@ -70,9 +70,6 @@ - - - @@ -82,11 +79,9 @@ <_WillCLRTestProjectBuild Condition="'$(BuildAllProjects)' != true">true <_WillCLRTestProjectBuild Condition="'$(DisableProjectBuild)' != true And '$(BuildAllProjects)' == true And '$(CLRTestPriority)' <= '$(CLRTestPriorityToBuild)'">true - - - - - + + + diff --git a/tests/src/nonsdk.targets b/tests/src/nonsdk.targets new file mode 100644 index 000000000000..740a82bdcdae --- /dev/null +++ b/tests/src/nonsdk.targets @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file From 8959ebee9d03cb908505f5d1d8d3fa0c23545aa5 Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Wed, 20 Jun 2018 14:37:09 -0700 Subject: [PATCH 03/45] Add Directory.Build.{targets, props} that redirect to dirs.{props, targets} fpr SDK projects --- tests/src/Directory.Build.props | 3 +++ tests/src/Directory.Build.targets | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 tests/src/Directory.Build.props create mode 100644 tests/src/Directory.Build.targets diff --git a/tests/src/Directory.Build.props b/tests/src/Directory.Build.props new file mode 100644 index 000000000000..4ed41b2d3179 --- /dev/null +++ b/tests/src/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/tests/src/Directory.Build.targets b/tests/src/Directory.Build.targets new file mode 100644 index 000000000000..f46aecc2c0ad --- /dev/null +++ b/tests/src/Directory.Build.targets @@ -0,0 +1,3 @@ + + + From bb32b49caa579adc72f57e20d74cb34d83163044 Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Fri, 22 Jun 2018 12:23:02 -0700 Subject: [PATCH 04/45] Remove extra slash from Base[Intermediate]OutputPath on tests --- tests/src/dir.common.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/dir.common.props b/tests/src/dir.common.props index dda175574c91..0372ab4f9de3 100644 --- a/tests/src/dir.common.props +++ b/tests/src/dir.common.props @@ -44,11 +44,11 @@ $(BuildOS).$(Platform).$(Configuration) - $(ProjectDir)\..\bin\tests + $(ProjectDir)..\bin\tests $(__TestRootDir) $(BaseOutputPath)\$(OSPlatformConfig)\ $(BaseOutputPathWithConfig) - $(ProjectDir)\..\bin\tests\obj\$(OSPlatformConfig)\Managed\ + $(ProjectDir)..\bin\tests\obj\$(OSPlatformConfig)\Managed\ $(__ManagedTestIntermediatesDir)\ <__NativeTestIntermediatesDir Condition="'$(__NativeTestIntermediatesDir)' == ''">$([System.IO.Path]::GetFullPath($(BaseOutputPathWithConfig)..\obj\$(BuildOS).$(Platform).$(Configuration)\Native\)) $(MSBuildProjectName)\ From dce8e681ae9212290fb02b2625adb75e9dab8e60 Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Wed, 27 Jun 2018 14:39:14 -0700 Subject: [PATCH 05/45] Rename targetassemblyname extension to dll --- tests/src/CLRTest.Jit.targets | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/src/CLRTest.Jit.targets b/tests/src/CLRTest.Jit.targets index 7364c7f20adc..dccea634847b 100644 --- a/tests/src/CLRTest.Jit.targets +++ b/tests/src/CLRTest.Jit.targets @@ -25,7 +25,7 @@ WARNING: When setting properties based on their current state (for example: $([MSBuild]::MakeRelative($(OutputPath.Replace("/","\\")), $(_CLRTestToRunFileFullPath.Replace("/","\\"))).Replace("\\","/")) $([MSBuild]::MakeRelative($(OutputPath), $(_CLRTestToRunFileFullPath)).Replace("\","/")) - $(MSBuildProjectName).exe + $(MSBuildProjectName).dll $([MSBuild]::MakeRelative($(OutputPath.Replace("/","\\")), $(BaseOutputPathWithConfig.Replace("/","\\"))dasm\$(BuildProjectRelativeDir.Replace("/","\\"))).Replace("\\","/")) $([MSBuild]::MakeRelative($(OutputPath), $(BaseOutputPathWithConfig)dasm\$(BuildProjectRelativeDir)).Replace("\","/")) @@ -52,7 +52,7 @@ fi $([MSBuild]::MakeRelative($(OutputPath.Replace("/","\\")), $(_CLRTestToRunFileFullPath.Replace("/","\\"))).Replace("\\","/")) $([MSBuild]::MakeRelative($(OutputPath), $(_CLRTestToRunFileFullPath))) - $(MSBuildProjectName).exe + $(MSBuildProjectName).dll $([MSBuild]::MakeRelative($(OutputPath.Replace("/","\\")), $(BaseOutputPathWithConfig.Replace("/","\\"))dasm\$(BuildProjectRelativeDir.Replace("/","\\"))).Replace("\\","/")) $([MSBuild]::MakeRelative($(OutputPath), $(BaseOutputPathWithConfig)dasm\$(BuildProjectRelativeDir))) @@ -118,9 +118,9 @@ fi Returns="$(IlasmRoundTripBatchScript);$(BatchIlrtTestLaunchCmds)"> $([MSBuild]::MakeRelative($(OutputPath), $(_CLRTestToRunFileFullPath))) - $(MSBuildProjectName).exe + $(MSBuildProjectName).dll $(MSBuildProjectName).dasm.il - $(MSBuildProjectName).asm.exe + $(MSBuildProjectName).asm.dll From 17629429ee77f7088a6ff211efc505c9ef47f562 Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Wed, 27 Jun 2018 15:48:47 -0700 Subject: [PATCH 06/45] Rename nosdk targets file, and import it when neccesary --- tests/src/dir.targets | 4 ++-- tests/src/{nonsdk.targets => nobuild.targets} | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) rename tests/src/{nonsdk.targets => nobuild.targets} (92%) diff --git a/tests/src/dir.targets b/tests/src/dir.targets index a2da7a5891b5..079a08d8df37 100644 --- a/tests/src/dir.targets +++ b/tests/src/dir.targets @@ -80,8 +80,8 @@ <_WillCLRTestProjectBuild Condition="'$(DisableProjectBuild)' != true And '$(BuildAllProjects)' == true And '$(CLRTestPriority)' <= '$(CLRTestPriorityToBuild)'">true - - + + diff --git a/tests/src/nonsdk.targets b/tests/src/nobuild.targets similarity index 92% rename from tests/src/nonsdk.targets rename to tests/src/nobuild.targets index 740a82bdcdae..bb9601d61593 100644 --- a/tests/src/nonsdk.targets +++ b/tests/src/nobuild.targets @@ -1,6 +1,7 @@ + From 251c232e198cec5ebdb80f032f5012984e1053d8 Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Thu, 28 Jun 2018 11:11:56 -0700 Subject: [PATCH 07/45] Enable required properties for sdk properties at the root dirs.props Only pull in the buildtools targets for depproj, ilproj and non-sdk csproj --- tests/src/dir.props | 6 ++++++ tests/src/dir.targets | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/src/dir.props b/tests/src/dir.props index abdb7cc0f574..c71dcca91770 100644 --- a/tests/src/dir.props +++ b/tests/src/dir.props @@ -15,6 +15,12 @@ $(MSBuildThisFileDirectory)TestWrappersConfig\ Test + + + false + netcoreapp2.2 + false + diff --git a/tests/src/dir.targets b/tests/src/dir.targets index 079a08d8df37..d05e4445272b 100644 --- a/tests/src/dir.targets +++ b/tests/src/dir.targets @@ -85,7 +85,7 @@ - + From b17cff6ffda5f8053bc22e240fc4ce111fb1eea0 Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Mon, 2 Jul 2018 10:54:58 -0700 Subject: [PATCH 08/45] Remove code task factory: generate the param list using msbuild syntax instead --- tests/src/CLRTest.Execute.Batch.targets | 7 +---- tests/src/CLRTest.Execute.targets | 38 ------------------------- 2 files changed, 1 insertion(+), 44 deletions(-) diff --git a/tests/src/CLRTest.Execute.Batch.targets b/tests/src/CLRTest.Execute.Batch.targets index 0a6fd439a33c..70cede618f49 100644 --- a/tests/src/CLRTest.Execute.Batch.targets +++ b/tests/src/CLRTest.Execute.Batch.targets @@ -299,11 +299,6 @@ set CLRTestExitCode=!ERRORLEVEL! - - - - - - - - - - - - - - - parseBool = s => - { - bool value; - var success = bool.TryParse(s, out value); - if (success) - return value; - return false; - }; - var items = ArgumentItems.Select(i => new { Item=i, HasParam=parseBool(i.GetMetadata("HasParam"))}); - var noArg = items.Where(i => !i.HasParam).Select(i => new { Identity=i.Item.ItemSpec}); - var haveArg = items.Where(i => i.HasParam).Select(i => new { Identity=i.Item.ItemSpec, Name=i.Item.GetMetadata("ParamName")}); - ParamList = haveArg.Aggregate("", (s,i) => string.Format("{0} [-{1} {2}]", s, i.Identity, i.Name)) + - noArg.Aggregate("", (s,i) => string.Format("{0} [-{1}]", s, i.Identity)); - ]]> - - - From f2ae5a92c50f69aafa8e0427af2ebf6f908f7341 Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Mon, 2 Jul 2018 11:03:10 -0700 Subject: [PATCH 10/45] Force tests to have .exe extension rather than dll when they are executables --- tests/src/dir.targets | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/src/dir.targets b/tests/src/dir.targets index d05e4445272b..9bf0bfa9b9ec 100644 --- a/tests/src/dir.targets +++ b/tests/src/dir.targets @@ -5,6 +5,11 @@ BuildAndRun 0 + + + + .exe + + - - - - - + From dbaa8033d0452b1afb120084b3b42c919ecbe5b6 Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Mon, 2 Jul 2018 12:19:58 -0700 Subject: [PATCH 12/45] Always include the nobuild targets if we're a run only project --- tests/src/dir.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/dir.targets b/tests/src/dir.targets index 8936c173147a..c07af815ea1b 100644 --- a/tests/src/dir.targets +++ b/tests/src/dir.targets @@ -86,7 +86,7 @@ - + From 78d40896efb4283c9356338812b0a0c0f7617acd Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Mon, 2 Jul 2018 17:50:17 -0700 Subject: [PATCH 13/45] Remove runtime references in override.targets when referencing System.Private.CoreLib --- tests/override.targets | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/override.targets b/tests/override.targets index 0e7f82bf77be..2d3bc57d0e80 100644 --- a/tests/override.targets +++ b/tests/override.targets @@ -22,6 +22,14 @@ + + + + + + diff --git a/tests/src/Directory.Build.targets b/tests/src/Directory.Build.targets index f46aecc2c0ad..f3439a7b9026 100644 --- a/tests/src/Directory.Build.targets +++ b/tests/src/Directory.Build.targets @@ -1,3 +1,6 @@ + From d9720b5b15efb7fcb67357d9c714f2a2595a35c1 Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Thu, 5 Jul 2018 12:51:02 -0700 Subject: [PATCH 15/45] Split out nobuild and runonlybuild into two targets files to make the logic clearer --- tests/src/dir.targets | 9 +++++---- tests/src/nobuild.targets | 5 +---- tests/src/runonlybuild.targets | 13 +++++++++++++ 3 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 tests/src/runonlybuild.targets diff --git a/tests/src/dir.targets b/tests/src/dir.targets index c07af815ea1b..82ccc4994bcd 100644 --- a/tests/src/dir.targets +++ b/tests/src/dir.targets @@ -75,9 +75,7 @@ - - + false <_WillCLRTestProjectBuild Condition="'$(_WillCLRTestProjectBuild)' == ''">false @@ -86,7 +84,10 @@ - + + + + diff --git a/tests/src/nobuild.targets b/tests/src/nobuild.targets index bb9601d61593..be508e32bd03 100644 --- a/tests/src/nobuild.targets +++ b/tests/src/nobuild.targets @@ -3,9 +3,6 @@ + - - - - \ No newline at end of file diff --git a/tests/src/runonlybuild.targets b/tests/src/runonlybuild.targets new file mode 100644 index 000000000000..3ac460afb7e9 --- /dev/null +++ b/tests/src/runonlybuild.targets @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file From 34b66a4952bca14759cd85b53571f46b7a225eb0 Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Thu, 5 Jul 2018 13:47:02 -0700 Subject: [PATCH 16/45] Rename runonlybuild.targets --- tests/src/{runonlybuild.targets => runonly.targets} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/src/{runonlybuild.targets => runonly.targets} (100%) diff --git a/tests/src/runonlybuild.targets b/tests/src/runonly.targets similarity index 100% rename from tests/src/runonlybuild.targets rename to tests/src/runonly.targets From 613f9a0685dbb13c28b53c73caa91138b44d056f Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Fri, 6 Jul 2018 11:51:23 -0700 Subject: [PATCH 17/45] Fix for SDK projects referencing system.private.corelib --- tests/override.targets | 1 + tests/src/dir.targets | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/override.targets b/tests/override.targets index 2d3bc57d0e80..d81bfd390c31 100644 --- a/tests/override.targets +++ b/tests/override.targets @@ -22,6 +22,7 @@ + diff --git a/tests/src/dir.targets b/tests/src/dir.targets index 82ccc4994bcd..64f0d804f85d 100644 --- a/tests/src/dir.targets +++ b/tests/src/dir.targets @@ -194,8 +194,8 @@ $(SourceDir)Common\test_dependencies\obj\project.assets.json - - + + From 0c32d18c32486c49917a5ab0182355bd4212c3c9 Mon Sep 17 00:00:00 2001 From: jashook Date: Fri, 8 Jun 2018 10:24:26 -0700 Subject: [PATCH 18/45] Initial change to allow build wrappers and runtest.py --- build-test.sh | 6 +- tests/runtest.proj | 11 +- tests/runtest.py | 389 ++++++++++++++++++ .../Desktop.Coreclr.TestWrapper.csproj | 3 +- 4 files changed, 398 insertions(+), 11 deletions(-) create mode 100755 tests/runtest.py diff --git a/build-test.sh b/build-test.sh index 5339dc1116c7..4d2d06fa0609 100755 --- a/build-test.sh +++ b/build-test.sh @@ -238,7 +238,7 @@ build_Tests() 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" "$__up" "Managed tests build (build tests)" if [ $? -ne 0 ]; then echo "${__MsgPrefix}Error: build failed. Refer to the build log files for details (above)" @@ -254,7 +254,7 @@ build_Tests() 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" "-BuildWrappers" "-TargetsWindows=false" "Test Xunit Wrapper" if [ $? -ne 0 ]; then echo "${__MsgPrefix}Error: build failed. Refer to the build log files for details (above)" @@ -507,7 +507,7 @@ __ZipTests=0 __NativeTestIntermediatesDir= __RunTests=0 __RebuildTests=0 -__BuildTestWrappers=0 +__BuildTestWrappers=1 __GenerateLayoutOnly= __priority1= CORE_ROOT= diff --git a/tests/runtest.proj b/tests/runtest.proj index aaff5b1bdc63..44eafd315e37 100644 --- a/tests/runtest.proj +++ b/tests/runtest.proj @@ -88,7 +88,8 @@ $(_XunitEpilog) Library .NETFramework v4.5 - net45 + netcoreapp2.0 + net45 true true {786C830F-07A1-408B-BD7F-6EE04809D6DB}%3B{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} @@ -118,11 +119,6 @@ $(_XunitEpilog) - - - - - $(XunitTestBinBase)\$(CategoryWithSlash)\ @@ -329,7 +325,8 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\",""). - + + diff --git a/tests/runtest.py b/tests/runtest.py new file mode 100755 index 000000000000..8819cee57275 --- /dev/null +++ b/tests/runtest.py @@ -0,0 +1,389 @@ +#!/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. + """ + + if _os == "Windows_NT": + with tempfile.NamedTemporaryFile() as test_env: + with open(test_env.name, 'w') as file_handle: + for key in env: + file_handle.write("set %s=%s%s" % (key, value, os.linesep)) + + 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:ParrallelRun=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 + + if host_os != "Windows_NT": + command = ["sh"] + 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 diff --git a/tests/src/Common/Desktop.Coreclr.TestWrapper/Desktop.Coreclr.TestWrapper.csproj b/tests/src/Common/Desktop.Coreclr.TestWrapper/Desktop.Coreclr.TestWrapper.csproj index b26c89370ba0..265dab7047f2 100644 --- a/tests/src/Common/Desktop.Coreclr.TestWrapper/Desktop.Coreclr.TestWrapper.csproj +++ b/tests/src/Common/Desktop.Coreclr.TestWrapper/Desktop.Coreclr.TestWrapper.csproj @@ -10,7 +10,8 @@ Coreclr.TestWrapper Coreclr.TestWrapper .NETFramework - v4.5 + v4.5 + netcoreapp2.0 true BuildOnly true From 23d862750568cfa98a4d01ad99a5e3a8025b1226 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 15 Jun 2018 12:01:56 -0700 Subject: [PATCH 19/45] Build xunit wrappers on unix The generated wrapper needs to target netcoreapp on unix. I had to exclude assets from the xunit package and introduce a dependency on the private corefx bits, to resolve a dependency conflict in which the generated wrapper was depending on an older System.Runtime.dll than the helper library. I also disabled binclash logging, because the wrapper build binplaces the helper library to the same location multiple times. I couldn't find a simple way to disable binclash logging for the wrapper build only, since that requires passing an empty switch to run.exe, and bash word splitting makes this nontrivial from build-test. --- build-test.sh | 4 ++-- config.json | 2 +- tests/runtest.proj | 4 +++- tests/runtest.py | 2 +- .../Coreclr.TestWrapper/Coreclr.TestWrapper.csproj | 3 ++- tests/src/TestWrappersConfig/TestWrappersConfig.csproj | 9 ++++++++- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/build-test.sh b/build-test.sh index 4d2d06fa0609..6907dbb69eaa 100755 --- a/build-test.sh +++ b/build-test.sh @@ -346,7 +346,7 @@ build_Tests_internal() __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" + buildCommand="$__ProjectRoot/run.sh build -Project=$projectName -MsBuildLog=${__msbuildLog} -MsBuildWrn=${__msbuildWrn} -MsBuildErr=${__msbuildErr} $extraBuildParameters $__RunArgs $__UnprocessedBuildArgs" echo "Building step '$stepName' via $buildCommand" @@ -727,7 +727,7 @@ __CrossgenExe="$__CrossComponentBinDir/crossgen" 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 diff --git a/config.json b/config.json index 65ebfa1c7d5b..5710b3d8a711 100644 --- a/config.json +++ b/config.json @@ -76,7 +76,7 @@ "description": "MsBuild logging options.", "valueType": "passThrough", "values": [], - "defaultValue": "/l:BinClashLogger,Tools/net46/Microsoft.DotNet.Build.Tasks.dll;LogFile=binclash.log" + "defaultValue": "" }, "FilterToOSGroup": { "description": "Specifies the OSGroup.", diff --git a/tests/runtest.proj b/tests/runtest.proj index 44eafd315e37..ad1dd5e10a6a 100644 --- a/tests/runtest.proj +++ b/tests/runtest.proj @@ -87,8 +87,10 @@ $(_XunitEpilog) {95DFC527-4DC1-495E-97D7-E94EE1F7140D} Library .NETFramework + .NETCoreApp v4.5 - netcoreapp2.0 + v2.2 + netcoreapp2.2 net45 true true diff --git a/tests/runtest.py b/tests/runtest.py index 8819cee57275..35cd6da82c35 100755 --- a/tests/runtest.py +++ b/tests/runtest.py @@ -128,7 +128,7 @@ def call_msbuild(coreclr_repo_location, common_msbuild_arguments = ["/nologo", "/nodeReuse:false", "/p:Platform=%s" % arch] if sequential: - common_msbuild_arguments += ["/p:ParrallelRun=false"] + common_msbuild_arguments += ["/p:ParallelRun=false"] else: common_msbuild_arguments += ["/maxcpucount"] diff --git a/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj b/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj index 2e7abfe1bcee..ed42b4410fa4 100644 --- a/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj +++ b/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj @@ -1,10 +1,11 @@ - + Debug AnyCPU CoreclrTestWrapperLib + netcoreapp2.2 2.0 {95DFC527-4DC1-495E-97D7-E94EE1F7140D} Library diff --git a/tests/src/TestWrappersConfig/TestWrappersConfig.csproj b/tests/src/TestWrappersConfig/TestWrappersConfig.csproj index 76128421d2c9..5b31bf223e94 100644 --- a/tests/src/TestWrappersConfig/TestWrappersConfig.csproj +++ b/tests/src/TestWrappersConfig/TestWrappersConfig.csproj @@ -13,19 +13,26 @@ $(XunitPackageVersion) + All + All $(XunitPackageVersion) $(XunitPackageVersion) + All $(XunitPackageVersion) + All + + + $(MicrosoftPrivateCoreFxNETCoreAppPackageVersion) - netcoreapp1.1;net45 + netcoreapp2.2 .NETCoreApp $(PackageTargetFallback);dnxcore50;portable-net45+win8 $(TargetRid) From 28892819a9347481fd03e7d6c242b3b3d1f1be2e Mon Sep 17 00:00:00 2001 From: jashook Date: Mon, 18 Jun 2018 10:27:22 -0700 Subject: [PATCH 20/45] Correctly generate TestEnv xplat Note that this will still require changes to the test wrapper to actually source the TestEnv on unix --- build-test.sh | 2 +- tests/runtest.py | 59 +++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 54 insertions(+), 7 deletions(-) diff --git a/build-test.sh b/build-test.sh index 6907dbb69eaa..1094f60c03e9 100755 --- a/build-test.sh +++ b/build-test.sh @@ -238,7 +238,7 @@ build_Tests() 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" "$__up" "Managed tests build (build tests)" if [ $? -ne 0 ]; then echo "${__MsgPrefix}Error: build failed. Refer to the build log files for details (above)" diff --git a/tests/runtest.py b/tests/runtest.py index 35cd6da82c35..51482a9a3d80 100755 --- a/tests/runtest.py +++ b/tests/runtest.py @@ -69,18 +69,65 @@ def create_and_use_test_env(_os, env, func): in runtest.sh. """ - if _os == "Windows_NT": + 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: - for key in env: - file_handle.write("set %s=%s%s" % (key, value, os.linesep)) + 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 @@ -155,7 +202,7 @@ def call_msbuild(coreclr_repo_location, command += msbuild_log_args if host_os != "Windows_NT": - command = ["sh"] + command + command = ["bash"] + command print " ".join(command) subprocess.check_output(command) From 4a2f4344cb94bbde5f5527ad0a3e28bda8dfb9a5 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 19 Jun 2018 15:53:14 -0700 Subject: [PATCH 21/45] Build xunit wrappers using SDK --- tests/build.proj | 1 - tests/override.targets | 4 - tests/runtest.proj | 71 ++++------ tests/runtest.sh | 132 +++++++++++++----- .../Coreclr.TestWrapper.csproj | 35 +---- .../TestWrappersConfig.csproj | 45 ------ tests/src/dir.props | 2 - tests/tests.targets | 27 ++-- tests/xunitwrapper.targets | 61 -------- 9 files changed, 140 insertions(+), 238 deletions(-) delete mode 100644 tests/src/TestWrappersConfig/TestWrappersConfig.csproj delete mode 100644 tests/xunitwrapper.targets diff --git a/tests/build.proj b/tests/build.proj index aede1317a1c3..a421b130b605 100644 --- a/tests/build.proj +++ b/tests/build.proj @@ -31,7 +31,6 @@ - diff --git a/tests/override.targets b/tests/override.targets index 0e7f82bf77be..d4c07a0f00bf 100644 --- a/tests/override.targets +++ b/tests/override.targets @@ -3,10 +3,6 @@ Overrides for all other targets (including build tools) can go in this file. --> - - - - - - + + + + + netcoreapp2.1 + false + + - + - - - {8ffe99c0-22f8-4462-b839-970eac1b3472} - coreclr - - - {8ffe99c0-22f8-4462-b839-970eac1b3472} - coreclr - + + + + - - - $(XunitTestBinBase)\$(CategoryWithSlash)\ - %24(TestWrappersPackagesConfigFileDirectory)obj/project.assets.json - + + - ]]> +]]> - @@ -149,7 +129,7 @@ $(_XunitEpilog) - + @@ -164,7 +144,6 @@ $(_XunitEpilog) $([System.String]::Copy('$(CategoryWithSlash)').Replace('/','.')) $(Category).XUnitWrapper $(XunitWrapperGeneratedCSDirBase)$(Category) - $(XunitWrapperOutputIntermediatedDirBase)$(Category) <_XunitProlog Condition=" '$(_XunitProlog)'=='' "> @@ -497,6 +476,6 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\",""). - + diff --git a/tests/runtest.sh b/tests/runtest.sh index c63ed4a30bb3..2b52ce6a86cd 100755 --- a/tests/runtest.sh +++ b/tests/runtest.sh @@ -1339,6 +1339,8 @@ fi export __TestEnv=$testEnv +__ScriptPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + cd "$testRootDir" dumplingsListPath="$testRootDir/dumplings.txt" @@ -1347,48 +1349,106 @@ dumplingsListPath="$testRootDir/dumplings.txt" rm -f "$dumplingsListPath" find $testRootDir -type f -name "local_dumplings.txt" -exec rm {} \; -time_start=$(date +"%s") -if [ -z "$testDirectories" ] -then - # No test directories were specified, so run everything in the current - # directory and its subdirectories. - run_tests_in_directory "." -else - # Otherwise, run all the tests in each specified test directory. - for testDir in "${testDirectories[@]}" - do - if [ ! -d "$testDir" ]; then - echo "Test directory does not exist: $testDir" - else - run_tests_in_directory "./$testDir" - fi - done -fi -finish_remaining_tests -print_results -find $testRootDir -type f -name "local_dumplings.txt" -exec cat {} \; > $dumplingsListPath +# Use uname to determine what the CPU is. +CPUName=$(uname -p) -if [ -s $dumplingsListPath ]; then - cat $dumplingsListPath -else - rm $dumplingsListPath +# Some Linux platforms report unknown for platform, but the arch for machine. +if [ "$CPUName" == "unknown" ]; then + CPUName=$(uname -m) fi -time_end=$(date +"%s") -time_diff=$(($time_end-$time_start)) -echo "$(($time_diff / 60)) minutes and $(($time_diff % 60)) seconds taken to run CoreCLR tests." +case $CPUName in + i686) + echo "Unsupported CPU $CPUName detected, build might not succeed!" + __BuildArch=x86 + __HostArch=x86 + ;; -xunit_output_end + x86_64) + __BuildArch=x64 + __HostArch=x64 + ;; -if [ "$CoreClrCoverage" == "ON" ] -then - coreclr_code_coverage -fi + armv7l) + echo "Unsupported CPU $CPUName detected, build might not succeed!" + __BuildArch=arm + __HostArch=arm + ;; -if ((countFailedTests > 0)); then - exit $EXIT_CODE_TEST_FAILURE -fi + aarch64) + __BuildArch=arm64 + __HostArch=arm64 + ;; + + *) + echo "Unknown CPU $CPUName detected, configuring as if for x64" + __BuildArch=x64 + __HostArch=x64 + ;; +esac + +# Use uname to determine what the OS is. +OSName=$(uname -s) +case $OSName in + Linux) + __BuildOS=Linux + __HostOS=Linux + ;; + + Darwin) + __BuildOS=OSX + __HostOS=OSX + ;; + + FreeBSD) + __BuildOS=FreeBSD + __HostOS=FreeBSD + ;; + + OpenBSD) + __BuildOS=OpenBSD + __HostOS=OpenBSD + ;; + + NetBSD) + __BuildOS=NetBSD + __HostOS=NetBSD + ;; + + SunOS) + __BuildOS=SunOS + __HostOS=SunOS + ;; + + *) + echo "Unsupported OS $OSName detected, configuring as if for Linux" + __BuildOS=Linux + __HostOS=Linux + ;; +esac + +__BuildType=Debug + + +__ProjectDir="$(dirname $__ScriptPath)" +__BuildToolsDir="$__ProjectDir/Tools" +__MSBuild="$__BuildToolsDir/msbuild.sh" +__RootBinDir="$__ProjectDir/bin" +__LogsDir="$__RootBinDir/Logs" +__BuildLogRootName="TestRunResults" +__BuildLog="$__LogsDir/${__BuildLogRootName}_${__BuildOS}_${__BuildArch}_${__BuildType}.log" +__BuildWrn="$__LogsDir/${__BuildLogRootName}_${__BuildOS}_${__BuildArch}_${__BuildType}.wrn" +__BuildErr="$__LogsDir/${__BuildLogRootName}_${__BuildOS}_${__BuildArch}_${__BuildType}.err" +__MSBuildLogArgs="/fileloggerparameters:\"Verbosity=normal;LogFile=$__BuildLog\" \ +/fileloggerparameters1:\"WarningsOnly;LogFile=$__BuildWrn\" \ +/fileloggerparameters2:\"ErrorsOnly;LogFile=$__BuildErr\" \ +/consoleloggerparameters:Summary \ +/verbosity:minimal" + +buildCommand="$__MSBuild $__ProjectDir/tests/runtest.proj /p:RunTests=true /clp:showcommandline $__MSBuildLogArgs" +buildCommand="$buildCommand /p:__BuildOS=$__BuildOS /p:__BuildArch=$__BuildArch /p:__BuildType=$__BuildType /p:__LogsDir=$__LogsDir" +echo "$buildCommand" +eval "$buildCommand" -exit $EXIT_CODE_SUCCESS diff --git a/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj b/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj index ed42b4410fa4..4a8832795424 100644 --- a/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj +++ b/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj @@ -1,36 +1,13 @@ - - - + + - Debug - AnyCPU - CoreclrTestWrapperLib - netcoreapp2.2 - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - Library - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - ..\..\ - BuildOnly - false - BuildOnly + netcoreapp2.1 + false true - - - - - - - - False - - + - - - - + diff --git a/tests/src/TestWrappersConfig/TestWrappersConfig.csproj b/tests/src/TestWrappersConfig/TestWrappersConfig.csproj deleted file mode 100644 index 5b31bf223e94..000000000000 --- a/tests/src/TestWrappersConfig/TestWrappersConfig.csproj +++ /dev/null @@ -1,45 +0,0 @@ - - - - - Debug - AnyCPU - BuildOnly - false - - - - $(MicrosoftNETCorePlatformsPackageVersion) - - - $(XunitPackageVersion) - All - - - All - $(XunitPackageVersion) - - - $(XunitPackageVersion) - All - - - $(XunitPackageVersion) - All - - - $(MicrosoftPrivateCoreFxNETCoreAppPackageVersion) - - - - netcoreapp2.2 - .NETCoreApp - $(PackageTargetFallback);dnxcore50;portable-net45+win8 - $(TargetRid) - true - false - - - - \ No newline at end of file diff --git a/tests/src/dir.props b/tests/src/dir.props index 925e3faba7ca..95306e1c596f 100644 --- a/tests/src/dir.props +++ b/tests/src/dir.props @@ -11,8 +11,6 @@ 78,162,164,168,169,219,251,252,414,429,642,649,652,675,1691,1717,1718,3001,3002,3003,3005,3008 false true - - $(MSBuildThisFileDirectory)TestWrappersConfig\ Test diff --git a/tests/tests.targets b/tests/tests.targets index 8f00fd749956..f7da4f62922d 100644 --- a/tests/tests.targets +++ b/tests/tests.targets @@ -1,8 +1,6 @@ - - <_SkipTestAssemblies Include="$(SkipTestAssemblies)" /> @@ -26,10 +24,6 @@ - - @@ -37,20 +31,25 @@ category=outerloop;category=failing - true + all - + + $(PackagesDir)\xunit.runner.console\2.4.0-beta.2.build4010\tools\netcoreapp2.0\xunit.console.dll + + -parallel $(ParallelRun) + $(XunitArgs) -html $(__TestRunHtmlLog) + $(XunitArgs) -xml $(__TestRunXmlLog) + $(XunitArgs) @(IncludeTraitsItems->'-trait %(Identity)', ' ') + $(XunitArgs) @(ExcludeTraitsItems->'-notrait %(Identity)', ' ') + + $(DotnetToolCommand) $(XunitConsoleRunner) @(TestAssemblies->'%(Identity)', ' ') $(XunitArgs) + + diff --git a/tests/xunitwrapper.targets b/tests/xunitwrapper.targets deleted file mode 100644 index a0ff7f59fa2d..000000000000 --- a/tests/xunitwrapper.targets +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - <_ProjectReferenceFilenames Include="@(_ResolvedProjectReferencePaths->'%(FileName)%(Extension)')"> - %(Identity) - - - <_ReferencesFileNames Include="@(Reference->'%(FileName)%(Extension)')"> - %(Identity) - - - <_CopyLocalFileNames Include="@(CopyLocal->'%(FileName)%(Extension)')"> - %(Identity) - - - - <_ReferenceFileNamesToRemove Include="@(_ReferencesFileNames->'%(OriginalIdentity)')" Condition="'@(_ProjectReferenceFilenames)' == '@(_ReferencesFileNames)' and '%(Identity)' != ''"/> - <_CopyLocalFileNamesToRemove Include="@(_CopyLocalFileNames->'%(OriginalIdentity)')" Condition="'@(_ProjectReferenceFilenames)' == '@(_CopyLocalFileNames)' and '%(Identity)' != ''"/> - - - - - - - - - - - - - - From 0be3ded15c293bf6a03bfdaaf6c34a595a2dc2c3 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 19 Jun 2018 16:59:10 -0700 Subject: [PATCH 22/45] Target netcoreapp2.0 in xunit wrappers This way, the wrappers can build even if the 2.1 SDK isn't installed on the machine. --- tests/runtest.proj | 2 +- tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/runtest.proj b/tests/runtest.proj index 674c3c0a3a07..15ff51e8672c 100644 --- a/tests/runtest.proj +++ b/tests/runtest.proj @@ -88,7 +88,7 @@ $(_XunitEpilog) - netcoreapp2.1 + netcoreapp2.0 false diff --git a/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj b/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj index 4a8832795424..7e4118bfb191 100644 --- a/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj +++ b/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj @@ -1,7 +1,7 @@ - netcoreapp2.1 + netcoreapp2.0 false true From 0ebb1654b8f148af1ca36f6158f5d3fcdacbd018 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 19 Jun 2018 17:01:40 -0700 Subject: [PATCH 23/45] Restore to packages directory for xunit wrappers --- tests/runtest.proj | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/runtest.proj b/tests/runtest.proj index 15ff51e8672c..3106cdeb18e6 100644 --- a/tests/runtest.proj +++ b/tests/runtest.proj @@ -83,6 +83,7 @@ $(_XunitEpilog) %24(BaseIntermediateOutputPath)%24(BuildProjectRelativeDir) %24(BaseOutputPathWithConfig)%24(BuildProjectRelativeDir) false + $(PackagesDir) From 5055fd40944057fc24ea7c378db6c79f7cb248ca Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 26 Jun 2018 17:39:06 -0700 Subject: [PATCH 24/45] Move common properties out to dir.common.props When building wrappers using the SDK, we need some basic properties (like the build os/arch/config, and the output directories) to be set. I factored out properties used by both the old test build and the new SDK-project test build. At first I tried using Directory.Build.props (which is automatically imported by the SDK), but our test build already imports SDK targets in various places, so this was resulting in duplicate imports. Instead, I used dir.common.props, and made the imports explicit. --- dir.common.props | 30 +++++++++++++++++++ tests/dir.common.props | 15 ++++++++++ tests/runtest.proj | 21 +++++++------ .../Coreclr.TestWrapper.csproj | 12 +++++++- tests/src/dir.common.props | 15 ++-------- tests/tests.targets | 5 +++- 6 files changed, 72 insertions(+), 26 deletions(-) create mode 100644 dir.common.props create mode 100644 tests/dir.common.props diff --git a/dir.common.props b/dir.common.props new file mode 100644 index 000000000000..ee6f350f0de6 --- /dev/null +++ b/dir.common.props @@ -0,0 +1,30 @@ + + + + + + $(MSBuildThisFileDirectory) + $(CoreclrDir)/packages + + + + + $(__BuildArch) + x64 + x64 + + Debug + Debug + Release + Checked + + $(__BuildOS) + Windows_NT + + $(BuildType) + $(BuildArch) + + + diff --git a/tests/dir.common.props b/tests/dir.common.props new file mode 100644 index 000000000000..43b672b2b11c --- /dev/null +++ b/tests/dir.common.props @@ -0,0 +1,15 @@ + + + + + + + $(BuildOS).$(Platform).$(Configuration) + $(CoreclrDir)/bin/tests/obj/$(OSPlatformConfig)/Managed/$(MSBuildProjectName) + $(BaseIntermediateOutputPath) + $(PackagesDir) + + + diff --git a/tests/runtest.proj b/tests/runtest.proj index 3106cdeb18e6..ac0d992cf433 100644 --- a/tests/runtest.proj +++ b/tests/runtest.proj @@ -76,14 +76,11 @@ $(_XunitEpilog) + + - $(BaseIntermediateOutputPath) - $(BaseOutputPathWithConfig) - %24(MSBuildProjectName) - %24(BaseIntermediateOutputPath)%24(BuildProjectRelativeDir) - %24(BaseOutputPathWithConfig)%24(BuildProjectRelativeDir) + $(XUnitTestBinBase)\$(CategoryWithSlash) false - $(PackagesDir) @@ -102,8 +99,8 @@ $(_XunitEpilog) - - + + @@ -169,7 +166,7 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\",""). { 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 @@ -183,6 +180,8 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\",""). 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 } @@ -236,7 +235,7 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\",""). 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 @@ -279,7 +278,7 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\",""). 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" + diff --git a/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj b/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj index 7e4118bfb191..2a4d0c82d137 100644 --- a/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj +++ b/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj @@ -1,4 +1,12 @@ - + + + + + + false + + + netcoreapp2.0 @@ -10,4 +18,6 @@ + + diff --git a/tests/src/dir.common.props b/tests/src/dir.common.props index dda175574c91..6645fdde88e4 100644 --- a/tests/src/dir.common.props +++ b/tests/src/dir.common.props @@ -1,17 +1,7 @@ - - - <__BuildArch Condition="'$(__BuildArch)' == ''">x64 - <__BuildType Condition="'$(__BuildType)' == ''">Debug - <__BuildOS Condition="'$(__BuildOS)' == ''">Windows_NT - $(__BuildArch) - $(__BuildType) - $(__BuildOS) - $(BuildType) - $(BuildArch) - + @@ -32,7 +22,7 @@ full $(DefineConstants);DEBUG;TRACE;XUNIT_PERF - + 64 @@ -43,7 +33,6 @@ - $(BuildOS).$(Platform).$(Configuration) $(ProjectDir)\..\bin\tests $(__TestRootDir) $(BaseOutputPath)\$(OSPlatformConfig)\ diff --git a/tests/tests.targets b/tests/tests.targets index f7da4f62922d..58fb394fb05b 100644 --- a/tests/tests.targets +++ b/tests/tests.targets @@ -38,6 +38,7 @@ + $(PackagesDir)\xunit.runner.console\2.4.0-beta.2.build4010\tools\netcoreapp2.0\xunit.console.dll @@ -47,7 +48,9 @@ $(XunitArgs) @(IncludeTraitsItems->'-trait %(Identity)', ' ') $(XunitArgs) @(ExcludeTraitsItems->'-notrait %(Identity)', ' ') - $(DotnetToolCommand) $(XunitConsoleRunner) @(TestAssemblies->'%(Identity)', ' ') $(XunitArgs) + $(CORE_ROOT)\corerun + $(CORE_ROOT)\corerun.exe + $(CorerunExecutable) $(XunitConsoleRunner) @(TestAssemblies->'%(Identity)', ' ') $(XunitArgs) From df7b2f37e05921f760e8d8e27f8fcd61cf2b1d26 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 26 Jun 2018 17:43:21 -0700 Subject: [PATCH 25/45] Remove desktop-specific test wrapper csproj --- .../Desktop.Coreclr.TestWrapper.csproj | 46 ------------------- 1 file changed, 46 deletions(-) delete mode 100644 tests/src/Common/Desktop.Coreclr.TestWrapper/Desktop.Coreclr.TestWrapper.csproj diff --git a/tests/src/Common/Desktop.Coreclr.TestWrapper/Desktop.Coreclr.TestWrapper.csproj b/tests/src/Common/Desktop.Coreclr.TestWrapper/Desktop.Coreclr.TestWrapper.csproj deleted file mode 100644 index 265dab7047f2..000000000000 --- a/tests/src/Common/Desktop.Coreclr.TestWrapper/Desktop.Coreclr.TestWrapper.csproj +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - Debug - AnyCPU - {5259DD45-EA34-4EE7-B5C5-430B80384544} - Library - Coreclr.TestWrapper - Coreclr.TestWrapper - .NETFramework - v4.5 - netcoreapp2.0 - true - BuildOnly - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - From 096307437e0e068936d6392c8a21fb3b1c1c06ca Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 26 Jun 2018 17:49:46 -0700 Subject: [PATCH 26/45] Pass build os/arch/type and logsdir to msbuild from runtest.py --- tests/runtest.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/runtest.py b/tests/runtest.py index 51482a9a3d80..7cadfb4b1089 100755 --- a/tests/runtest.py +++ b/tests/runtest.py @@ -201,6 +201,11 @@ def call_msbuild(coreclr_repo_location, 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 From 41c25f3a0116a9e0327ee8fa6bd73b0a3b2ee4fd Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 27 Jun 2018 17:14:51 -0700 Subject: [PATCH 27/45] Remove xunit wrapper helper library from travernal build --- tests/src/dirs.proj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/src/dirs.proj b/tests/src/dirs.proj index 58c35591b56b..785a05859bba 100644 --- a/tests/src/dirs.proj +++ b/tests/src/dirs.proj @@ -16,8 +16,7 @@ - - + From bf93ab22da8a3e33547d4e56441bcc0618fd4bb5 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 27 Jun 2018 17:25:01 -0700 Subject: [PATCH 28/45] Fix parameter passing in build-test.sh Use bash arrays to pass parameters for the build command. This makes it possible to pass arguments with spaces to build_Tests_internal. We use this to disable binclashlogging selectively (for the xunit wrapper build only). --- build-test.sh | 57 ++++++++++++++++++++++++++++++++------------------- config.json | 2 +- run.sh | 2 +- 3 files changed, 38 insertions(+), 23 deletions(-) diff --git a/build-test.sh b/build-test.sh index 1094f60c03e9..44a3abfbd507 100755 --- a/build-test.sh +++ b/build-test.sh @@ -152,7 +152,7 @@ generate_layout() # === # ========================================================================================= - 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 @@ -172,7 +172,7 @@ generate_layout() 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 @@ -230,15 +230,15 @@ build_Tests() # === # ========================================================================================= - 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)" @@ -254,7 +254,7 @@ build_Tests() if [ ! -f $__XUnitWrapperBuiltMarker ]; then - build_Tests_internal "Tests_XunitWrapper" "$__ProjectDir/tests/runtest.proj" "-BuildWrappers" "-TargetsWindows=false" "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)" @@ -279,16 +279,19 @@ build_Tests() 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 @@ -296,6 +299,13 @@ build_Tests_internal() __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 @@ -321,12 +331,16 @@ build_Tests_internal() 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 @@ -346,15 +360,16 @@ build_Tests_internal() __msbuildErr="\"/flp2:ErrorsOnly;LogFile=${__BuildErr}\"" # Generate build command - buildCommand="$__ProjectRoot/run.sh build -Project=$projectName -MsBuildLog=${__msbuildLog} -MsBuildWrn=${__msbuildWrn} -MsBuildErr=${__msbuildErr} $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 @@ -666,10 +681,10 @@ while :; do ;; priority1) __priority1=1 - __UnprocessedBuildArgs="$__UnprocessedBuildArgs -priority=1" + __UnprocessedBuildArgs+=("-priority=1") ;; *) - __UnprocessedBuildArgs="$__UnprocessedBuildArgs $1" + __UnprocessedBuildArgs+=("$1") ;; esac @@ -677,12 +692,12 @@ while :; do 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 diff --git a/config.json b/config.json index 5710b3d8a711..65ebfa1c7d5b 100644 --- a/config.json +++ b/config.json @@ -76,7 +76,7 @@ "description": "MsBuild logging options.", "valueType": "passThrough", "values": [], - "defaultValue": "" + "defaultValue": "/l:BinClashLogger,Tools/net46/Microsoft.DotNet.Build.Tasks.dll;LogFile=binclash.log" }, "FilterToOSGroup": { "description": "Specifies the OSGroup.", diff --git a/run.sh b/run.sh index 2d037e91e557..cc6a1846bbeb 100755 --- a/run.sh +++ b/run.sh @@ -9,7 +9,7 @@ toolRuntime=$working_tree_root/Tools 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." From 2cc70246b89784a581abea80e56e8bfd4c7ea3ed Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 28 Jun 2018 10:25:10 -0700 Subject: [PATCH 29/45] Clean up factored .props files --- dir.common.props | 11 +++++--- dir.props | 14 ++--------- tests/dir.common.props | 15 ----------- tests/dir.sdkbuild.props | 25 +++++++++++++++++++ tests/runtest.proj | 2 +- .../Coreclr.TestWrapper.csproj | 2 +- tests/src/dir.common.props | 2 +- 7 files changed, 38 insertions(+), 33 deletions(-) delete mode 100644 tests/dir.common.props create mode 100644 tests/dir.sdkbuild.props diff --git a/dir.common.props b/dir.common.props index ee6f350f0de6..247268c06b15 100644 --- a/dir.common.props +++ b/dir.common.props @@ -1,8 +1,7 @@ - + $(MSBuildThisFileDirectory) @@ -15,6 +14,7 @@ x64 x64 + $(__BuildType) Debug Debug Release @@ -27,4 +27,9 @@ $(BuildArch) + + $(PackagesDir) + + + diff --git a/dir.props b/dir.props index 1b3329f8e173..ad66a0b8fa42 100644 --- a/dir.props +++ b/dir.props @@ -2,6 +2,8 @@ + + @@ -42,18 +44,6 @@ - - $(__BuildArch) - x64 - x64 - - Debug - Debug - Release - Checked - - $(__BuildOS) - Windows_NT $(__ProjectDir)\ $(MSBuildThisFileDirectory) diff --git a/tests/dir.common.props b/tests/dir.common.props deleted file mode 100644 index 43b672b2b11c..000000000000 --- a/tests/dir.common.props +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - $(BuildOS).$(Platform).$(Configuration) - $(CoreclrDir)/bin/tests/obj/$(OSPlatformConfig)/Managed/$(MSBuildProjectName) - $(BaseIntermediateOutputPath) - $(PackagesDir) - - - diff --git a/tests/dir.sdkbuild.props b/tests/dir.sdkbuild.props new file mode 100644 index 000000000000..2eba621c695a --- /dev/null +++ b/tests/dir.sdkbuild.props @@ -0,0 +1,25 @@ + + + + + + + $(BuildOS).$(Platform).$(Configuration) + + $(CoreclrDir)/tests/src + $([System.String]::Copy('$(MSBuildProjectDirectary)').Replace($(TestSrcDir),''))/$(MSBuildProjectName) + + + $(CoreclrDir)/bin/tests/obj/$(OSPlatformConfig)/Managed/$(BuildProjectRelativeDir) + $(BaseIntermediateOutputPath) + + $(CoreclrDir)/bin/tests/$(OSPlatformConfig)/$(BuildProjectRelativeDir) + $(BaseOutputPath) + + + + diff --git a/tests/runtest.proj b/tests/runtest.proj index ac0d992cf433..6251be72778b 100644 --- a/tests/runtest.proj +++ b/tests/runtest.proj @@ -76,7 +76,7 @@ $(_XunitEpilog) - + $(XUnitTestBinBase)\$(CategoryWithSlash) diff --git a/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj b/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj index 2a4d0c82d137..d7afc4842a59 100644 --- a/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj +++ b/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj @@ -1,6 +1,6 @@ - + false diff --git a/tests/src/dir.common.props b/tests/src/dir.common.props index 6645fdde88e4..8be235d605b1 100644 --- a/tests/src/dir.common.props +++ b/tests/src/dir.common.props @@ -1,7 +1,7 @@ - + From 493a4b827d279cf92b6df18d097373e5b425456f Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 28 Jun 2018 10:31:16 -0700 Subject: [PATCH 30/45] Undo runtest.sh changes --- tests/runtest.sh | 132 +++++++++++++---------------------------------- 1 file changed, 36 insertions(+), 96 deletions(-) diff --git a/tests/runtest.sh b/tests/runtest.sh index 2b52ce6a86cd..c63ed4a30bb3 100755 --- a/tests/runtest.sh +++ b/tests/runtest.sh @@ -1339,8 +1339,6 @@ fi export __TestEnv=$testEnv -__ScriptPath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - cd "$testRootDir" dumplingsListPath="$testRootDir/dumplings.txt" @@ -1349,106 +1347,48 @@ dumplingsListPath="$testRootDir/dumplings.txt" rm -f "$dumplingsListPath" find $testRootDir -type f -name "local_dumplings.txt" -exec rm {} \; - - -# Use uname to determine what the CPU is. -CPUName=$(uname -p) - -# Some Linux platforms report unknown for platform, but the arch for machine. -if [ "$CPUName" == "unknown" ]; then - CPUName=$(uname -m) +time_start=$(date +"%s") +if [ -z "$testDirectories" ] +then + # No test directories were specified, so run everything in the current + # directory and its subdirectories. + run_tests_in_directory "." +else + # Otherwise, run all the tests in each specified test directory. + for testDir in "${testDirectories[@]}" + do + if [ ! -d "$testDir" ]; then + echo "Test directory does not exist: $testDir" + else + run_tests_in_directory "./$testDir" + fi + done fi +finish_remaining_tests -case $CPUName in - i686) - echo "Unsupported CPU $CPUName detected, build might not succeed!" - __BuildArch=x86 - __HostArch=x86 - ;; - - x86_64) - __BuildArch=x64 - __HostArch=x64 - ;; - - armv7l) - echo "Unsupported CPU $CPUName detected, build might not succeed!" - __BuildArch=arm - __HostArch=arm - ;; +print_results - aarch64) - __BuildArch=arm64 - __HostArch=arm64 - ;; +find $testRootDir -type f -name "local_dumplings.txt" -exec cat {} \; > $dumplingsListPath - *) - echo "Unknown CPU $CPUName detected, configuring as if for x64" - __BuildArch=x64 - __HostArch=x64 - ;; -esac - -# Use uname to determine what the OS is. -OSName=$(uname -s) -case $OSName in - Linux) - __BuildOS=Linux - __HostOS=Linux - ;; - - Darwin) - __BuildOS=OSX - __HostOS=OSX - ;; - - FreeBSD) - __BuildOS=FreeBSD - __HostOS=FreeBSD - ;; +if [ -s $dumplingsListPath ]; then + cat $dumplingsListPath +else + rm $dumplingsListPath +fi - OpenBSD) - __BuildOS=OpenBSD - __HostOS=OpenBSD - ;; +time_end=$(date +"%s") +time_diff=$(($time_end-$time_start)) +echo "$(($time_diff / 60)) minutes and $(($time_diff % 60)) seconds taken to run CoreCLR tests." - NetBSD) - __BuildOS=NetBSD - __HostOS=NetBSD - ;; +xunit_output_end - SunOS) - __BuildOS=SunOS - __HostOS=SunOS - ;; - - *) - echo "Unsupported OS $OSName detected, configuring as if for Linux" - __BuildOS=Linux - __HostOS=Linux - ;; -esac +if [ "$CoreClrCoverage" == "ON" ] +then + coreclr_code_coverage +fi -__BuildType=Debug - - -__ProjectDir="$(dirname $__ScriptPath)" -__BuildToolsDir="$__ProjectDir/Tools" -__MSBuild="$__BuildToolsDir/msbuild.sh" -__RootBinDir="$__ProjectDir/bin" -__LogsDir="$__RootBinDir/Logs" -__BuildLogRootName="TestRunResults" -__BuildLog="$__LogsDir/${__BuildLogRootName}_${__BuildOS}_${__BuildArch}_${__BuildType}.log" -__BuildWrn="$__LogsDir/${__BuildLogRootName}_${__BuildOS}_${__BuildArch}_${__BuildType}.wrn" -__BuildErr="$__LogsDir/${__BuildLogRootName}_${__BuildOS}_${__BuildArch}_${__BuildType}.err" -__MSBuildLogArgs="/fileloggerparameters:\"Verbosity=normal;LogFile=$__BuildLog\" \ -/fileloggerparameters1:\"WarningsOnly;LogFile=$__BuildWrn\" \ -/fileloggerparameters2:\"ErrorsOnly;LogFile=$__BuildErr\" \ -/consoleloggerparameters:Summary \ -/verbosity:minimal" - -buildCommand="$__MSBuild $__ProjectDir/tests/runtest.proj /p:RunTests=true /clp:showcommandline $__MSBuildLogArgs" -buildCommand="$buildCommand /p:__BuildOS=$__BuildOS /p:__BuildArch=$__BuildArch /p:__BuildType=$__BuildType /p:__LogsDir=$__LogsDir" -echo "$buildCommand" -eval "$buildCommand" +if ((countFailedTests > 0)); then + exit $EXIT_CODE_TEST_FAILURE +fi +exit $EXIT_CODE_SUCCESS From 379bc340fc033c9c81253d7ba52f69cf015de507 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 28 Jun 2018 15:56:22 -0700 Subject: [PATCH 31/45] Use latest xunit console runner everywhere --- dependencies.props | 6 +++--- tests/helixprep.proj | 10 +++++----- tests/scripts/scripts.csproj | 4 ++-- tests/src/Common/external/external.depproj | 18 ++++++++---------- .../benchmark+roslyn/benchmark+roslyn.csproj | 4 ++-- .../benchmark+serialize.csproj | 4 ++-- .../src/JIT/config/benchmark/benchmark.csproj | 4 ++-- tests/src/performance/performance.csproj | 4 ++-- tests/tests.targets | 2 +- 9 files changed, 27 insertions(+), 29 deletions(-) diff --git a/dependencies.props b/dependencies.props index 196b09887c49..b8f2482a001f 100644 --- a/dependencies.props +++ b/dependencies.props @@ -36,7 +36,7 @@ 99.99.99-master-20180703-0030 3.0.0-preview1-26704-01 2.2.0-beta2-build3300 - 2.2.0-preview1-02830-02 + 2.4.0-beta.2.build4010 1.0.0-beta-build0015 2.0.4 2.2.0 @@ -164,8 +164,8 @@ $(XunitPerformanceApiPackageVersion) - - $(XunitConsoleNetcorePackageVersion) + + $(XunitPackageVersion) diff --git a/tests/helixprep.proj b/tests/helixprep.proj index 2d08e91b13c6..1cbf0ed0f8bf 100644 --- a/tests/helixprep.proj +++ b/tests/helixprep.proj @@ -38,7 +38,7 @@ Inputs="@(XunitDlls)" Outputs="$(TestWorkingDir)archive\**" > - @@ -85,8 +85,8 @@ set CORE_ROOT=%HELIX_CORRELATION_PAYLOAD% $(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% @@ -149,8 +149,8 @@ EXIT /B %ERRORLEVEL% $(WrapperShContents)%0a $(WrapperShContents)echo BEGIN EXECUTION%0a - $(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)"%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)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)"%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)ErrorLevel=%24%3F%0a $(WrapperShContents)%0a $(WrapperShContents)echo Finished running tests. Exit code = %24ErrorLevel%0a diff --git a/tests/scripts/scripts.csproj b/tests/scripts/scripts.csproj index b1a1aab6e54e..e803a60a37b0 100644 --- a/tests/scripts/scripts.csproj +++ b/tests/scripts/scripts.csproj @@ -14,8 +14,8 @@ 1.0.0-alpha-build0040 - - 1.0.2-prerelease-00177 + + $(XunitPackageVersion) 1.0.0-prerelease-00629-04 diff --git a/tests/src/Common/external/external.depproj b/tests/src/Common/external/external.depproj index 46d753cdf019..e586a8d2ebd1 100644 --- a/tests/src/Common/external/external.depproj +++ b/tests/src/Common/external/external.depproj @@ -12,8 +12,7 @@ win7-x64 true $(TargetingPackPath) - xunit.console.netcore - xunit.runner.console + xunit.runner.console SharedLibrary false @@ -45,8 +44,8 @@ $(XunitPackageVersion) - - $(XunitConsoleNetcorePackageVersion) + + $(XunitPackageVersion) $(XunitPackageVersion) @@ -75,7 +74,6 @@ - @@ -84,14 +82,14 @@ $(SourceDir)Common\external\obj\project.assets.json - - + false $(XUnitRunnerPackageId) diff --git a/tests/src/JIT/config/benchmark+roslyn/benchmark+roslyn.csproj b/tests/src/JIT/config/benchmark+roslyn/benchmark+roslyn.csproj index 563a9a708704..881d84ff55c0 100644 --- a/tests/src/JIT/config/benchmark+roslyn/benchmark+roslyn.csproj +++ b/tests/src/JIT/config/benchmark+roslyn/benchmark+roslyn.csproj @@ -82,8 +82,8 @@ $(XunitPackageVersion) - - $(XunitConsoleNetcorePackageVersion) + + $(XunitPackageVersion) $(XunitPackageVersion) diff --git a/tests/src/JIT/config/benchmark+serialize/benchmark+serialize.csproj b/tests/src/JIT/config/benchmark+serialize/benchmark+serialize.csproj index d554c165f6b4..d2789e5957ad 100644 --- a/tests/src/JIT/config/benchmark+serialize/benchmark+serialize.csproj +++ b/tests/src/JIT/config/benchmark+serialize/benchmark+serialize.csproj @@ -79,8 +79,8 @@ $(XunitPackageVersion) - - $(XunitConsoleNetcorePackageVersion) + + $(XunitPackageVersion) $(XunitPackageVersion) diff --git a/tests/src/JIT/config/benchmark/benchmark.csproj b/tests/src/JIT/config/benchmark/benchmark.csproj index 4d49fdee3ead..aecfdec2773e 100644 --- a/tests/src/JIT/config/benchmark/benchmark.csproj +++ b/tests/src/JIT/config/benchmark/benchmark.csproj @@ -97,8 +97,8 @@ $(XunitPackageVersion) - - $(XunitConsoleNetcorePackageVersion) + + $(XunitPackageVersion) $(XunitPackageVersion) diff --git a/tests/src/performance/performance.csproj b/tests/src/performance/performance.csproj index 94caf35ac235..c6c0b5c98dd1 100644 --- a/tests/src/performance/performance.csproj +++ b/tests/src/performance/performance.csproj @@ -94,8 +94,8 @@ $(XunitPackageVersion) - - $(XunitConsoleNetcorePackageVersion) + + $(XunitPackageVersion) $(XunitPackageVersion) diff --git a/tests/tests.targets b/tests/tests.targets index 58fb394fb05b..9a16cb0e0bd2 100644 --- a/tests/tests.targets +++ b/tests/tests.targets @@ -40,7 +40,7 @@ - $(PackagesDir)\xunit.runner.console\2.4.0-beta.2.build4010\tools\netcoreapp2.0\xunit.console.dll + $(CORE_ROOT)\xunit.console.dll -parallel $(ParallelRun) $(XunitArgs) -html $(__TestRunHtmlLog) From 4ccf85e211050e5578a53cc145405a6075e6a5e2 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 28 Jun 2018 16:08:31 -0700 Subject: [PATCH 32/45] Remove extra StaticDependency on xunit.runner.console --- dependencies.props | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dependencies.props b/dependencies.props index b8f2482a001f..4ef55d7ebd58 100644 --- a/dependencies.props +++ b/dependencies.props @@ -164,10 +164,6 @@ $(XunitPerformanceApiPackageVersion) - - $(XunitPackageVersion) - - %(Identity) true From 51fae7858a0fb4ecf43381f36d7b3918d4902278 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 29 Jun 2018 10:06:45 -0700 Subject: [PATCH 33/45] Eliminate tests/src/dir.common.props, and rename dir.sdkbuild.props tests/src/dir.common.props was only used for the desktop-specific xunit wrapper helper library. There's no need for it any more, so its properties have been moved into tests/src/dir.props. dir.sdkbuild.props has been renamed to dir.common.props, since it contains properties used by SDK projects and buildtools projects. This change also re-enables the test build. --- build-test.sh | 2 +- dir.common.props | 3 +- .../{dir.sdkbuild.props => dir.common.props} | 11 ++-- tests/runtest.proj | 2 +- .../Coreclr.TestWrapper.csproj | 2 +- tests/src/dir.common.props | 52 ------------------- tests/src/dir.props | 49 ++++++++++++++++- 7 files changed, 60 insertions(+), 61 deletions(-) rename tests/{dir.sdkbuild.props => dir.common.props} (66%) delete mode 100644 tests/src/dir.common.props diff --git a/build-test.sh b/build-test.sh index 44a3abfbd507..614a03af8f80 100755 --- a/build-test.sh +++ b/build-test.sh @@ -238,7 +238,7 @@ build_Tests() echo "Starting the Managed Tests Build..." - # build_Tests_internal "Tests_Managed" "$__ProjectDir/tests/build.proj" "Managed tests build (build tests)" "$__up" + 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)" diff --git a/dir.common.props b/dir.common.props index 247268c06b15..f94528972e90 100644 --- a/dir.common.props +++ b/dir.common.props @@ -1,7 +1,8 @@ + projects and test projects. It's imported by + tests/dir.common.props, and the global dir.props. --> $(MSBuildThisFileDirectory) diff --git a/tests/dir.sdkbuild.props b/tests/dir.common.props similarity index 66% rename from tests/dir.sdkbuild.props rename to tests/dir.common.props index 2eba621c695a..edc386a145f5 100644 --- a/tests/dir.sdkbuild.props +++ b/tests/dir.common.props @@ -1,10 +1,13 @@ - + $(BuildOS).$(Platform).$(Configuration) diff --git a/tests/runtest.proj b/tests/runtest.proj index 6251be72778b..ac0d992cf433 100644 --- a/tests/runtest.proj +++ b/tests/runtest.proj @@ -76,7 +76,7 @@ $(_XunitEpilog) - + $(XUnitTestBinBase)\$(CategoryWithSlash) diff --git a/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj b/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj index d7afc4842a59..2a4d0c82d137 100644 --- a/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj +++ b/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj @@ -1,6 +1,6 @@ - + false diff --git a/tests/src/dir.common.props b/tests/src/dir.common.props deleted file mode 100644 index 8be235d605b1..000000000000 --- a/tests/src/dir.common.props +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - true - false - full - $(DefineConstants);DEBUG;TRACE;XUNIT_PERF - - - true - true - pdbonly - $(DefineConstants);TRACE;XUNIT_PERF - - - true - true - full - $(DefineConstants);DEBUG;TRACE;XUNIT_PERF - - - - - 64 - 64 - 32 - 32 - - - - - $(ProjectDir)\..\bin\tests - $(__TestRootDir) - $(BaseOutputPath)\$(OSPlatformConfig)\ - $(BaseOutputPathWithConfig) - $(ProjectDir)\..\bin\tests\obj\$(OSPlatformConfig)\Managed\ - $(__ManagedTestIntermediatesDir)\ - <__NativeTestIntermediatesDir Condition="'$(__NativeTestIntermediatesDir)' == ''">$([System.IO.Path]::GetFullPath($(BaseOutputPathWithConfig)..\obj\$(BuildOS).$(Platform).$(Configuration)\Native\)) - $(MSBuildProjectName)\ - $([System.String]::Copy('$(MSBuildProjectDirectory)').Replace($(SourceDir),''))\$(MSBuildProjectName) - $(BaseIntermediateOutputPath)$(BuildProjectRelativeDir)\ - $(BaseOutputPathWithConfig)$(BuildProjectRelativeDir)\ - $(BaseOutputPath)\testStagingDir\ - $(TestWorkingDir)$(OSPlatformConfig)\$(MSBuildProjectName)/ - - - - diff --git a/tests/src/dir.props b/tests/src/dir.props index 95306e1c596f..f3f229de9abe 100644 --- a/tests/src/dir.props +++ b/tests/src/dir.props @@ -1,5 +1,52 @@ - + + + + + + + true + false + full + $(DefineConstants);DEBUG;TRACE;XUNIT_PERF + + + true + true + pdbonly + $(DefineConstants);TRACE;XUNIT_PERF + + + true + true + full + $(DefineConstants);DEBUG;TRACE;XUNIT_PERF + + + + + 64 + 64 + 32 + 32 + + + + + $(ProjectDir)\..\bin\tests + $(__TestRootDir) + $(BaseOutputPath)\$(OSPlatformConfig)\ + $(BaseOutputPathWithConfig) + $(ProjectDir)\..\bin\tests\obj\$(OSPlatformConfig)\Managed\ + $(__ManagedTestIntermediatesDir)\ + <__NativeTestIntermediatesDir Condition="'$(__NativeTestIntermediatesDir)' == ''">$([System.IO.Path]::GetFullPath($(BaseOutputPathWithConfig)..\obj\$(BuildOS).$(Platform).$(Configuration)\Native\)) + $(MSBuildProjectName)\ + $([System.String]::Copy('$(MSBuildProjectDirectory)').Replace($(SourceDir),''))\$(MSBuildProjectName) + $(BaseIntermediateOutputPath)$(BuildProjectRelativeDir)\ + $(BaseOutputPathWithConfig)$(BuildProjectRelativeDir)\ + $(BaseOutputPath)\testStagingDir\ + $(TestWorkingDir)$(OSPlatformConfig)\$(MSBuildProjectName)/ + From 9c49d855fc8db3e80144c91adb250200896b21b0 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 29 Jun 2018 10:32:22 -0700 Subject: [PATCH 34/45] Reintroduce dir.sdkbuild.props as a place for SDK-only props With this, some properties shared by SDK projects can go in a global location. The TargetFramework is shared by all SDK projects in the test tree. This change also uses a property for the xunit package directory that contains the xunit.console.dll we copy to core_root. --- tests/dir.sdkbuild.props | 14 ++++++++++++++ tests/runtest.proj | 8 +------- .../Coreclr.TestWrapper/Coreclr.TestWrapper.csproj | 8 +------- tests/src/Common/external/external.depproj | 9 +++++---- 4 files changed, 21 insertions(+), 18 deletions(-) create mode 100644 tests/dir.sdkbuild.props diff --git a/tests/dir.sdkbuild.props b/tests/dir.sdkbuild.props new file mode 100644 index 000000000000..b5a0fdd07662 --- /dev/null +++ b/tests/dir.sdkbuild.props @@ -0,0 +1,14 @@ + + + + + + + netcoreapp2.0 + false + false + + + diff --git a/tests/runtest.proj b/tests/runtest.proj index ac0d992cf433..4c4c25f83ac5 100644 --- a/tests/runtest.proj +++ b/tests/runtest.proj @@ -76,20 +76,14 @@ $(_XunitEpilog) - + $(XUnitTestBinBase)\$(CategoryWithSlash) - false - - netcoreapp2.0 - false - - diff --git a/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj b/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj index 2a4d0c82d137..77629e65545e 100644 --- a/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj +++ b/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj @@ -1,16 +1,10 @@ - - - - false - + - netcoreapp2.0 - false true diff --git a/tests/src/Common/external/external.depproj b/tests/src/Common/external/external.depproj index e586a8d2ebd1..aedcfe01fefb 100644 --- a/tests/src/Common/external/external.depproj +++ b/tests/src/Common/external/external.depproj @@ -13,6 +13,7 @@ true $(TargetingPackPath) xunit.runner.console + netcoreapp1.0 SharedLibrary false @@ -83,13 +84,13 @@ - false $(XUnitRunnerPackageId) @@ -97,4 +98,4 @@ - \ No newline at end of file + From db49431b6a5d04c807e287e527c216cbbeca47c0 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 29 Jun 2018 10:59:57 -0700 Subject: [PATCH 35/45] Add xml namespace to dir.common.props This fixes a failure in the windows build. --- tests/dir.common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/dir.common.props b/tests/dir.common.props index edc386a145f5..5c596c0fed86 100644 --- a/tests/dir.common.props +++ b/tests/dir.common.props @@ -1,4 +1,4 @@ - + @@ -47,7 +46,6 @@ $(ToolsDir)dotnetcli\ $(ToolsDir)net46\ $(DotnetCliPath)dotnet - $(ToolsDir)\Microsoft.CSharp.Core.targets <_TargetFrameworkDirectories Condition="'$(BuildToolsTargetsDesktop)' != 'true'">$(MSBuildThisFileDirectory)/Documentation From 96a11ef048d1dd53fdb42de59e84773c0ad175c0 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 6 Jul 2018 10:47:20 -0700 Subject: [PATCH 40/45] Remove UseRoslynCompilers prop and unify roslyn import UseRoslynCompilers was introduced in buildtools by https://github.com/dotnet/buildtools/pull/947, with different behaviors on windows/unix. It was removed by https://github.com/dotnet/buildtools/pull/1974, so we can unify our roslyn imports now. --- tests/dir.props | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/dir.props b/tests/dir.props index ddebf485f998..5b0713610d98 100644 --- a/tests/dir.props +++ b/tests/dir.props @@ -103,8 +103,7 @@ - - + From 8814d88be1841fcd0413f62d7aa4b7181c6131b1 Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Mon, 9 Jul 2018 15:41:16 -0700 Subject: [PATCH 41/45] Remove duplicate properties --- tests/src/dir.props | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/src/dir.props b/tests/src/dir.props index 1d5bd8d16bb5..f3f229de9abe 100644 --- a/tests/src/dir.props +++ b/tests/src/dir.props @@ -60,12 +60,6 @@ true Test - - - false - netcoreapp2.2 - false - From 3f2c0cda72fefdf26d1d3637619eb5b484fd0b33 Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Mon, 9 Jul 2018 15:52:50 -0700 Subject: [PATCH 42/45] Don't import dirs.props/targets in coreclr.testwrapper --- .../Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj b/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj index 77629e65545e..7d54a7d2d27a 100644 --- a/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj +++ b/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj @@ -2,6 +2,12 @@ + + + false + false + + From 6111010727eb96b72645a53e03ea3ccb9a9f80b3 Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Tue, 10 Jul 2018 13:04:23 -0700 Subject: [PATCH 43/45] Fix build for vs2015 --- tests/src/nobuild.targets | 2 +- tests/src/runonly.targets | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/nobuild.targets b/tests/src/nobuild.targets index be508e32bd03..491865a98965 100644 --- a/tests/src/nobuild.targets +++ b/tests/src/nobuild.targets @@ -1,4 +1,4 @@ - + diff --git a/tests/src/runonly.targets b/tests/src/runonly.targets index 3ac460afb7e9..2e01bc7ec8e8 100644 --- a/tests/src/runonly.targets +++ b/tests/src/runonly.targets @@ -1,4 +1,4 @@ - + From 829c52b4dd5294e18d49b674c5be7ae4f3633957 Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Tue, 10 Jul 2018 17:45:23 -0700 Subject: [PATCH 44/45] Undo fix for test wrapper. --- .../Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj b/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj index 7d54a7d2d27a..4da4c36c1c3e 100644 --- a/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj +++ b/tests/src/Common/Coreclr.TestWrapper/Coreclr.TestWrapper.csproj @@ -1,13 +1,6 @@ - - - - false - false - - From 52801980c1b4ebdde2551540a39d11139544a67e Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Tue, 10 Jul 2018 17:46:03 -0700 Subject: [PATCH 45/45] Add dummy directory.build.props/targets to common folder to prevent them picking up dirs.props/targets automatically --- tests/src/Common/Directory.Build.props | 8 ++++++++ tests/src/Common/Directory.Build.targets | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 tests/src/Common/Directory.Build.props create mode 100644 tests/src/Common/Directory.Build.targets diff --git a/tests/src/Common/Directory.Build.props b/tests/src/Common/Directory.Build.props new file mode 100644 index 000000000000..ea5280734f27 --- /dev/null +++ b/tests/src/Common/Directory.Build.props @@ -0,0 +1,8 @@ + + + \ No newline at end of file diff --git a/tests/src/Common/Directory.Build.targets b/tests/src/Common/Directory.Build.targets new file mode 100644 index 000000000000..09cfd7a44e10 --- /dev/null +++ b/tests/src/Common/Directory.Build.targets @@ -0,0 +1,8 @@ + + + \ No newline at end of file