Skip to content

Commit d16139a

Browse files
facontidavideclaude
andcommitted
Use ctest for Windows CI and Pixi to avoid heap corruption
Running all tests in a single process causes memory corruption that manifests as segfaults after hundreds of tests. Using ctest runs each test in its own process, avoiding this issue. Changes: - cmake_windows.yml: Use ctest instead of direct executable - pixi.toml: Use ctest for both Windows and Linux test tasks Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1450df8 commit d16139a

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎.github/workflows/cmake_windows.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,6 @@ jobs:
4646

4747
- name: Run tests
4848
working-directory: ${{ github.workspace }}/build
49-
run: $env:PATH+=";${{ matrix.build_type }}"; tests/${{ matrix.build_type }}/behaviortree_cpp_test.exe
49+
# Use ctest to run tests in separate processes, avoiding heap corruption
50+
# issues that occur when all tests run in a single process
51+
run: $env:PATH+=";${{ matrix.build_type }}"; ctest --output-on-failure -C ${{ matrix.build_type }}

‎pixi.toml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ channels = ["conda-forge"]
77
platforms = ["linux-64", "win-64"]
88

99
[target.win-64.tasks]
10-
test = "PATH=\"$PATH;build/Release\" build/tests/Release/behaviortree_cpp_test.exe"
10+
# Use ctest to run tests in separate processes, avoiding heap corruption
11+
# issues that occur when all tests run in a single process
12+
test = "PATH=\"$PATH;build/Release\" ctest --test-dir build --output-on-failure -C Release"
1113

1214
[target.linux-64.tasks]
13-
test = "./build/tests/behaviortree_cpp_test"
15+
# Use ctest to run tests in separate processes for consistency with CI
16+
test = "ctest --test-dir build --output-on-failure"
1417

1518
[tasks]
1619
build = "mkdir -p build && cd build && cmake ../ -DCMAKE_BUILD_TYPE=Release && cmake --build . --parallel --config Release"

0 commit comments

Comments
 (0)