-
Notifications
You must be signed in to change notification settings - Fork 14
Thunder IDL Tags — Additional Test Coverage #298
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
Draft
smanes0213
wants to merge
31
commits into
master
Choose a base branch
from
Development/Test-Thunder-Tags
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
25bd7c9
Thunder IDL Tags — Additional Test Coverage
smanes0213 9de8f19
Merge branch 'master' into Development/Test-Thunder-Tags
smanes0213 4027e8e
Update ProxyStubFunctionalTests.yml
smanes0213 4208081
Update ProxyStubFunctionalTests.yml
smanes0213 496cd31
Split event tests into dedicated COM-RPC-only interface to avoid
smanes0213 adb6cd4
Resolve test failures
smanes0213 4eb04c2
Covering remaining gaps, update tests to use EXPECT_EQ isntead of find
smanes0213 e00d2d6
Covering remaining gaps, update tests to use EXPECT_EQ isntead of find
smanes0213 c21f535
Update ITestAnnotationEvent.h
smanes0213 2d9d901
Update TestAnnotationEventsImpl.cpp
smanes0213 a4a5862
Update TestAnnotationEventsImpl.cpp
smanes0213 9e88256
Update TestAnnotationEventsImpl.cpp
smanes0213 26574d4
Update TestAnnotationEvents.cpp
smanes0213 8663518
Update TestAnnotationEvents.cpp
smanes0213 ba2858a
Update TestAnnotationEventsImpl.cpp
smanes0213 4a2d74b
Update TestAnnotationEventsImpl.cpp
smanes0213 fde94ee
Update TestAnnotationEvents.cpp
smanes0213 f674db4
Update TestAnnotationEvents.cpp
smanes0213 70d2a5c
Update TestAnnotationEventsImpl.cpp
smanes0213 b498143
Update TestAnnotationEvents.cpp
smanes0213 509a34a
Update TestAnnotationEvents.cpp
smanes0213 cd7f432
Add tests for @prefix, @wrapped and JSON_RPC event subscription test
smanes0213 f3ad084
Resolve workflow failures
smanes0213 c9ff4ab
fix(ci): use per-architecture socket path to prevent parallel build i…
smanes0213 2ac64ea
Socket path is now configurable via COMRPC_SOCKET_PATH env variable
smanes0213 182e9c9
Resolve reveiew comments
smanes0213 6e130f7
Resolve test failure
smanes0213 d90e8ad
Resolve test failure
smanes0213 ad6bc60
Merge branch 'master' into Development/Test-Thunder-Tags
smanes0213 9da9516
Add more unit tests for @text tags
smanes0213 f72e3d2
Add more sleep time to resolve CI failure due to timeout
smanes0213 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
143 changes: 143 additions & 0 deletions
143
tests/FunctionalTests/common/implementations/TestAnnotationEventsImpl.cpp
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,143 @@ | ||
| /* | ||
| * If not stated otherwise in this file or this component's LICENSE file the | ||
| * following copyright and licenses apply: | ||
| * | ||
| * Copyright 2026 Metrological | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| #include <ImplementationFactory.h> | ||
| #include <ITestAnnotationEvents.h> | ||
| #include <mutex> | ||
| #include <thread> | ||
|
|
||
| namespace Thunder { | ||
| namespace TestImplementation { | ||
|
|
||
| class TestAnnotationEventsImpl : public FunctionalTest::ITestAnnotationEvents { | ||
| public: | ||
| TestAnnotationEventsImpl() | ||
| : _caps(FunctionalTest::ITestAnnotationEvents::CAP_NONE) | ||
| , _notification(nullptr) | ||
| { | ||
| } | ||
|
|
||
| ~TestAnnotationEventsImpl() override = default; | ||
|
|
||
| TestAnnotationEventsImpl(const TestAnnotationEventsImpl&) = delete; | ||
| TestAnnotationEventsImpl& operator=(const TestAnnotationEventsImpl&) = delete; | ||
|
|
||
| Core::hresult Register(INotification* notification) override | ||
| { | ||
| std::lock_guard<std::mutex> lock(_mutex); | ||
| if (_notification != nullptr) { | ||
| return Core::ERROR_ALREADY_CONNECTED; | ||
| } | ||
| _notification = notification; | ||
| _notification->AddRef(); | ||
| // @statuslistener: deliver current caps on a background thread to avoid | ||
| // COM-RPC channel deadlock (cannot make a reverse call on the same channel | ||
| // that is still processing the Register request). | ||
| Caps currentCaps = _caps; | ||
| INotification* sink = _notification; | ||
| sink->AddRef(); | ||
| std::thread([sink, currentCaps]() { | ||
| sink->OnCapsChanged(currentCaps); | ||
| sink->Release(); | ||
| }).detach(); | ||
| return Core::ERROR_NONE; | ||
| } | ||
|
|
||
| Core::hresult Unregister(INotification* notification) override | ||
| { | ||
| std::lock_guard<std::mutex> lock(_mutex); | ||
| if (_notification == notification) { | ||
| _notification->Release(); | ||
| _notification = nullptr; | ||
| return Core::ERROR_NONE; | ||
| } | ||
| return Core::ERROR_NOT_EXIST; | ||
| } | ||
|
|
||
| // All notification callbacks are dispatched on background threads to avoid | ||
| // COM-RPC channel deadlock. The server's worker thread cannot make a reverse-proxy | ||
| // call on the same channel it's currently serving a request on. | ||
|
|
||
| Core::hresult SetCaps(const Caps caps) override | ||
| { | ||
| _caps = caps; | ||
| std::lock_guard<std::mutex> lock(_mutex); | ||
| if (_notification) { | ||
| INotification* sink = _notification; | ||
| sink->AddRef(); | ||
| Caps c = _caps; | ||
| std::thread([sink, c]() { sink->OnCapsChanged(c); sink->Release(); }).detach(); | ||
| } | ||
| return Core::ERROR_NONE; | ||
| } | ||
|
|
||
| Core::hresult GetCaps(Caps& caps) const override | ||
| { | ||
| caps = _caps; | ||
| return Core::ERROR_NONE; | ||
| } | ||
|
|
||
| Core::hresult TriggerPortState(const uint8_t port, const State state) override | ||
| { | ||
| std::lock_guard<std::mutex> lock(_mutex); | ||
| if (_notification) { | ||
| INotification* sink = _notification; | ||
| sink->AddRef(); | ||
| std::thread([sink, port, state]() { sink->OnPortStateChanged(port, state); sink->Release(); }).detach(); | ||
| } | ||
| return Core::ERROR_NONE; | ||
| } | ||
|
|
||
| Core::hresult TriggerStatus(const string& message) override | ||
| { | ||
| std::lock_guard<std::mutex> lock(_mutex); | ||
| if (_notification) { | ||
| INotification* sink = _notification; | ||
| sink->AddRef(); | ||
| string msg = message; | ||
| std::thread([sink, msg]() { sink->OnStatusUpdate(msg); sink->Release(); }).detach(); | ||
| } | ||
| return Core::ERROR_NONE; | ||
| } | ||
|
|
||
| Core::hresult TriggerLegacyChannel(const uint8_t channel, const uint32_t level) override | ||
| { | ||
| std::lock_guard<std::mutex> lock(_mutex); | ||
| if (_notification) { | ||
| INotification* sink = _notification; | ||
| sink->AddRef(); | ||
| std::thread([sink, channel, level]() { sink->OnLegacyChannelEvent(channel, level); sink->Release(); }).detach(); | ||
| } | ||
| return Core::ERROR_NONE; | ||
| } | ||
|
|
||
| BEGIN_INTERFACE_MAP(TestAnnotationEventsImpl) | ||
| INTERFACE_ENTRY(FunctionalTest::ITestAnnotationEvents) | ||
| END_INTERFACE_MAP | ||
|
|
||
| private: | ||
| Caps _caps; | ||
| INotification* _notification; | ||
| mutable std::mutex _mutex; | ||
| }; | ||
|
|
||
| static Factory::Registrar<FunctionalTest::ITestAnnotationEvents, TestAnnotationEventsImpl> g_annotationEventsRegistrar; | ||
|
|
||
| } // namespace TestImplementation | ||
| } // namespace Thunder |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.