Skip to content

[tests][exceptions] Abbreviate long native test path #116841

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

Merged
merged 2 commits into from
Jun 20, 2025

Conversation

mdh1418
Copy link
Member

@mdh1418 mdh1418 commented Jun 19, 2025

Should partially mitigate #110407

UnhandledExceptionHandler/ForeignThreadRevPInvokeUnhandled/ForeignThreadRevPInvokeUnhandled.*
to
UnhandledExceptionHandler/Foreign/ForeignUnhandled.*

UnhandledExceptionHandler/PInvokeRevPInvokeUnhandled/PInvokeRevPInvokeUnhandled.*
to
UnhandledExceptionHandler/PInvoke/PInvokeUnhandled.*

Testing

PS C:\Users\mihw\source\repos\mdh1418\runtime\latest> .\artifacts\tests\coreclr\windows.x64.Debug\baseservices\exceptions\UnhandledExceptionHandler\PInvoke\PInvokeUnhandled\PInvokeUnhandled.cmd
BEGIN EXECUTION
 "C:\Users\mihw\source\repos\mdh1418\runtime\latest\artifacts\tests\coreclr\windows.x64.Debug\Tests\Core_Root\\corerun.exe" -p "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true"  PInvokeUnhandled.dll 
Expected: 100
Actual: 100
END EXECUTION - PASSED
PASSED
PS C:\Users\mihw\source\repos\mdh1418\runtime\latest> .\artifacts\tests\coreclr\windows.x64.Debug\baseservices\exceptions\UnhandledExceptionHandler\Foreign\ForeignUnhandled\ForeignUnhandled.cmd
BEGIN EXECUTION
 "C:\Users\mihw\source\repos\mdh1418\runtime\latest\artifacts\tests\coreclr\windows.x64.Debug\Tests\Core_Root\\corerun.exe" -p "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true"  ForeignUnhandled.dll 
Expected: 100
Actual: 100
END EXECUTION - PASSED
PASSED

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR shortens native test paths by renaming CMake projects, native libraries, DllImport references, and corresponding C# classes to more concise names under the UnhandledExceptionHandler tests.

  • Rename foreignunhandledunhandlednative for the generic unhandled test
  • Remove old PInvokeRevPInvokeUnhandled and ForeignThreadRevPInvokeUnhandled tests, replacing them with PInvokeUnhandled and ForeignUnhandled variants
  • Update CMakeLists, .csproj, and C# sources to reflect the new native library and class names

Reviewed Changes

Copilot reviewed 10 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/tests/baseservices/exceptions/unhandled/unhandled.cs DllImport and native library name updated
src/tests/baseservices/exceptions/unhandled/CMakeLists.txt CMake project and target renamed
src/tests/baseservices/exceptions/UnhandledExceptionHandler/PInvokeRevPInvokeUnhandled Removed obsolete CMakeLists
src/tests/baseservices/exceptions/UnhandledExceptionHandler/PInvoke/PInvokeUnhandled.csproj Update source file reference in project
src/tests/baseservices/exceptions/UnhandledExceptionHandler/PInvoke/PInvokeUnhandled.cs Rename class, DllImport, and static constructor
src/tests/baseservices/exceptions/UnhandledExceptionHandler/PInvoke/CMakeLists.txt New CMakeLists for PInvokeUnhandledNative
src/tests/baseservices/exceptions/UnhandledExceptionHandler/ForeignThreadRevPInvokeUnhandled Removed obsolete CMakeLists
src/tests/baseservices/exceptions/UnhandledExceptionHandler/Foreign/ForeignUnhandled.csproj Update source file reference in project
src/tests/baseservices/exceptions/UnhandledExceptionHandler/Foreign/ForeignUnhandled.cs Rename class, DllImport, and static constructor
src/tests/baseservices/exceptions/UnhandledExceptionHandler/Foreign/CMakeLists.txt New CMakeLists for ForeignUnhandledNative

{
[DllImport("ForeignThreadRevPInvokeUnhandled")]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how this dllimport resolved before when the file and cmake used ForeignThreadRevPInvokeUnhandledNative

@mdh1418
Copy link
Member Author

mdh1418 commented Jun 19, 2025

I've also explored putting the two projects directly under UnhandledExceptionHandler, but I'm not familiar enough with the build/CMake to avoid having each other's native files in the test artifacts directories.

@mdh1418 mdh1418 merged commit 7dda487 into dotnet:main Jun 20, 2025
72 of 74 checks passed
@mdh1418 mdh1418 deleted the abbreviate_long_native_test_path branch June 20, 2025 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants