Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
2234ad8
test: adding initial funtional tests
bramoosterhuis Mar 4, 2026
d77abd6
cmake: include tests to be build
bramoosterhuis Mar 4, 2026
e769893
cmake: make sure we can overrule the default generator paths
bramoosterhuis Mar 4, 2026
7389ea1
actions: initial workflow file to build and run functional tests
bramoosterhuis Mar 4, 2026
417ad9a
tests: disambiguate ActiveColor getter via const cast
bramoosterhuis Mar 4, 2026
5e2877b
tests: TestOptionals, disable @out optional hint tests pending genera…
bramoosterhuis Mar 4, 2026
7388525
tests: Enable more tests
bramoosterhuis Mar 5, 2026
9fa6eb6
cmake: disable async tests
bramoosterhuis Mar 9, 2026
cf3004a
tests: fix optional tests
bramoosterhuis Mar 9, 2026
d57a691
adding vscode environment files
bramoosterhuis Mar 9, 2026
1748b4c
tests: fix 32/64bit build differences
bramoosterhuis Mar 11, 2026
e5c02ba
tests: add override to AddRef/Release()
bramoosterhuis Mar 11, 2026
cf7b33b
Development : Add JSON-RPC functional test infrastructure
smanes0213 Mar 24, 2026
377a3b0
Update ITestPrimitives.h
smanes0213 Mar 24, 2026
33de376
Update ITestPrimitives.h
smanes0213 Mar 24, 2026
b22aabc
Update ITestPrimitives.h
smanes0213 Mar 24, 2026
3b98b5a
Resolve review comments
smanes0213 Mar 25, 2026
5d07b1b
Add @stubgen:omit to Int24/UInt24 methods - ProxyStubGenerator genera…
smanes0213 Mar 25, 2026
85aa701
Remove @stubgen:omit from Int24/UInt24 - generator uses int24_t typed…
smanes0213 Mar 25, 2026
616e509
Remove Events test for JSONRPC
smanes0213 Mar 26, 2026
1a1ef05
Update ProxyStubFunctionalTests.yml
smanes0213 Mar 26, 2026
8c251bf
Add handwritten JSON-RPC handler versioning coverage
smanes0213 Apr 2, 2026
1ad473b
add JSON-RPC handler versioning coverage
smanes0213 Apr 6, 2026
4603106
Merge branch 'master' into development/json-rpc-functional-tests
bramoosterhuis Apr 8, 2026
c05ebf8
Merge branch 'master' into development/json-rpc-functional-tests
smanes0213 Apr 10, 2026
c6c0b7c
Update ProxyStubFunctionalTests.yml
smanes0213 Apr 10, 2026
93621b6
Refactor tests to have a common sources for the interface implementat…
bramoosterhuis Apr 23, 2026
409d7bd
Update ProxyStubFunctionalTests.yml to enable functional tests and ad…
bramoosterhuis Apr 23, 2026
1fad748
Update launch and settings configurations for functional tests
bramoosterhuis Apr 23, 2026
9f99154
Merge branch 'master' into development/json-rpc-functional-tests
bramoosterhuis Apr 23, 2026
e4c15b1
Update ProxyStubFunctionalTests.yml to build targets separately for f…
bramoosterhuis Apr 23, 2026
0468cd5
Update ProxyStubFunctionalTests.yml to build all targets concurrently…
bramoosterhuis Apr 23, 2026
30dd64f
Remove parallel build option for ProxyStub functional tests to simpli…
bramoosterhuis Apr 23, 2026
8c37242
Update ProxyStubFunctionalTests.yml to build specific functional test…
bramoosterhuis Apr 23, 2026
f396bfc
Update ProxyStubFunctionalTests.yml to specify generator paths for fu…
bramoosterhuis Apr 24, 2026
66db269
Refactor TestIterators to use ASYNC_DRAIN_DELAY_MS for consistent sle…
bramoosterhuis Apr 24, 2026
893f075
Remove GetPoint_BeforeSet test to streamline test suite
bramoosterhuis Apr 24, 2026
10f7e72
Speed up test execution by sharing COM-RPC connection per test suite
bramoosterhuis Apr 24, 2026
ceefce1
Add license headers to functional and JSON-RPC test files
bramoosterhuis Apr 24, 2026
3f4a606
Revert the private declaration of Registrar class
bramoosterhuis Apr 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions .github/workflows/ProxyStubFunctionalTests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: ProxyStub & JSON-RPC Generator Functional Tests

permissions:
contents: read

on:
workflow_dispatch:
push:
branches: [ master ]
paths:
- "ProxyStubGenerator/**"
- "JsonGenerator/**"
- ".github/workflows/ProxyStubFunctionalTests.yml"
pull_request:
branches: [ master ]
paths:
- "ProxyStubGenerator/**"
- "JsonGenerator/**"
- ".github/workflows/ProxyStubFunctionalTests.yml"

