Infra fixes for bugs uncovered by testing of the JIT/Methodical merged tests (#67393)
authorTomáš Rylek <trylek@microsoft.com>
Sat, 2 Apr 2022 09:25:50 +0000 (11:25 +0200)
committerGitHub <noreply@github.com>
Sat, 2 Apr 2022 09:25:50 +0000 (11:25 +0200)
* Move copying of merged wrapper native components to copynative step

* Move export of test exclusion file before ILLink changing CORE_ROOT

* Fix file mode for test execution bash scripts

* Add out-of-proc test folders to Helix work item payloads

* Fix Helix publishing in the presence of out-of-process tests

* Use a marker file triggered off of a project property to determine which files to skip running the Mono AOT compiler on (some tests fail at AOT time, so we need this to work around that limitation)

* Pass runtimeVariant to the Core_Root construction for the test exclusion list creation

* Don't write the output element when there's no test output. This causes issues with Helix test uploading.

* Write xunit results the way xharness expects to read them for wasm so we correctly report failures and don't report a test harness failure.

* Fix GeneratedTestRunner to build.

* Fix copying native wrappers for merged test runners.

Pre-emptively mark another test as RequiresProcessIsolation as I stumbled upon it while fixing this

* Fix copying of native test components to merged wrapper outputs

Due to Pri0 / Pri1 test grouping we may end up building the
wrapper in a different group than its components. Make sure that
we populate all native components of merged wrapper dependencies
before we copy them over to the merged wrapper output folder.

* Exclude wasm support files.

Co-authored-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
36 files changed:
eng/pipelines/common/templates/runtimes/run-test-job.yml
src/tests/Common/CLRTest.Execute.Bash.targets
src/tests/Common/CLRTest.Execute.Batch.targets
src/tests/Common/Directory.Build.targets
src/tests/Common/XHarnessRunnerLibrary/GeneratedTestRunner.cs
src/tests/Common/XHarnessRunnerLibrary/RunnerEntryPoint.cs
src/tests/Common/XUnitWrapperLibrary/TestSummary.cs
src/tests/Common/helixpublishwitharcade.proj
src/tests/Directory.Build.targets
src/tests/Exceptions/ForeignThread/ForeignThreadExceptions.csproj
src/tests/Interop/DisabledRuntimeMarshalling/DisabledRuntimeMarshalling_Disabled_NativeAssemblyEnabled.csproj
src/tests/Interop/SuppressGCTransition/SuppressGCTransitionTest.csproj
src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.csproj
src/tests/JIT/Directed/callconv/Directory.Build.props [new file with mode: 0644]
src/tests/JIT/Directed/pinning/object-pin/CMakeLists.txt
src/tests/JIT/Directed/pinvoke/CMakeLists.txt
src/tests/JIT/HardwareIntrinsics/General/Vector256_1/Vector256_1_r.csproj
src/tests/JIT/Methodical/ELEMENT_TYPE_IU/u_conv_il_r.ilproj
src/tests/JIT/Methodical/eh/deadcode/deadoponerrorinfunclet_il_d.ilproj
src/tests/JIT/Methodical/eh/deadcode/deadoponerrorinfunclet_il_r.ilproj
src/tests/JIT/Methodical/flowgraph/dev10_bug679008/helper.ilproj
src/tests/JIT/Methodical/structs/systemvbringup/CMakeLists.txt
src/tests/JIT/Performance/CodeQuality/Roslyn/CscBench.csproj
src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M02/b108129/CMakeLists.txt
src/tests/JIT/jit64/hfa/main/dll/CMakeLists.txt
src/tests/JIT/jit64/localloc/ehverify/eh07_large.ilproj
src/tests/JIT/jit64/mcc/interop/CMakeLists.txt
src/tests/JIT/opt/virtualstubdispatch/bigvtbl/Directory.Build.props [new file with mode: 0644]
src/tests/Loader/NativeLibs/FromNativePaths.csproj
src/tests/Loader/classloader/RefFields/Validate.csproj
src/tests/Loader/classloader/explicitlayout/NestedStructs/case03.csproj
src/tests/Loader/classloader/explicitlayout/NestedStructs/case04.csproj
src/tests/Loader/classloader/explicitlayout/NestedStructs/case05.csproj
src/tests/Loader/classloader/explicitlayout/objrefandnonobjrefoverlap/Directory.Build.props [new file with mode: 0644]
src/tests/baseservices/typeequivalence/simple/Simple.csproj
src/tests/build.proj

index 544e6c9..0328800 100644 (file)
@@ -300,7 +300,7 @@ jobs:
     # Compose the Core_Root folder containing all artifacts needed for running
     # CoreCLR tests. This step also compiles the framework using Crossgen / Crossgen2
     # in ReadyToRun jobs.
-    - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) generatelayoutonly $(logRootNameArg)Layout $(runtimeFlavorArgs) $(crossgenArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(librariesOverrideArg)
+    - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) generatelayoutonly $(logRootNameArg)Layout $(runtimeFlavorArgs) $(crossgenArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(librariesOverrideArg) $(runtimeVariantArg)
       displayName: Generate CORE_ROOT
 
     # Build a Mono LLVM AOT cross-compiler for non-amd64 targets (in this case, just arm64)
index fe56a45..d2d04b5 100644 (file)
@@ -306,8 +306,6 @@ $__Command msbuild $CORE_ROOT/wasm-test-runner/WasmTestRunner.proj /p:NetCoreApp
     <![CDATA[
 $(BashLinkerTestLaunchCmds)
 
-export TestExclusionListPath=$CORE_ROOT/TestExclusionList.txt
-
 _DebuggerArgsSeparator=
 if [[ "$_DebuggerFullPath" == *lldb* ]];
 then
@@ -549,6 +547,7 @@ $(BashCLRTestExitCodePrep)
 $(IlasmRoundTripBashScript)
 # Allow precommands to override the ExePath
 ExePath=$(InputAssemblyName)
+export TestExclusionListPath=$CORE_ROOT/TestExclusionList.txt
 # PreCommands
 $(BashCLRTestPreCommands)
 # Launch
@@ -561,15 +560,23 @@ $(BashCLRTestExitCodeCheck)
 
     </PropertyGroup>
 
+    <PropertyGroup>
+      <ExecutionBashScriptPath>$(OutputPath)/$(MSBuildProjectName).sh</ExecutionBashScriptPath>
+    </PropertyGroup>
+
     <!-- Write the file.
          Note: under the hood, this will rely on Environment.NewLine for line
          endings. This means that if the scripts are being generated on Windows,
          the line endings will need to be changed from CR-LF to Unix (LF) line
-         endings before running the scripts on Unix platforms. -->
+         endings before running the scripts on Unix platforms. In our current lab
+         infra it shouldn't really matter as the execution scripts are regenerated
+         in the 'test run' phase before sending the items to Helix i.o.w. at
+         the point where we already know the exact targeting platform. -->
     <WriteLinesToFile
-      File="$(OutputPath)\$(MSBuildProjectName).sh"
+      File="$(ExecutionBashScriptPath)"
       Lines="$(_CLRTestExecutionScriptText)"
       Overwrite="true" />
+    <Exec Command="chmod +x $(ExecutionBashScriptPath)" EchoOff="true" />
   </Target>
 
 </Project>
index 963ce3e..4fdd689 100644 (file)
@@ -301,8 +301,6 @@ COPY /y %CORE_ROOT%\CoreShim.dll .
 $(BatchLinkerTestLaunchCmds)
 $(BatchCopyCoreShimLocalCmds)
 
-set TestExclusionListPath=%CORE_ROOT%\TestExclusionList.txt
-
 IF NOT "%CLRCustomTestLauncher%"=="" (
   set LAUNCHER=call %CLRCustomTestLauncher% %scriptPath%
 ) ELSE (
@@ -449,6 +447,7 @@ $(IlasmRoundTripBatchScript)
 
 REM Allow precommands to override the ExePath
 set ExePath=$(InputAssemblyName)
+set TestExclusionListPath=%CORE_ROOT%\TestExclusionList.txt
 
 REM Precommands
 $(CLRTestBatchPreCommands)
index 4f31cd9..79d1b92 100644 (file)
 
   </Target>
 
+  <!-- At this point Common test dependencies don't have any native components -->
+  <Target Name="CopyAllNativeProjectReferenceBinaries" />
+
 </Project>
index 70f9b7a..c30c99f 100644 (file)
@@ -2,6 +2,7 @@ using System;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO;
+using System.Text;
 using System.Threading.Tasks;
 using Microsoft.DotNet.XHarness.Common;
 using Microsoft.DotNet.XHarness.TestRunners.Common;
@@ -15,16 +16,20 @@ public sealed class GeneratedTestRunner : TestRunner
     TestFilter.ISearchClause? _filter;
     Func<TestFilter?, TestSummary> _runTestsCallback;
     HashSet<string> _testExclusionList;
+    private readonly Boolean _writeBase64TestResults;
+
     public GeneratedTestRunner(
         LogWriter logger, 
         Func<TestFilter?, TestSummary> runTestsCallback, 
         string assemblyName,
-        HashSet<string> testExclusionList)
+        HashSet<string> testExclusionList,
+        bool writeBase64TestResults)
         :base(logger)
     {
         _assemblyName = assemblyName;
         _runTestsCallback = runTestsCallback;
         _testExclusionList = testExclusionList;
+        _writeBase64TestResults = writeBase64TestResults;
         ResultsFileName = $"{_assemblyName}.testResults.xml";
     }
 
@@ -53,7 +58,17 @@ public sealed class GeneratedTestRunner : TestRunner
     public override void WriteResultsToFile(TextWriter writer, XmlResultJargon jargon)
     {
         Debug.Assert(jargon == XmlResultJargon.xUnit);
-        writer.WriteLine(LastTestRun.GetTestResultOutput(_assemblyName));
+        string lastTestResults = LastTestRun.GetTestResultOutput(_assemblyName);
+        if (_writeBase64TestResults)
+        {
+            byte[] encodedBytes = Encoding.Unicode.GetBytes(lastTestResults);
+            string base64Results = Convert.ToBase64String(encodedBytes);
+            writer.WriteLine($"STARTRESULTXML {encodedBytes.Length} {base64Results} ENDRESULTXML");
+        }
+        else
+        {
+            writer.WriteLine(lastTestResults);
+        }
     }
 
     public override void SkipTests(IEnumerable<string> tests)
index bf1e624..b1b1f4e 100644 (file)
@@ -36,6 +36,12 @@ public static class RunnerEntryPoint
         bool anyFailedTests = false;
         entryPoint.TestsCompleted += (o, e) => anyFailedTests = e.FailedTests > 0;
         await entryPoint.RunAsync();
+
+        if (OperatingSystem.IsBrowser())
+        {
+            // Browser expects all xharness processes to exit with 0, even in case of failure
+            return 0;
+        }
         return anyFailedTests ? 1 : 0;
     }
 
@@ -65,7 +71,7 @@ public static class RunnerEntryPoint
         protected override bool IsXunit => true;
         protected override TestRunner GetTestRunner(LogWriter logWriter)
         {
-            var runner = new GeneratedTestRunner(logWriter, _runTestsCallback, _assemblyName, _testExclusionList);
+            var runner = new GeneratedTestRunner(logWriter, _runTestsCallback, _assemblyName, _testExclusionList, writeBase64TestResults: true);
             if (_methodNameToRun is not null)
             {
                 runner.SkipMethod(_methodNameToRun, isExcluded: false);
@@ -103,7 +109,7 @@ public static class RunnerEntryPoint
         protected override bool IsXunit => true;
         protected override TestRunner GetTestRunner(LogWriter logWriter)
         {
-            var runner = new GeneratedTestRunner(logWriter, _runTestsCallback, _assemblyName, _testExclusionList);
+            var runner = new GeneratedTestRunner(logWriter, _runTestsCallback, _assemblyName, _testExclusionList, writeBase64TestResults: false);
             if (_methodNameToRun is not null)
             {
                 runner.SkipMethod(_methodNameToRun, isExcluded: false);
@@ -151,7 +157,7 @@ public static class RunnerEntryPoint
         protected override bool IsXunit => true;
         protected override TestRunner GetTestRunner(LogWriter logWriter)
         {
-            var runner = new GeneratedTestRunner(logWriter, _runTestsCallback, _assemblyName, _testExclusionList);
+            var runner = new GeneratedTestRunner(logWriter, _runTestsCallback, _assemblyName, _testExclusionList, writeBase64TestResults: true);
             if (_methodNameToRun is not null)
             {
                 runner.SkipMethod(_methodNameToRun, isExcluded: false);
index a2f23ba..0de2af1 100644 (file)
@@ -70,9 +70,10 @@ public class TestSummary
         foreach (var test in _testResults)
         {
             resultsFile.Append($@"<test name=""{test.Name}"" type=""{test.ContainingTypeName}"" method=""{test.MethodName}"" time=""{test.Duration.TotalSeconds:F6}"" ");
+            string outputElement = !string.IsNullOrWhiteSpace(test.Output) ? $"<output><![CDATA[{test.Output}]]></output>" : string.Empty;
             if (test.Exception is not null)
             {
-                resultsFile.AppendLine($@"result=""Fail""><failure exception-type=""{test.Exception.GetType()}""><message><![CDATA[{test.Exception.Message}]]></message><stack-trace><![CDATA[{test.Exception.StackTrace}]]></stack-trace></failure><output><![CDATA[{test.Output}]]></output></test>");
+                resultsFile.AppendLine($@"result=""Fail""><failure exception-type=""{test.Exception.GetType()}""><message><![CDATA[{test.Exception.Message}]]></message><stack-trace><![CDATA[{test.Exception.StackTrace}]]></stack-trace></failure>{outputElement}</test>");
             }
             else if (test.SkipReason is not null)
             {
@@ -80,7 +81,7 @@ public class TestSummary
             }
             else
             {
-                resultsFile.AppendLine($@" result=""Pass""><output><![CDATA[{test.Output}]]></output></test>");
+                resultsFile.AppendLine($@" result=""Pass"">{outputElement}</test>");
             }
         }
 
index c1363a5..4bf0fbd 100644 (file)
 
   <Target Name="DiscoverMergedTestWrappers">
     <ItemGroup>
-      <_MergedWrapperMarker Include="$(TestBinDir)**\*.MergedTestAssembly" />
+      <!-- Exclude WASM support files. They can interfere with our discovery process and create extra work items that don't work. -->
+      <_MergedWrapperMarker Include="$(TestBinDir)**\*.MergedTestAssembly" Exclude="$(TestBinDir)**\supportFiles\*.MergedTestAssembly" />
     </ItemGroup>
   </Target>
 
       <_MergedWrapperRunScript Include="$([System.IO.Path]::ChangeExtension('%(_MergedWrapperMarker.Identity)', '.$(TestScriptExtension)'))" />
     </ItemGroup>
     <PropertyGroup>
-      <_MergedWrapperDirectory>%(_MergedWrapperRunScript.RootDir)%(Directory)</_MergedWrapperDirectory>
+      <_MergedWrapperDirectory>$([System.IO.Path]::GetDirectoryName('%(_MergedWrapperRunScript.Identity)'))</_MergedWrapperDirectory>
+      <_MergedWrapperParentDirectory>$([System.IO.Path]::GetDirectoryName('$(_MergedWrapperDirectory)'))</_MergedWrapperParentDirectory>
       <_MergedWrapperName>%(_MergedWrapperRunScript.FileName)</_MergedWrapperName>
       <_MergedWrapperRunScriptRelative Condition="'%(_MergedWrapperRunScript.Identity)' != ''">$([System.IO.Path]::GetRelativePath($(TestBinDir), %(_MergedWrapperRunScript.FullPath)))</_MergedWrapperRunScriptRelative>
     </PropertyGroup>
+    <ItemGroup>
+      <_MergedWrapperOutOfProcessTestMarkers Include="$(_MergedWrapperParentDirectory)/**/*.OutOfProcessTest" />
+      <_MergedWrapperOutOfProcessTestFiles
+        Include="%(_MergedWrapperOutOfProcessTestMarkers.RootDir)%(_MergedWrapperOutOfProcessTestMarkers.Directory)/**"
+        Condition="'@(_MergedWrapperOutOfProcessTestMarkers)' != ''" />
+    </ItemGroup>
 
     <ItemGroup>
       <_MergedPayloadGroups Include="$(_MergedWrapperName)" />
-      <_MergedPayloadFiles Include="$(_MergedWrapperDirectory)**" />
+      <_MergedPayloadFiles Include="$(_MergedWrapperDirectory)/**" />
+      <_MergedPayloadFiles Include="@(_MergedWrapperOutOfProcessTestFiles)" />
       <_MergedPayloadFiles Update="@(_MergedPayloadFiles)">
         <!-- Never use [MSBuild]::MakeRelative here! We have some files containing Unicode characters in their %(FullPath) and
              MakeRelative function calls Escape function internally that replaces all the Unicode characters with %<xx>. -->
     <ItemGroup>
       <!-- Remove the managed pdbs from our payloads.
            This is for performance reasons to reduce our helix payload size  -->
-      <ReducedMergedPayloadFilesFinal Include="@(_MergedPayloadFiles)" Condition=" '%(Extension)' != '.pdb' " />
+      <ReducedMergedPayloadFilesFinal Include="@(_MergedPayloadFiles)" Condition=" '%(Extension)' != '.pdb' and '%(Extension)' != '.OutOfProcessTest' " />
     </ItemGroup>
 
     <Copy SourceFiles="@(ReducedMergedPayloadFilesFinal)" DestinationFiles="@(ReducedMergedPayloadFilesFinal->'$(MergedPayloadsRootDirectory)\$(_MergedWrapperName)\%(FileRelativeToPayloadsRootDirectory)')" />
index a11b397..96d65ab 100644 (file)
     <SkipImportILTargets Condition="'$(CLRTestBuildAllTargets)' != '' And '$(CLRTestNeedTarget)' != '$(CLRTestBuildAllTargets)'">true</SkipImportILTargets>
   </PropertyGroup>
 
-  <Target Name="CopyMergedWrapperReferences"
-      Condition="'$(IsMergedTestRunnerAssembly)' == 'true'"
-      AfterTargets="Build"
-      BeforeTargets="CopyNativeProjectBinaries">
-    <ItemGroup>
-      <MergedWrapperReferenceFolders Include="@(ProjectReference->'$([System.IO.Path]::GetFullPath('%(ProjectReference.Identity)/..', '$(OutDir)/..'))/%(ProjectReference.FileName)')" />
-      <!-- For merged project wrappers, include native libraries in all project references -->
-      <MergedWrapperReferenceFiles Include="%(MergedWrapperReferenceFolders.Identity)/*$(LibSuffix)" />
-    </ItemGroup>
-    <Copy SourceFiles="@(MergedWrapperReferenceFiles)"
-        DestinationFiles="@(MergedWrapperReferenceFiles->'$(OutDir)/%(FileName)%(Extension)')"
-        SkipUnchangedFiles="true"
-        />
-  </Target>
-
   <Target Name="CopyNativeProjectBinaries" Condition="'$(_CopyNativeProjectBinaries)' == 'true'">
     <ItemGroup Condition="'$(UseVisualStudioNativeBinariesLayout)' == 'true'">
       <NativeProjectBinaries Include="$(NativeProjectOutputFolder)\*.*" />
 
     <MSBuild Projects="$(MSBuildProjectFile)" Targets="CopyNativeProjectBinaries" Properties="NativeProjectOutputFolder=%(NativeProjectOutputFoldersToCopy.Identity)" Condition="'@(NativeProjectReference)' != ''" />
 
+    <MSBuild Projects="@(ProjectReference)"
+        Targets="CopyAllNativeProjectReferenceBinaries"
+        Condition="'$(IsMergedTestRunnerAssembly)' == 'true'"
+        BuildInParallel="true" />
   </Target>
 
-  <Target Name="CopyAllNativeProjectReferenceBinaries" DependsOnTargets="ResolveCMakeNativeProjectReference;ConsolidateNativeProjectReference" />
+  <Target Name="CopyAllNativeProjectReferenceBinaries"
+          DependsOnTargets="ResolveCMakeNativeProjectReference;ConsolidateNativeProjectReference">
+
+    <ItemGroup Condition="'$(IsMergedTestRunnerAssembly)' == 'true'">
+      <MergedWrapperReferenceFolders Include="@(ProjectReference->'$([System.IO.Path]::GetFullPath('%(ProjectReference.Identity)/..', '$(OutDir)/..'))/%(ProjectReference.FileName)')" />
+      <!-- For merged project wrappers, include native libraries in all project references -->
+      <MergedWrapperReferenceFiles Include="%(MergedWrapperReferenceFolders.Identity)/*$(LibSuffix)" />
+    </ItemGroup>
+    <Copy SourceFiles="@(MergedWrapperReferenceFiles)"
+        DestinationFiles="@(MergedWrapperReferenceFiles->'$(OutDir)/%(FileName)%(Extension)')"
+        SkipUnchangedFiles="true"
+        Condition="'@(MergedWrapperReferenceFiles)' != ''"
+        />
+  </Target>
 
   <!-- Build shell or command scripts whenever we copy native binaries -->
   <Import Project="$(MSBuildThisFileDirectory)Common\CLRTest.Execute.targets" />
     </ItemGroup>
   </Target>
 
-  <Target Name="AfterBuild">
+  <Target Name="GenerateMarkerFiles" BeforeTargets="AssignTargetPaths">
+    <ItemGroup>
+      <Content Include="$(AssemblyName).reflect.xml" Condition="Exists('$(AssemblyName).reflect.xml')" CopyToOutputDirectory="PreserveNewest" />
+      <MarkerFile Include="$(IntermediateOutputPath)\$(MSBuildProjectName).MergedTestAssembly" Condition="'$(IsMergedTestRunnerAssembly)' == 'true'" />
+      <MarkerFile Include="$(IntermediateOutputPath)\$(AssemblyName).NoMonoAot" Condition="'$(MonoAotIncompatible)' == 'true'" />
+      <Content Include="@(MarkerFile)" CopyToOutputDirectory="PreserveNewest" />
+    </ItemGroup>
+
      <Copy SourceFiles="$(AssemblyName).reflect.xml"
            DestinationFolder="$(OutputPath)"
        Condition="Exists('$(AssemblyName).reflect.xml')"/>
 
     <WriteLinesToFile
         Condition="'$(IsMergedTestRunnerAssembly)' == 'true'"
-        File="$(OutputPath)\$(MSBuildProjectName).MergedTestAssembly"
-        Lines="MergedTestAssembly" />
+        File="$(IntermediateOutputPath)\$(MSBuildProjectName).MergedTestAssembly"
+        Lines="MergedTestAssembly"
+        Overwrite="true"
+        WriteOnlyWhenDifferent="true" />
+
 
     <WriteLinesToFile
+        Condition="'$(MonoAotIncompatible)' == 'true'"
+        File="$(IntermediateOutputPath)\$(AssemblyName).NoMonoAot"
+        Lines="NoMonoAot"
+        Overwrite="true"
+        WriteOnlyWhenDifferent="true" />
+  
+    <!-- We don't want the out-of-process test marker file to be included in referencing projects, so we don't include it as content. -->
+    <WriteLinesToFile
         Condition="'$(RequiresProcessIsolation)' == 'true' and '$(BuildAsStandalone)' != 'true'"
         File="$(OutputPath)\$(MSBuildProjectName).OutOfProcessTest"
-        Lines="OutOfProcessTest" />
+        Lines="OutOfProcessTest"
+        Overwrite="true"
+        WriteOnlyWhenDifferent="true" />
   </Target>
 
   <PropertyGroup>
index a4e1b46..d282ce1 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <OutputType>Exe</OutputType>
+    <MonoAotIncompatible>true</MonoAotIncompatible>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="ForeignThreadExceptions.cs" />
index b8914d6..23d37e1 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <MonoAotIncompatible>true</MonoAotIncompatible>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="PInvokeAssemblyMarshallingEnabled/*.cs" />
index abb1fec..c086445 100644 (file)
@@ -2,6 +2,7 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <MonoAotIncompatible>true</MonoAotIncompatible>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="$(InteropCommonDir)CheckGCMode.cs" />
index d7246c3..5a5439c 100644 (file)
@@ -2,6 +2,7 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <MonoAotIncompatible>true</MonoAotIncompatible>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="UnmanagedCallersOnlyTest.cs" />
diff --git a/src/tests/JIT/Directed/callconv/Directory.Build.props b/src/tests/JIT/Directed/callconv/Directory.Build.props
new file mode 100644 (file)
index 0000000..49b99b7
--- /dev/null
@@ -0,0 +1,7 @@
+<Project>
+  <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props, $(MSBuildThisFileDirectory)..))" />
+
+  <PropertyGroup>
+    <MonoAotIncompatible>true</MonoAotIncompatible>
+  </PropertyGroup>
+</Project>
\ No newline at end of file
index c17fe6f..3b412d9 100644 (file)
@@ -1,12 +1,4 @@
 project(object_pin_mirror)
 
-set(CMAKE_SHARED_LIBRARY_PREFIX "")
-
 add_library(mirror SHARED mirror.cpp)
 SET_TARGET_PROPERTIES(mirror PROPERTIES COMPILE_FLAGS "-c") 
-
-# add the install targets (this "installs" the native file on Windows systems)
-install(TARGETS mirror DESTINATION bin)
-
-# This "installs" the native file on System V systems
-set_target_properties(mirror PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/mirror)
index 7616aef..48b0bfa 100644 (file)
@@ -1,12 +1,4 @@
 project(PInvokeExampleNative)
 
-set(CMAKE_SHARED_LIBRARY_PREFIX "")
-
 add_library(PInvokeExampleNative SHARED pinvokeexamplenative.cpp)
 SET_TARGET_PROPERTIES(PInvokeExampleNative PROPERTIES COMPILE_FLAGS "-c")
-
-# add the install targets (this "installs" the native file on Windows systems)
-install(TARGETS PInvokeExampleNative DESTINATION bin)
-
-# This "installs" the native file on System V systems
-set_target_properties(PInvokeExampleNative PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/PInvokeExampleNative)
index 2e1ffa2..e1a746d 100644 (file)
@@ -2,6 +2,7 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <MonoAotIncompatible>true</MonoAotIncompatible>
   </PropertyGroup>
   <PropertyGroup>
     <DebugType>Embedded</DebugType>
index 6dbbc64..8564360 100644 (file)
@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk.IL">
   <PropertyGroup>
-    <OutputType>Exe</OutputType>
+    <MonoAotIncompatible>true</MonoAotIncompatible>
   </PropertyGroup>
   <PropertyGroup>
     <DebugType>PdbOnly</DebugType>
index 68ec24f..672ad9b 100644 (file)
@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk.IL">
   <PropertyGroup>
-    <OutputType>Exe</OutputType>
+    <MonoAotIncompatible>true</MonoAotIncompatible>
   </PropertyGroup>
   <PropertyGroup>
     <DebugType>Full</DebugType>
index b0ef594..85b1aa3 100644 (file)
@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk.IL">
   <PropertyGroup>
-    <OutputType>Exe</OutputType>
+    <MonoAotIncompatible>true</MonoAotIncompatible>
   </PropertyGroup>
   <PropertyGroup>
     <DebugType>PdbOnly</DebugType>
index 7903275..fe39c53 100644 (file)
@@ -3,6 +3,7 @@
     <OutputType>Library</OutputType>
     <CLRTestKind>BuildOnly</CLRTestKind>
     <GenerateRunScript>false</GenerateRunScript>
+    <MonoAotIncompatible>true</MonoAotIncompatible>
   </PropertyGroup>
   <PropertyGroup>
     <DebugType>Full</DebugType>
index 6ed3b60..b36677f 100644 (file)
@@ -1,12 +1,4 @@
 project(jitstructtests)
 
-set(CMAKE_SHARED_LIBRARY_PREFIX "")
-
 set(SOURCES structinregs.cpp structinregs.def)
 add_library(jitstructtests_lib SHARED ${SOURCES})
-
-# add the install targets (this "installs" the native file on Windows systems)
-install(TARGETS jitstructtests_lib DESTINATION bin)
-
-# This "installs" the native file on System V systems
-set_target_properties(jitstructtests_lib PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/structinregs)
index f9c3ccf..33d8c00 100644 (file)
@@ -3,6 +3,7 @@
     <OutputType>Exe</OutputType>
     <GCStressIncompatible>true</GCStressIncompatible>
     <NoWarn>$(NoWarn);xUnit1013</NoWarn>
+    <MonoAotIncompatible>true</MonoAotIncompatible>
   </PropertyGroup>
   <PropertyGroup>
     <DebugType>pdbonly</DebugType>
index 656e0b0..9226518 100644 (file)
@@ -1,12 +1,5 @@
 project(b108129_test2)
 include_directories(${INC_PLATFORM_DIR})
-set(CMAKE_SHARED_LIBRARY_PREFIX "")
 
 add_library(test2 SHARED test2.cpp)
 SET_TARGET_PROPERTIES(test2 PROPERTIES COMPILE_FLAGS "-c") 
-
-# add the install targets (this "installs" the native file on Windows systems)
-install(TARGETS test2 DESTINATION bin)
-
-# This "installs" the native file on System V systems
-set_target_properties(test2 PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/test2)
index 2751523..57dda09 100644 (file)
@@ -1,7 +1,5 @@
 project(hfa_interop)
 
-set(CMAKE_SHARED_LIBRARY_PREFIX "")
-
 
 add_library(hfa_simple_f32_native_cpp SHARED hfa_native.cpp)
 SET_TARGET_PROPERTIES(hfa_simple_f32_native_cpp PROPERTIES COMPILE_FLAGS "-c -DSIMPLE_HFA -DFLOAT32") 
@@ -14,16 +12,3 @@ SET_TARGET_PROPERTIES(hfa_nested_f32_native_cpp PROPERTIES COMPILE_FLAGS "-c -DN
 
 add_library(hfa_nested_f64_native_cpp SHARED hfa_native.cpp)
 SET_TARGET_PROPERTIES(hfa_nested_f64_native_cpp PROPERTIES COMPILE_FLAGS "-c -DNESTED_HFA -DFLOAT64") 
-
-
-# add the install targets (this "installs" the native file on Windows systems)
-install(TARGETS hfa_simple_f32_native_cpp DESTINATION bin)
-install(TARGETS hfa_simple_f64_native_cpp DESTINATION bin)
-install(TARGETS hfa_nested_f32_native_cpp DESTINATION bin)
-install(TARGETS hfa_nested_f64_native_cpp DESTINATION bin)
-
-# This "installs" the native file on System V systems
-set_target_properties(hfa_simple_f32_native_cpp PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/hfa_simple_f32_native_cpp)
-set_target_properties(hfa_simple_f64_native_cpp PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/hfa_simple_f64_native_cpp)
-set_target_properties(hfa_nested_f32_native_cpp PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/hfa_nested_f32_native_cpp)
-set_target_properties(hfa_nested_f64_native_cpp PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/hfa_nested_f64_native_cpp)
index 3339b7c..d8e88df 100644 (file)
@@ -2,6 +2,7 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <RestorePackages>true</RestorePackages>
+    <MonoAotIncompatible>true</MonoAotIncompatible>
   </PropertyGroup>
   <PropertyGroup>
     <DebugType>PdbOnly</DebugType>
index f8abfa2..ca6502d 100644 (file)
@@ -1,7 +1,5 @@
 project(mcc_native)
 
-set(CMAKE_SHARED_LIBRARY_PREFIX "")
-
 add_library(native_i0c SHARED native_i0c.cpp)
 add_library(native_i1c SHARED native_i1c.cpp)
 add_library(native_i3c SHARED native_i3c.cpp)
@@ -17,39 +15,3 @@ add_library(native_i5s SHARED native_i5s.cpp)
 add_library(native_i6s SHARED native_i6s.cpp)
 add_library(native_i7s SHARED native_i7s.cpp)
 add_library(native_i8s SHARED native_i8s.cpp)
-
-
-
-# add the install targets (this "installs" the native file on Windows systems)
-install(TARGETS native_i0c DESTINATION bin)
-install(TARGETS native_i1c DESTINATION bin)
-install(TARGETS native_i3c DESTINATION bin)
-install(TARGETS native_i5c DESTINATION bin)
-install(TARGETS native_i6c DESTINATION bin)
-install(TARGETS native_i7c DESTINATION bin)
-install(TARGETS native_i8c DESTINATION bin)
-
-install(TARGETS native_i0s DESTINATION bin)
-install(TARGETS native_i1s DESTINATION bin)
-install(TARGETS native_i3s DESTINATION bin)
-install(TARGETS native_i5s DESTINATION bin)
-install(TARGETS native_i6s DESTINATION bin)
-install(TARGETS native_i7s DESTINATION bin)
-install(TARGETS native_i8s DESTINATION bin)
-
-# This "installs" the native file on System V systems
-set_target_properties(native_i0c PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/native_i0c)
-set_target_properties(native_i1c PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/native_i1c)
-set_target_properties(native_i3c PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/native_i3c)
-set_target_properties(native_i5c PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/native_i5c)
-set_target_properties(native_i6c PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/native_i6c)
-set_target_properties(native_i7c PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/native_i7c)
-set_target_properties(native_i8c PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/native_i8c)
-
-set_target_properties(native_i0s PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/native_i0s)
-set_target_properties(native_i1s PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/native_i1s)
-set_target_properties(native_i3s PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/native_i3s)
-set_target_properties(native_i5s PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/native_i5s)
-set_target_properties(native_i6s PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/native_i6s)
-set_target_properties(native_i7s PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/native_i7s)
-set_target_properties(native_i8s PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/native_i8s)
\ No newline at end of file
diff --git a/src/tests/JIT/opt/virtualstubdispatch/bigvtbl/Directory.Build.props b/src/tests/JIT/opt/virtualstubdispatch/bigvtbl/Directory.Build.props
new file mode 100644 (file)
index 0000000..fb357e9
--- /dev/null
@@ -0,0 +1,7 @@
+<Project>
+    <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props, $(MSBuildThisFileDirectory)..))" />
+
+    <PropertyGroup>
+        <MonoAotIncompatible>true</MonoAotIncompatible>
+    </PropertyGroup>
+</Project>
\ No newline at end of file
index 9938c41..124ec1c 100644 (file)
@@ -4,6 +4,7 @@
     <!-- The test cannot be run twice in the same process since it moves a native dll that it uses for pinvoke later -->
     <UnloadabilityIncompatible>true</UnloadabilityIncompatible>
     <CLRTestPriority>1</CLRTestPriority>
+    <RequiresProcessIsolation>true</RequiresProcessIsolation>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="FromNativePaths.cs" />
index 89e9243..d25be95 100644 (file)
@@ -2,6 +2,7 @@
   <PropertyGroup>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <OutputType>Exe</OutputType>
+    <MonoAotIncompatible>true</MonoAotIncompatible>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="Validate.cs" />
index 7308df2..09a937d 100644 (file)
@@ -2,6 +2,7 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <Nullable>enable</Nullable>
+    <MonoAotIncompatible>true</MonoAotIncompatible>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="case03.cs" />
index 6b6ec60..f904899 100644 (file)
@@ -2,6 +2,7 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <Nullable>enable</Nullable>
+    <MonoAotIncompatible>true</MonoAotIncompatible>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="case04.cs" />
index e843149..1540275 100644 (file)
@@ -2,6 +2,7 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <Nullable>enable</Nullable>
+    <MonoAotIncompatible>true</MonoAotIncompatible>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="case05.cs" />
diff --git a/src/tests/Loader/classloader/explicitlayout/objrefandnonobjrefoverlap/Directory.Build.props b/src/tests/Loader/classloader/explicitlayout/objrefandnonobjrefoverlap/Directory.Build.props
new file mode 100644 (file)
index 0000000..fb357e9
--- /dev/null
@@ -0,0 +1,7 @@
+<Project>
+    <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props, $(MSBuildThisFileDirectory)..))" />
+
+    <PropertyGroup>
+        <MonoAotIncompatible>true</MonoAotIncompatible>
+    </PropertyGroup>
+</Project>
\ No newline at end of file
index e8bb27e..37e5739 100644 (file)
@@ -2,6 +2,7 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <MonoAotIncompatible>true</MonoAotIncompatible>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="Simple.cs" />
index 96682b6..c292d42 100644 (file)
 
   <Target Name="MonoAotCompileTests" DependsOnTargets="GetListOfTestCmds;FindCmdDirectories">
     <ItemGroup>
-      <AllTestScripts Include="%(TestDirectories.Identity)\**\*.sh" />
+      <AllTestScripts Condition="'@(TestDirectories)' != ''" Include="%(TestDirectories.Identity)\**\*.sh" />
+      <AllTestScripts Condition="'@(MergedRunnableTestPaths)' != ''" Include="%(MergedRunnableTestPaths.RootDir)%(MergedRunnableTestPaths.Directory)*.dll" />
+      <AllTestScripts Condition="'@(OutOfProcessTestPaths)' != ''" Include="%(OutOfProcessTestPaths.RootDir)%(OutOfProcessTestPaths.Directory)*.sh" />
       <TestExclusions Include="@(ExcludeList->Metadata('FullPath'))" Condition="$(HaveExcludes)" />
       <TestScripts Include="@(AllTestScripts)" Exclude="@(TestExclusions)" />
 
       <Output TaskParameter="Filtered" ItemName="TestDirs" />
     </RemoveDuplicates>
     <ItemGroup>
-      <TestsAndAssociatedAssemblies Include="%(TestDirs.Identity)/*.dll" />
+      <TestsAndAssociatedAssemblies Include="%(TestDirs.Identity)/*.dll" Exclude="@(NoMonoAotAssemblyPaths)" />
       <CoreRootDlls Include="$(CORE_ROOT)/*.dll" Exclude="$(CORE_ROOT)/xunit.performance.api.dll" />
       <AllDlls Condition="'$(MonoFullAot)' == 'true'" Include="@(TestsAndAssociatedAssemblies);@(CoreRootDlls)" />
       <AllDlls Condition="'$(MonoFullAot)' != 'true'" Include="@(TestsAndAssociatedAssemblies)" />
       <MergedRunnableTestPaths Include="$([System.IO.Path]::ChangeExtension('%(MergedAssemblyMarkerPaths.Identity)', '.$(TestScriptExtension)'))" />
       <OutOfProcessTestMarkerPaths Include="$(XunitTestBinBase)\**\*.OutOfProcessTest"/>
       <OutOfProcessTestPaths Include="$([System.IO.Path]::ChangeExtension('%(OutOfProcessTestMarkerPaths.Identity)', '.$(TestScriptExtension)'))" />
+      <NoMonoAotMarkerPaths Include="$(XunitTestBinBase)\**\*.NoMonoAot" />
+      <NoMonoAotAssemblyPaths Include="$([System.IO.Path]::ChangeExtension('%(NoMonoAotMarkerPaths.Identity)', '.dll'))" />
     </ItemGroup>
     <!-- Remove the cmd/sh scripts for merged test runner app bundles from our list. -->
     <PropertyGroup Condition="'$(TargetsMobile)' == 'true'">