Skip to content

basic e2e test framework #5

basic e2e test framework

basic e2e test framework #5

Workflow file for this run

name: Windows Tests (mouse)
on:
push:
branches: [ master ]
paths:
- 'src/**'
- 'tests/**'
- '.github/**'
- 'CMakeLists.txt'
pull_request:
branches: [ master ]
paths:
- 'src/**'
- 'tests/**'
- '.github/**'
- 'CMakeLists.txt'
jobs:
test-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install vcpkg and SDL2
run: |
# Clone vcpkg
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
# Bootstrap vcpkg
.\bootstrap-vcpkg.bat
# Install SDL2
.\vcpkg install sdl2:x64-windows
# Integrate with Visual Studio
.\vcpkg integrate install
cd ..
- name: Configure with vcpkg
run: |
cmake -B build -DCMAKE_TOOLCHAIN_FILE="$PWD/vcpkg/scripts/buildsystems/vcpkg.cmake" -DBUILD_ROBOT_TESTS=ON
- name: Build
run: cmake --build build --config Release
- name: Test
run: |
# Check and display directory structure
Write-Host "Checking directory structure..."
# Check vcpkg directories
Write-Host "Vcpkg directories:"
Get-ChildItem -Path "vcpkg\installed\x64-windows\bin" -ErrorAction SilentlyContinue
# Check build output directories
Write-Host "Build output directories:"
Get-ChildItem -Path "build\bin" -ErrorAction SilentlyContinue
Get-ChildItem -Path "build\bin\Release" -ErrorAction SilentlyContinue
# Find SDL2.dll
Write-Host "Finding SDL2.dll..."
Get-ChildItem -Path "vcpkg" -Recurse -Filter "SDL2.dll" -ErrorAction SilentlyContinue |
ForEach-Object { Write-Host $_.FullName }
# Create Release directory if it doesn't exist
if (-not (Test-Path "build\bin\Release")) {
Write-Host "Creating missing directory: build\bin\Release"
New-Item -Path "build\bin\Release" -ItemType Directory -Force
}
# Try to find the executable
Write-Host "Finding test executable..."
Get-ChildItem -Path "build" -Recurse -Filter "*.exe" -ErrorAction SilentlyContinue |
ForEach-Object { Write-Host $_.FullName }
# Try to run the executable wherever it is
$executable = Get-ChildItem -Path "build" -Recurse -Filter "RobotCPPSDLTest.exe" -ErrorAction SilentlyContinue |
Select-Object -First 1
if ($executable) {
Write-Host "Found executable at: $($executable.FullName)"
# Try to find and copy SDL2.dll
$sdl2Dll = Get-ChildItem -Path "vcpkg" -Recurse -Filter "SDL2.dll" -ErrorAction SilentlyContinue |
Select-Object -First 1
if ($sdl2Dll) {
Write-Host "Found SDL2.dll at: $($sdl2Dll.FullName)"
Copy-Item -Path $sdl2Dll.FullName -Destination $executable.DirectoryName -Force
}
# Run the executable
Write-Host "Running: $($executable.FullName) --gtest_filter=-*InteractiveMode --ci-mode true"
& $executable.FullName --gtest_filter=-*InteractiveMode --ci-mode true
} else {
Write-Host "Executable not found!"
exit 1
}