jobs:
test:
runs-on: ubuntu-24.04
name: Build type - ${{ matrix.architecture == '32' && 'x86' || 'x86_64' }}
strategy:
matrix:
architecture: [32, 64]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Prepare apt (add i386 if needed)
if: ${{ matrix.architecture == '32' }}
run: |
sudo dpkg --add-architecture i386

- name: Update apt indices (with retries)
shell: bash
run: |
set -euo pipefail
for attempt in {1..5}; do
if sudo apt-get update -o Acquire::Retries=5 -o Acquire::http::Timeout=30; then
break
fi
echo "apt-get update failed (attempt $attempt), retrying..."
sleep $((attempt*10))
done

- name: Install system dependencies
shell: bash
run: |
set -euo pipefail
export DEBIAN_FRONTEND=noninteractive
PKGS="python3-venv python3-pip build-essential cmake ninja-build"
if [ "${{ matrix.architecture }}" = "32" ]; then
PKGS="$PKGS zlib1g-dev:i386 libssl-dev:i386 gcc-13-multilib g++-13-multilib"
else
PKGS="$PKGS zlib1g-dev libssl-dev"
fi
for attempt in {1..4}; do
if sudo apt-get install -y --no-install-recommends $PKGS; then
break
fi
echo "apt-get install failed (attempt $attempt), cleaning up & retrying..."
sudo apt-get clean
sleep $((attempt*15))
done

- name: Set up Python environment
run: |
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install jsonref

- name: Build Functional Tests
run: |
source venv/bin/activate
cmake \
-G Ninja \
-S . \
-B Build/ThunderTools \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DENABLE_TESTING=ON \
-DFUNCTIONAL_TESTS=ON \
-DPROXYSTUB_GENERATOR=$(pwd)/ProxyStubGenerator/StubGenerator.py \
-DJSON_GENERATOR=$(pwd)/JsonGenerator/JsonGenerator.py
cmake \
--build Build/ThunderTools \
--target JsonRpcFunctionalTests ComRpcFunctionalTests

- name: Run ProxyStub Functional Tests
run: Build/ThunderTools/tests/FunctionalTests/comrpc/ComRpcFunctionalTests

- name: Run JSON-RPC Functional Tests
run: Build/ThunderTools/tests/FunctionalTests/jsonrpc/JsonRpcFunctionalTests
81 changes: 81 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Local Debug ComRpcFunctionalTests",
"type": "cppdbg",
"request": "launch",
"program": "${config:cmake.buildDirectory}/tests/FunctionalTests/comrpc/ComRpcFunctionalTests",
"args": [
// "--gtest_filter=TestAsync.*",
// "--gtest_filter=-TestInterfaces.*"
// "--gtest_repeat=1"
],
"stopAtEntry": false,
"cwd": "${config:cmake.buildDirectory}",
"logging": {
"moduleLoad": false,
"trace": false
},
"externalConsole": false,
"linux": {
"program": "${config:cmake.buildDirectory}/tests/FunctionalTests/comrpc/ComRpcFunctionalTests",
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Break on pure virtual call",
"text": "break __cxa_pure_virtual",
"ignoreFailures": false
}
],
"sourceFileMap": {},
"environment": [],
"additionalSOLibSearchPath": "",
},
},
{
"name": "Local Debug JsonRpcFunctionalTests",
"type": "cppdbg",
"request": "launch",
"program": "${config:cmake.buildDirectory}/tests/FunctionalTests/jsonrpc/JsonRpcFunctionalTests",
"args": [
// "--gtest_filter=TestAsync.*",
// "--gtest_filter=-TestInterfaces.*"
// "--gtest_repeat=1"
],
"stopAtEntry": false,
"cwd": "${config:cmake.buildDirectory}",
"logging": {
"moduleLoad": false,
"trace": false
},
"externalConsole": false,
"linux": {
"program": "${config:cmake.buildDirectory}/tests/FunctionalTests/jsonrpc/JsonRpcFunctionalTests",
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Break on pure virtual call",
"text": "break __cxa_pure_virtual",
"ignoreFailures": false
}
],
"sourceFileMap": {},
"environment": [],
"additionalSOLibSearchPath": "",
},
},
]
}
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"cmake.configureOnOpen": false,
"cmake.configureSettings": {
"CMAKE_BUILD_TYPE" : "Release" ,
"CMAKE_MESSAGE_LOG_LEVEL" : "VERBOSE" ,
"CMAKE_VERBOSE_MAKEFILE" : "ON",
"ENABLE_TESTING" : "ON",
"FUNCTIONAL_TESTS" : "ON",
}
}
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ option(JSON_GENERATOR_ENABLE_STATS "Globally enable JSON-RPC stats" OFF)
option(PROXYSTUB_GENERATOR_ENABLE_SECURITY "Globally enable security checks in proxystubs" OFF)
option(PROXYSTUB_GENERATOR_ENABLE_COHERENCY "Globally enable frame coherency checks in proxystubs" OFF)

option(ENABLE_TESTING "Include the tests to be build" ON)

