[RN] Run ReactCommon C++ unit tests on GitHub CI - #57782
Draft
mattcarrollcode wants to merge 1 commit into
Draft
Conversation
mattcarrollcode
force-pushed
the
rn-cxx-unit-tests
branch
23 times, most recently
from
August 6, 2026 17:58
dd9170e to
7e11d2e
Compare
ReactCommon's C++ unit tests (`<subsystem>/tests/*.cpp`) ship with the repository but were not built or run by CI, so the renderer, layout, and runtime C++ core was only exercised indirectly (integration tests and platform builds). This adds a CMake harness under `private/react-native-tests` that compiles a representative subset of those gtest suites on Linux and runs them with CTest, reusing the desktop C++ toolchain and Gradle-staged third-party dependencies already used by the Fantom tester. A new `test_cxx` GitHub Actions job builds and runs the harness on a standard Linux runner. It currently covers 31 gtest suites (~900 cases) spanning the Fabric renderer, layout, CSS, cxxreact bridge, and bridgeless runtime core; more can be added incrementally (see `private/react-native-tests/README.md`). Compilation is routed through ccache (installed by the action, enabled via `CMAKE_CXX_COMPILER_LAUNCHER`) and the job asserts a nonzero cacheable-call count. The CI job is advisory (`continue-on-error`, bounded by `timeout-minutes`) so a harness issue cannot block merges, and should be promoted to a required check once consistently green. Changelog: [Internal] Test Plan: Runs in the new advisory `test_cxx` CI job on this PR (Linux): builds the CMake harness, runs the 31 gtest suites via CTest, and asserts ccache intercepted compiles. Not built internally per react-native-github build rules (internal builds use Buck, not Gradle).
mattcarrollcode
force-pushed
the
rn-cxx-unit-tests
branch
from
August 6, 2026 18:02
7e11d2e to
7f27960
Compare
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.
Summary
ReactCommon's C++ unit tests (
<subsystem>/tests/*.cpp) ship with the repositorybut were not built or run by CI, so the renderer, layout, and runtime C++ core
was only exercised indirectly (integration tests and platform builds).
This adds a small CMake harness under
private/react-native-teststhat compilesa representative subset of those gtest suites on Linux and runs them with CTest,
reusing the desktop C++ toolchain and Gradle-staged third-party dependencies
already used by the Fantom tester. A new
test_cxxGitHub Actions job builds andruns the harness on a standard Linux runner.
Suites covered initially:
react/renderer/graphics,react/utils,react/renderer/css; more can be added incrementally (seeprivate/react-native-tests/README.md). The CI job is advisory(
continue-on-error) so a harness issue cannot block merges, and should bepromoted to a required check once consistently green.
Test Plan
Runs in the new advisory
test_cxxCI job on this PR (Linux): builds the CMakeharness and runs the gtest suites via CTest.
Changelog: [Internal]