Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
90 changes: 90 additions & 0 deletions .github/workflows/ProxyStubFunctionalTests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Proxy Stub Generator Functional Tests

permissions:
contents: read

on:
workflow_dispatch:
push:
branches: [ master ]
paths:
- "ProxyStubGenerator/**"
- ".github/workflows/ProxyStubFunctionalTests.yml"
pull_request:
branches: [ master ]
paths:
- "ProxyStubGenerator/**"
- ".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 ProxyStubFunctionalTests
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
cmake \
--build Build/ThunderTools \
--target ProxyStubFunctionalTests

- name: Run ProxyStub Functional Tests
run: Build/ThunderTools/tests/ProxyStubFunctionalTests
43 changes: 43 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Local Debug ProxyStubFunctionalTests",
"type": "cppdbg",
"request": "launch",
"program": "${config:cmake.buildDirectory}/tests/ProxyStubFunctionalTests",
"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/ProxyStubFunctionalTests",
"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": "",
},
},
]
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"cmake.configureOnOpen": false,
"cmake.configureSettings": {
"CMAKE_BUILD_TYPE" : "Release" ,
"CMAKE_MESSAGE_LOG_LEVEL" : "VERBOSE" ,
"CMAKE_VERBOSE_MAKEFILE" : "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()
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
Loading
Loading