Tests: forward the command line to gtest so --gtest_filter works - #245
Open
matthargett wants to merge 1 commit into
Open
matthargett wants to merge 1 commit into
matthargett wants to merge 1 commit into
Conversation
RunTests() called InitGoogleTest() without argv, so --gtest_filter, --gtest_repeat and the other gtest flags were silently ignored on every host; the Win32 host had its own copy of the two calls. The desktop hosts now pass argc/argv through RunTests(int, char**); iOS and the Android JNI keep the argument-less form.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved issues were identified.
Pull request overview
Forwards command-line arguments to GoogleTest so flags like --gtest_filter work across desktop test runners.
Changes:
- Adds an argument-aware
RunTestsoverload. - Updates macOS, Linux, and Win32 hosts to forward
argc/argv. - Preserves synthetic arguments for iOS and Android.
File summaries
| File | Description |
|---|---|
Tests/UnitTests/Win32/App.cpp |
Uses the shared argument-aware test runner. |
Tests/UnitTests/Shared/Shared.h |
Declares both runner overloads. |
Tests/UnitTests/Shared/Shared.cpp |
Forwards arguments to GoogleTest. |
Tests/UnitTests/macOS/App.mm |
Forwards macOS process arguments. |
Tests/UnitTests/Linux/App.cpp |
Forwards Linux process arguments. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RunTests()calledtesting::InitGoogleTest()without the command line, so--gtest_filter,--gtest_repeat,--gtest_break_on_failureand the rest were silently ignored on every host — running./UnitTests --gtest_filter=Console.*still ran the whole suite. The Win32 host had its own copy of the two gtest calls.RunTests(int argc, char** argv)forwards the command line; the macOS, Linux and Win32 hosts pass theirs through.RunTests()stays for the iOS app and the Android JNI (a syntheticargv[0]).Verified on macOS: full suite unchanged (23/23),
--gtest_filter='Console.*'now runs 2 tests. Fork twin: rebeckerspecialties#29.