Skip to content

Add thunder_test_support static library for plugin integration testing#2099

Closed
smanes0213 wants to merge 27 commits into
R5_3from
development/test-support
Closed

Add thunder_test_support static library for plugin integration testing#2099
smanes0213 wants to merge 27 commits into
R5_3from
development/test-support

Conversation

@smanes0213
Copy link
Copy Markdown
Contributor

Adds a static library (libthunder_test_support.a) that embeds the Thunder PluginHost::Server into a linkable archive. Test binaries link against this library to boot a real Thunder runtime without launching the standalone daemon, enabling integration testing of Thunder plugins using GTest/GMock.

  calls _Exit() after RUN_ALL_TESTS() to avoid static destruction
  order crashes when external plugin .so files are loaded.
… Server::Close()

Thunder's Server::Close() can crash when unloading plugin .so files due to
C++ static destruction order issues between plugin statics (proxy stubs,
JSON-RPC registrations) and Thunder singletons. The real daemon avoids this
by calling exit(0) instead of returning from main().
Copy link
Copy Markdown
Contributor

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 introduces a new thunder_test_support static library intended to let GTest/GMock binaries boot an in-process Thunder PluginHost::Server (without running the standalone daemon) for plugin integration testing.

Changes:

  • Adds ThunderTestRuntime (C++ wrapper) to create temp runtime state, generate a minimal config, start/stop an embedded PluginHost::Server, and provide JSON-RPC/COM-RPC helpers.
  • Adds CMake packaging/install support for the static library (including whole-archive linking) and a smoke test target.
  • Adds a GitHub Actions workflow to build and run the smoke test and an external plugin integration test.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
Tests/test_support/ThunderTestRuntime.h Declares the public test runtime API (ThunderTestRuntime, JSONRPCLink).
Tests/test_support/ThunderTestRuntime.cpp Implements runtime boot/shutdown, temp dir handling, JSON-RPC invoke and event plumbing.
Tests/test_support/thunder_test_supportConfig.cmake.in Package config template with dependency finding + whole-archive link options.
Tests/test_support/tests/SmokeTest.cpp Basic runtime smoke tests (Controller JSON-RPC + shell availability).
Tests/test_support/tests/Module.h Test module header defining module name/export behavior.
Tests/test_support/tests/Module.cpp Module build reference declaration for the smoke test binary.
Tests/test_support/tests/CMakeLists.txt Builds and registers the smoke test executable.
Tests/test_support/Module.h Library module header defining module name/export behavior.
Tests/test_support/Module.cpp Archive module declaration for the static library.
Tests/test_support/CMakeLists.txt Builds/installs thunder_test_support and wires whole-archive behavior + optional feature linkage.
Tests/CMakeLists.txt Adds ENABLE_TEST_RUNTIME option and conditional subdirectory inclusion.
.github/workflows/Test_Thunder_Test_Support.yml CI workflow to validate the new library and downstream plugin integration tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Tests/test_support/ThunderTestRuntime.h
Comment thread Tests/test_support/ThunderTestRuntime.cpp
Comment thread Tests/test_support/ThunderTestRuntime.cpp Outdated
Comment thread Tests/test_support/ThunderTestRuntime.cpp
Comment thread Tests/test_support/ThunderTestRuntime.cpp Outdated
Comment thread Tests/test_support/tests/CMakeLists.txt Outdated
Add docs/ThunderTestSupport/ThunderTestSupport.md covering the
thunder_test_support static library introduced with ENABLE_TEST_RUNTIME=ON.
@github-actions
Copy link
Copy Markdown

PR Preview Action v1.1.1-25-g59e77e4
🛫 Deployed preview to https://rdkcentral.github.io/Thunder/pr-preview/pr-2099/
on branch gh-pages at 2026-05-11 10:37 UTC

@smanes0213 smanes0213 closed this May 13, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators May 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants