Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix execution of ilverify tests in outerloop runs #73132

Merged
merged 3 commits into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/tests/Common/CLRTest.CrossGen.targets
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ if [ ! -z ${RunCrossGen2+x} ]%3B then
else
cp *.dll IL-CG2/
rm IL-CG2/composite-r2r.dll 2>/dev/null
rm IL-CG2/Coreclr.TestWrapper.dll 2>/dev/null
rm IL-CG2/*.XUnitWrapper.dll 2>/dev/null
fi

ExtraCrossGen2Args+=" $(CrossGen2TestExtraArguments)"
Expand Down Expand Up @@ -186,6 +188,8 @@ if defined RunCrossGen2 (
mkdir IL-CG2
copy *.dll IL-CG2\
del IL-CG2\composite-r2r.dll 2>nul
del IL-CG2\Coreclr.TestWrapper.dll 2>nul
del IL-CG2\*.XUnitWrapper.dll 2>nul

if defined CompositeBuildMode (
set ExtraCrossGen2Args=!ExtraCrossGen2Args! --composite
Expand All @@ -196,9 +200,9 @@ if defined RunCrossGen2 (
IF NOT !CrossGen2Status!==0 goto :DoneCrossgen2Operations
) else (
set ExtraCrossGen2Args=!ExtraCrossGen2Args! -r:!scriptPath!IL-CG2\*.dll
for %%I in (!scriptPath!\*.dll) do (
set __OutputFile=!scriptPath!\%%~nI.dll
set __InputFile=!scriptPath!IL-CG2\%%~nI.dll
for %%I in (!scriptPath!IL-CG2\*.dll) do (
set __OutputFile=!scriptPath!%%~nI.dll
set __InputFile=%%I
call :CompileOneFileCrossgen2
IF NOT !CrossGen2Status!==0 (
IF NOT !CrossGen2Status!==2 goto :DoneCrossgen2Operations
Expand Down
23 changes: 6 additions & 17 deletions src/tests/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<DisabledTestDir Include="Common" />
<DisabledTestDir Include="Tests" />
<DisabledTestDir Include="TestWrappers" />
<_SkipTestDir Include="@(DisabledTestDir)" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -49,23 +48,11 @@
<Error Condition="!Exists('$(XunitTestBinBase)')"
Text="$(XunitTestBinBase) does not exist. Please run src\tests\build / src/tests/build.sh from the repo root at least once to get the tests built." />

<ItemGroup>
<AllTestDirsNonCanonicalPaths Include="$([System.IO.Directory]::GetDirectories(`$(XunitTestBinBase)`))" />
<AllTestDirsPaths Include="@(AllTestDirsNonCanonicalPaths)" />
<AllTestDirsPaths Include="@(AllTestDirsNonCanonicalPaths)" >
<Path>$([System.IO.Path]::GetFullPath(%(Identity)))</Path>
</AllTestDirsPaths>
<SkipTestDirsPaths Include="$([System.IO.Path]::GetFullPath('$(XunitTestBinBase)%(_SkipTestDir.Identity)'))" />
<NonExcludedTestDirectories Include="@(AllTestDirsPaths -> '%(Path)')" Exclude="@(SkipTestDirsPaths)" />
</ItemGroup>

<ItemGroup Condition="'@(LegacyRunnableTestPaths)' != ''">
<TopLevelDirectories Include="@(NonExcludedTestDirectories)" />
<SecondLevel Include="$([System.IO.Directory]::GetDirectories(%(TopLevelDirectories.Identity)))" />
<SecondLevelDirectories Include="@(SecondLevel)">
<Path>$([System.IO.Path]::GetFullPath(%(LegacyRunnableTestPaths.Identity)))</Path>
</SecondLevelDirectories>
<TestDirectoriesWithDup Include="@(SecondLevelDirectories -> '%(Identity)')" Condition="$([System.String]::new('%(Path)').StartsWith('%(Identity)'))" />
<LegacyRunnableTestPaths Separator="$([System.String]::Copy('%(LegacyRunnableTestPaths.Identity)').IndexOfAny('\\/', $(XunitTestBinBase.Length)))" />
<LegacyRunnableTestPaths SecondSeparator="$([System.String]::Copy('%(LegacyRunnableTestPaths.Identity)').IndexOfAny('\\/', $([MSBuild]::Add(%(LegacyRunnableTestPaths.Separator), 1))))" />
<LegacyRunnableTestPaths Separator="%(LegacyRunnableTestPaths.SecondSeparator)" Condition="'%(LegacyRunnableTestPaths.SecondSeparator)' != '-1'" />
<TestDirectoriesWithDup Include="$([System.String]::Copy('%(LegacyRunnableTestPaths.Identity)').Substring(0, %(LegacyRunnableTestPaths.Separator)))" />
</ItemGroup>

<RemoveDuplicates Inputs="@(TestDirectoriesWithDup)">
Expand Down Expand Up @@ -390,8 +377,10 @@

<Target Name="GetListOfTestCmds">
<ItemGroup>
<SkipTestDirsPaths Include="$([System.IO.Path]::GetFullPath('$(XunitTestBinBase)%(DisabledTestDir.Identity)'))" />
<AllRunnableTestPaths Include="$(XunitTestBinBase)\**\*.$(TestScriptExtension)"/>
<AllRunnableTestPaths Remove="$(XunitTestBinBase)\**\run-v8.sh" Condition="'$(TargetArchitecture)' == 'wasm'" />
<AllRunnableTestPaths Remove="%(SkipTestDirsPaths.Identity)\**\*.$(TestScriptExtension)" />
<MergedAssemblyMarkerPaths Include="$(XunitTestBinBase)\**\*.MergedTestAssembly"/>
<MergedAssemblyFolders Include="$([System.IO.Path]::GetDirectoryName('%(MergedAssemblyMarkerPaths.Identity)'))" />
<MergedAssemblyParentFolders Include="$([System.IO.Path]::GetDirectoryName('%(MergedAssemblyFolders.Identity)'))" />
Expand Down
5 changes: 1 addition & 4 deletions src/tests/xunit-wrappers.targets
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,7 @@ $(_XunitEpilog)
<!-- NOTE! semicolons must be escaped with %3B boooo -->

<PropertyGroup>
<_CMDDIR_Parent>$([System.IO.Path]::GetDirectoryName($(_CMDDIR)))</_CMDDIR_Parent>
<_CMDDIR_Grandparent>$([System.IO.Path]::GetDirectoryName($(_CMDDIR_Parent)))</_CMDDIR_Grandparent>
<CategoryWithSlash Condition="'$(RunningOnUnix)' != 'true'" >$([System.String]::Copy('$(_CMDDIR)').Replace("$(_CMDDIR_Grandparent)\",""))</CategoryWithSlash>
<CategoryWithSlash Condition="'$(RunningOnUnix)' == 'true'" >$([System.String]::Copy('$(_CMDDIR)').Replace("$(_CMDDIR_Grandparent)/",""))</CategoryWithSlash>
<CategoryWithSlash>$([System.IO.Path]::GetRelativePath('$(XunitTestBinBase)', '$(_CMDDIR)'))</CategoryWithSlash>
<Category Condition="'$(RunningOnUnix)' != 'true'" >$([System.String]::Copy('$(CategoryWithSlash)').Replace('\','.'))</Category>
<Category Condition="'$(RunningOnUnix)' == 'true'" >$([System.String]::Copy('$(CategoryWithSlash)').Replace('/','.'))</Category>
<XunitWrapper>$(Category).XUnitWrapper</XunitWrapper>
Expand Down