-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[test] refactor common test target settings #27013
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
Conversation
There was a problem hiding this 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 refactors duplicated test target settings in the CMake build configuration by extracting common compile and link settings into reusable helper functions. The refactoring addresses code duplication between onnxruntime_test_all and onnxruntime_provider_test targets that occurred when the test suite was split.
Changes:
- Introduced two helper functions:
onnxruntime_apply_common_test_target_settingsfor compile flags andonnxruntime_apply_emscripten_test_link_settingsfor Emscripten link settings - Applied these functions to both
onnxruntime_test_allandonnxruntime_provider_testtargets - Removed duplicated configuration blocks that were previously copy-pasted between targets
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
edgchen1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for cleaning it up!
### Description - factor duplicated test target settings into helper functions - reuse helpers for onnxruntime_test_all and onnxruntime_provider_test - keep target-specific settings intact ### Motivation and Context There are some duplicated codes in the onnxruntime_unittests. Originally there is only one unit test `onnxruntime_test_all` and later it is split into two: `onnxruntime_test_all` and `onnxruntime_provider_test`. Some lines for setting up build flags are simply copied. This causes potential risk for inconsistency in future. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Description
Motivation and Context
There are some duplicated codes in the onnxruntime_unittests. Originally there is only one unit test
onnxruntime_test_alland later it is split into two:onnxruntime_test_allandonnxruntime_provider_test. Some lines for setting up build flags are simply copied. This causes potential risk for inconsistency in future.