Add error check for skipped tests in merged groups (#84284)
authorMark Plesko <markples@microsoft.com>
Tue, 4 Apr 2023 18:32:55 +0000 (11:32 -0700)
committerGitHub <noreply@github.com>
Tue, 4 Apr 2023 18:32:55 +0000 (11:32 -0700)
commit735ddeaf8cbc2a2be89ba292bd405bcce615ee60
treeb351f51f7ae03471cf806d65978b9ec26cc52213
parent00f921d4f2ff2b99209a5be85a19f86428e4b7c3
Add error check for skipped tests in merged groups (#84284)

If I test is written in the old style (with a Main and OutputType==Exe without an attribute such as RequiresProcessIsolation) in a merged test group directory, it will be skipped. This change adds a check to detect those cases.

I have struggled with ways to automatically set OutputType. Directory.Build.props is too early (the test project file will override it). Directory.Build.targets is too late as the C# targets files will already have been processed and set other variables based on the value of OutputType. This Target doesn't execute until later, but since it is an error it doesn't matter how those additional properties were set.

Since this adds more boilerplate to each merged test directory, I created a src/tests/Directory.Merged.props to share all of that.

This catches 3 tests that aren't currently executing.

Unrelated:

- Use GetPathOfFileAbove in nearby locations for Directory.Build.props chaining rather than specific paths
- Fix two easy IL warnings that appeared in my local build of all tests

Resolves https://github.com/dotnet/runtime/issues/84182
15 files changed:
src/tests/Directory.Build.targets
src/tests/Directory.Merged.props [new file with mode: 0644]
src/tests/JIT/Directed/Directory.Build.props
src/tests/JIT/HardwareIntrinsics/Directory.Build.props
src/tests/JIT/HardwareIntrinsics/General/ConstantFolding/StaticReadonlySimd.cs
src/tests/JIT/HardwareIntrinsics/General/ConstantFolding/StaticReadonlySimd.csproj
src/tests/JIT/HardwareIntrinsics/X86/X86Serialize_X64/Serialize.X64.cs
src/tests/JIT/HardwareIntrinsics/X86/X86Serialize_X64/Serialize.X64_r.csproj
src/tests/JIT/HardwareIntrinsics/X86/X86Serialize_X64/Serialize.X64_ro.csproj
src/tests/JIT/IL_Conformance/Directory.Build.props
src/tests/JIT/Methodical/Directory.Build.props
src/tests/JIT/Regression/Directory.Build.props
src/tests/Loader/classloader/TypeGeneratorTests/Directory.Build.props
src/tests/baseservices/threading/Directory.Build.props
src/tests/reflection/ldtoken/byrefs.il