message(VERBOSE "GENERATOR_MODULE_INSTALL_PATH: ${GENERATOR_MODULE_INSTALL_PATH}")
message(VERBOSE "GENERATOR_INSTALL_PATH: ${GENERATOR_INSTALL_PATH}")

Expand Down Expand Up @@ -68,3 +70,7 @@ install(DIRECTORY
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
COMPONENT ${NAMESPACE}_Runtime
)

if(ENABLE_TESTING)
add_subdirectory(tests)
endif()
3 changes: 2 additions & 1 deletion JsonGenerator/source/rpc_emitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,8 @@ def _Invoke(method, conditional_invoke, sorted_vars, params, response, parent=""
emit.Line("%s %s;" % (param.original_type, vector))

emit.Line("auto %s = %s.Elements();" % (temp, parent + param.cpp_name))
emit.Line("while ((%s.Next() == true) { %s.push_back(%s.Current()); }" % (temp, vector, temp))
# Removed extra paranthesis from the below line leading to compilation failure
emit.Line("while (%s.Next() == true) { %s.push_back(%s.Current()); }" % (temp, vector, temp))

if param.optional:
emit.Line("%s = std::move(%s);" % (param.temp_name, vector))
Expand Down
5 changes: 4 additions & 1 deletion cmake/FindConfigGenerator.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ macro(IncludeConfig)
endmacro()
endif(CMAKE_VERSION VERSION_LESS 3.20.0 AND LEGACY_CONFIG_GENERATOR)

set(CONFIG_GENERATOR_PATH "${CMAKE_CURRENT_LIST_DIR}/../ConfigGenerator")
if(NOT CONFIG_GENERATOR_PATH)
set(CONFIG_GENERATOR_PATH "${CMAKE_CURRENT_LIST_DIR}/../ConfigGenerator")
endif()

set(CONFIG_GENERATOR "${CONFIG_GENERATOR_PATH}/config_generator.py")
set(CONFIG_COMPARE "${CONFIG_GENERATOR_PATH}/config_compare.py")

Expand Down
4 changes: 3 additions & 1 deletion cmake/FindJsonGenerator.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ if(NOT PYTHON_EXECUTABLE)
find_package(Python3 3.5 REQUIRED QUIET)
endif()

set(JSON_GENERATOR "${CMAKE_CURRENT_LIST_DIR}/../JsonGenerator/JsonGenerator.py")
if(NOT JSON_GENERATOR)
set(JSON_GENERATOR "${CMAKE_CURRENT_LIST_DIR}/../JsonGenerator/JsonGenerator.py")
endif()

function(JsonGenerator)
if (NOT JSON_GENERATOR)
Expand Down
4 changes: 3 additions & 1 deletion cmake/FindProxyStubGenerator.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ if(NOT PYTHON_EXECUTABLE)
find_package(Python3 3.5 REQUIRED QUIET)
endif()

set(PROXYSTUB_GENERATOR "${CMAKE_CURRENT_LIST_DIR}/../ProxyStubGenerator/StubGenerator.py")
if(NOT PROXYSTUB_GENERATOR)
set(PROXYSTUB_GENERATOR "${CMAKE_CURRENT_LIST_DIR}/../ProxyStubGenerator/StubGenerator.py")
endif()

function(ProxyStubGenerator)
if (NOT PROXYSTUB_GENERATOR)
Expand Down
21 changes: 21 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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.

cmake_minimum_required(VERSION 3.15)

option(FUNCTIONAL_TESTS "Enable functional interface tests" OFF)

if(FUNCTIONAL_TESTS)
add_subdirectory(FunctionalTests)
endif()
44 changes: 44 additions & 0 deletions tests/FunctionalTests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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.

option(ENABLE_COM_RPC_TESTS "Enable COM-RPC functional tests" ON)
option(ENABLE_JSON_RPC_TESTS "Enable JSON-RPC functional tests" ON)

option(TEST_ASYNC "Enable async pattern tests" OFF)
option(TEST_BUFFERS "Enable buffer annotations tests" ON)
option(TEST_ENUMS "Enable enum types tests" ON)
option(TEST_EVENTS "Enable event callbacks tests" ON)
option(TEST_INTERFACES "Enable interface passing tests" OFF)
option(TEST_ITERATORS "Enable iterator pattern tests" ON)
option(TEST_OPTIONALS "Enable optional parameters tests" ON)
option(TEST_PRIMITIVES "Enable primitive types tests" ON)
option(TEST_RESTRICTIONS "Enable restrict annotation tests" ON)
option(TEST_STRUCTS "Enable POD struct tests" ON)

set(CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}" CACHE BOOL "" FORCE)

enable_testing()

add_subdirectory(external/googletest)
add_subdirectory(external/thunder)

add_subdirectory(common)

if(ENABLE_COM_RPC_TESTS)
add_subdirectory(comrpc )
endif()

if(ENABLE_JSON_RPC_TESTS)
add_subdirectory(jsonrpc)
endif()
Loading
Loading