diff options
author | Jarret Shook <jashoo@microsoft.com> | 2018-09-15 08:57:22 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-15 08:57:22 -0700 |
commit | d47162260d4e202bb06fcc7449fadbfd2955b83b (patch) | |
tree | 0784a1cc13c3e86ebdf29017f633ed3bc8c4cbec /tests | |
parent | 799508eb77045482d1e2bf13c6696c6b248de0b6 (diff) | |
download | coreclr-d47162260d4e202bb06fcc7449fadbfd2955b83b.tar.gz coreclr-d47162260d4e202bb06fcc7449fadbfd2955b83b.tar.bz2 coreclr-d47162260d4e202bb06fcc7449fadbfd2955b83b.zip |
Layout native test components correctly on unix (#19918)
* Enable native test build and add skipmanaged
* Fix adding native components to test dir
* Clean pri1/pri0 builds with native lib copy
This change disables the build of several tests which have native
dependencies; however, would not build the native dependencies on
unix. At copy time this would result in a build-test failure. In
addition, it fixes, adding executables and dynamic/static libraries
to the test's location.
It has been tested with build-test.sh priority1.
* Fix comment wording
* Remove buildagainstpackage arg
* Fix default clang version
* Clean pri1 run OSX
* Correct test count on unix
* Address typo
* Merge runtest.proj
Diffstat (limited to 'tests')
-rw-r--r-- | tests/runtest.proj | 6 | ||||
-rw-r--r-- | tests/src/Interop/COM/NativeClients/Primitives.csproj | 3 | ||||
-rw-r--r-- | tests/src/Interop/IJW/ManagedCallingNative/ManagedCallingNative.csproj | 2 | ||||
-rw-r--r-- | tests/src/Interop/IJW/NativeCallingManaged/NativeCallingManaged.csproj | 2 | ||||
-rw-r--r-- | tests/src/dir.targets | 44 |
5 files changed, 49 insertions, 8 deletions
diff --git a/tests/runtest.proj b/tests/runtest.proj index 3a04064ddb..2db2918353 100644 --- a/tests/runtest.proj +++ b/tests/runtest.proj @@ -71,7 +71,7 @@ <Error Condition="'$(CLRTestPriorityToBuild)' == '0' and '$(TestCount)' <= 2000" Text="Unexpected test count. Expected > 2000, found $(TestCount).'" /> <Error Condition="'$(CLRTestPriorityToBuild)' == '0' and '$(TestCount)' >= 3000" Text="Unexpected test count. Expected < 3000, found $(TestCount).'" /> - <Error Condition="'$(CLRTestPriorityToBuild)' == '1' and '$(TestCount)' <= 12000" Text="Unexpected test count. Expected > 12000, found $(TestCount).'" /> + <Error Condition="'$(CLRTestPriorityToBuild)' == '1' and '$(TestCount)' <= 11500" Text="Unexpected test count. Expected > 1150, found $(TestCount).'" /> <Error Condition="'$(CLRTestPriorityToBuild)' != '0' and '$(CLRTestPriorityToBuild)' != '1'" Text="Unknown priority $(CLRTestPriorityToBuild)" /> </Target> @@ -313,10 +313,6 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\",""). </AllCommands> <AllXUnitFacts Include= "%(AllCommands._XunitFact)" /> </ItemGroup> - - <Message Text="HasExcludes: $(HaveExcludes)" Importance="high"/> - <Message Text="CanonicalExcludeList: @(CanonicalExcludeList)" Importance="high"/> - </Target> <Target Name="CreateAllWrappers" DependsOnTargets="GetListOfTestCmds;FindCmdDirectories"> diff --git a/tests/src/Interop/COM/NativeClients/Primitives.csproj b/tests/src/Interop/COM/NativeClients/Primitives.csproj index ff06eccfc5..b9fb912213 100644 --- a/tests/src/Interop/COM/NativeClients/Primitives.csproj +++ b/tests/src/Interop/COM/NativeClients/Primitives.csproj @@ -5,6 +5,9 @@ <PropertyGroup> <IgnoreCoreCLRTestLibraryDependency>true</IgnoreCoreCLRTestLibraryDependency> <CLRTestScriptLocalCoreShim>true</CLRTestScriptLocalCoreShim> + + <TestUnsupportedOutsideWindows>true</TestUnsupportedOutsideWindows> + <DisableProjectBuild Condition="'$(TargetsUnix)' == 'true'">true</DisableProjectBuild> </PropertyGroup> <ItemGroup> <Compile Include="$(InteropCommonDir)ExeLauncherProgram.cs" /> diff --git a/tests/src/Interop/IJW/ManagedCallingNative/ManagedCallingNative.csproj b/tests/src/Interop/IJW/ManagedCallingNative/ManagedCallingNative.csproj index 4afe388e53..63bd757245 100644 --- a/tests/src/Interop/IJW/ManagedCallingNative/ManagedCallingNative.csproj +++ b/tests/src/Interop/IJW/ManagedCallingNative/ManagedCallingNative.csproj @@ -12,7 +12,9 @@ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> <!-- IJW is Windows-only --> + <!-- Test unsupported outside of windows --> <TestUnsupportedOutsideWindows>true</TestUnsupportedOutsideWindows> + <DisableProjectBuild Condition="'$(TargetsUnix)' == 'true'">true</DisableProjectBuild> <!-- IJW is not supported on ARM64 --> <DisableProjectBuild Condition="'$(Platform)' == 'arm64'">true</DisableProjectBuild> diff --git a/tests/src/Interop/IJW/NativeCallingManaged/NativeCallingManaged.csproj b/tests/src/Interop/IJW/NativeCallingManaged/NativeCallingManaged.csproj index 3b92603041..d20f962adb 100644 --- a/tests/src/Interop/IJW/NativeCallingManaged/NativeCallingManaged.csproj +++ b/tests/src/Interop/IJW/NativeCallingManaged/NativeCallingManaged.csproj @@ -12,7 +12,9 @@ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> <!-- IJW is Windows-only --> + <!-- Test unsupported outside of windows --> <TestUnsupportedOutsideWindows>true</TestUnsupportedOutsideWindows> + <DisableProjectBuild Condition="'$(TargetsUnix)' == 'true'">true</DisableProjectBuild> <!-- IJW is not supported on ARM64 --> <DisableProjectBuild Condition="'$(Platform)' == 'arm64'">true</DisableProjectBuild> diff --git a/tests/src/dir.targets b/tests/src/dir.targets index 147c70eaa1..3e3ce9b61f 100644 --- a/tests/src/dir.targets +++ b/tests/src/dir.targets @@ -119,7 +119,45 @@ <Target Name="CopyNativeProjectBinaries"> <ItemGroup> - <NativeProjectBinaries Include="$(NativeProjectOutputFolder)\**\*.*" /> + <NativeProjectBinaries Condition="'$(RunningOnUnix)' != 'true'" Include="$(NativeProjectOutputFolder)\**\*.*" /> + + <!-- ############################################################### --> + <!-- The following is unix only. It is required because the unix test--> + <!-- build, unlike the windows test build, do not place the binaries --> + <!-- built into a separate Debug/Checked/Release directory. Therefore--> + <!-- we must filter the folder to only include dynamic libraries, --> + <!-- static libraries and executables. --> + <!-- --> + <!-- Please take care when modifying the following lines of code. --> + <!-- At a minimum to test any changes to the below, please run a --> + <!-- pri1 test build. --> + <!-- ############################################################### --> + + <!-- Include everything and then filter. --> + <NativeProjectBinariesMatched Condition="'$(RunningOnUnix)' == 'true'" Include="$(NativeProjectOutputFolder)\**\*.*" /> + + <!-- Filter executables on unix --> + <NativeProjectBinariesExeFilter Condition="'$(RunningOnUnix)' == 'true' and $([System.Text.RegularExpressions.Regex]::IsMatch(['%(Identity)', `(.*\/)([^.]+)$`))" Include="@(NativeProjectBinariesMatched)" /> + <!-- Filter out the *Make* files --> + <NativeProjectBinariesExeFilterRemovedMakeFile Condition="'$(RunningOnUnix)' == 'true' and !$([System.Text.RegularExpressions.Regex]::IsMatch(['%(Identity)', `.*Makefile.*`))" Include="@(NativeProjectBinariesExeFilter)" /> + + <!-- Filter out the CMakeFiles files --> + <NativeProjectBinariesExeFilterRemovedCMakeFile Condition="'$(RunningOnUnix)' == 'true' and !$([System.Text.RegularExpressions.Regex]::IsMatch(['%(Identity)', `.*CMakeFiles.*`))" Include="@(NativeProjectBinariesExeFilterRemovedMakeFile)" /> + + <!-- Filter .dylib files on OSX --> + <NativeProjectBinariesDyLibFilter Condition="'$(__BuildOS)' == 'OSX' and $([System.Text.RegularExpressions.Regex]::IsMatch(['%(Identity)', `(.*\/).*\.dylib`))" Include="@(NativeProjectBinariesMatched)" /> + + <!-- Filter .so files on Linux --> + <NativeProjectBinariesDyLibFilter Condition="'$(__BuildOS)' == 'Linux' and $([System.Text.RegularExpressions.Regex]::IsMatch(['%(Identity)', `(.*\/).*\.so`))" Include="@(NativeProjectBinariesMatched)" /> + + <!-- Filter static lib files on Unix --> + <NativeProjectBinariesStaticLibFilter Condition="'$(RunningOnUnix)' == 'true' and $([System.Text.RegularExpressions.Regex]::IsMatch(['%(Identity)', `(.*\/).*\.a`))" Include="@(NativeProjectBinariesMatched)" /> + + <!-- Merge the filtered lists --> + <NativeProjectBinaries Condition="'$(RunningOnUnix)' == 'true'" Include="@(NativeProjectBinariesExeFilterRemovedCMakeFile)" /> + <NativeProjectBinaries Condition="'$(RunningOnUnix)' == 'true'" Include="@(NativeProjectBinariesDyLibFilter)" /> + <NativeProjectBinaries Condition="'$(RunningOnUnix)' == 'true'" Include="@(NativeProjectBinariesStaticLibFilter)" /> + </ItemGroup> <Error Text="The native project files are missing in $(NativeProjectOutputFolder) please run build from the root of the repo at least once" @@ -127,7 +165,7 @@ <Copy SourceFiles="@(NativeProjectBinaries)" - DestinationFiles="@(NativeProjectBinaries -> '$(OutDir)%(RecursiveDir)%(Filename)%(Extension)')" + DestinationFiles="@(NativeProjectBinaries -> '$(OutDir)%(Filename)%(Extension)')" SkipUnchangedFiles="$(SkipCopyUnchangedFiles)" OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)" Retries="$(CopyRetryCount)" @@ -157,7 +195,7 @@ <Message Text= "Full native project references are :%(NativeProjectReferenceNormalized.Identity)" /> <Message Text= "Native binaries will be copied from :%(NativeProjectOutputFoldersToCopy.Identity)" /> - <MSBuild Projects="$(MSBuildProjectFile)" Targets="CopyNativeProjectBinaries" Properties="NativeProjectOutputFolder=%(NativeProjectOutputFoldersToCopy.Identity)" Condition="'@(NativeProjectReference)' != '' And '$(RunningOnUnix)' != 'true'" /> + <MSBuild Projects="$(MSBuildProjectFile)" Targets="CopyNativeProjectBinaries" Properties="NativeProjectOutputFolder=%(NativeProjectOutputFoldersToCopy.Identity)" Condition="'@(NativeProjectReference)' != ''" /> </Target> |