From 03b455ddd6c71b092aaf42cc93715cfdbac2f71d Mon Sep 17 00:00:00 2001 From: Jake Keller Date: Wed, 16 Apr 2025 18:24:31 +0000 Subject: [PATCH 1/5] Add BUILD_TESTING check before building tests --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2712f17a2..8cdb0a713 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -237,7 +237,7 @@ endif() ###################################################### -if (BTCPP_UNIT_TESTS) +if (BTCPP_UNIT_TESTS AND BUILD_TESTING) add_subdirectory(tests) endif() From 128680553f8d7fee84b1799b54831fa712d2d7a0 Mon Sep 17 00:00:00 2001 From: Jake Keller Date: Wed, 16 Apr 2025 18:35:35 +0000 Subject: [PATCH 2/5] Update Github actions to (hopefully) fix testing --- .github/workflows/cmake_ubuntu.yml | 4 ++-- .github/workflows/cmake_windows.yml | 2 +- pixi.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake_ubuntu.yml b/.github/workflows/cmake_ubuntu.yml index aaf5f628d..0bd1e9074 100644 --- a/.github/workflows/cmake_ubuntu.yml +++ b/.github/workflows/cmake_ubuntu.yml @@ -15,7 +15,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04] + os: [ubuntu-24.04] steps: - uses: actions/checkout@v2 @@ -49,7 +49,7 @@ jobs: - name: Build shell: bash working-directory: ${{github.workspace}}/build - run: cmake --build . --config ${{env.BUILD_TYPE}} + run: cmake --build . --config ${{env.BUILD_TYPE}} -DBUILD_TESTING=ON - name: run test (Linux) working-directory: ${{github.workspace}}/build diff --git a/.github/workflows/cmake_windows.yml b/.github/workflows/cmake_windows.yml index 192fdcac6..9861eccc5 100644 --- a/.github/workflows/cmake_windows.yml +++ b/.github/workflows/cmake_windows.yml @@ -44,7 +44,7 @@ jobs: - name: Build working-directory: ${{github.workspace}}/build shell: bash - run: cmake --build . --config ${{env.BUILD_TYPE}} + run: cmake --build . --config ${{env.BUILD_TYPE}} -DBUILD_TESTING=ON - name: run test (Windows) working-directory: ${{github.workspace}}/build diff --git a/pixi.toml b/pixi.toml index 955d13ef8..6bba2f1e7 100644 --- a/pixi.toml +++ b/pixi.toml @@ -13,7 +13,7 @@ test = "PATH=\"$PATH;build/Release\" build/tests/Release/behaviortree_cpp_test.e test = "./build/tests/behaviortree_cpp_test" [tasks] -build = "mkdir -p build && cd build && cmake ../ -DCMAKE_BUILD_TYPE=Release && cmake --build . --parallel --config Release" +build = "mkdir -p build && cd build && cmake ../ -DCMAKE_BUILD_TYPE=Release && cmake --build . --parallel --config Release --DBUILD_TESTING=ON" [dependencies] cmake = ">=3.16.3" From b2c80ebf734c31de6decd5ffe18ce506bb3476c9 Mon Sep 17 00:00:00 2001 From: Jake Keller Date: Wed, 16 Apr 2025 18:41:04 +0000 Subject: [PATCH 3/5] Fix misplaced CMAKE option --- .github/workflows/cmake_ubuntu.yml | 4 ++-- .github/workflows/cmake_windows.yml | 4 ++-- pixi.toml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cmake_ubuntu.yml b/.github/workflows/cmake_ubuntu.yml index 0bd1e9074..4f26e3039 100644 --- a/.github/workflows/cmake_ubuntu.yml +++ b/.github/workflows/cmake_ubuntu.yml @@ -44,12 +44,12 @@ jobs: - name: Configure CMake shell: bash working-directory: ${{github.workspace}}/build - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DBUILD_TESTING=ON - name: Build shell: bash working-directory: ${{github.workspace}}/build - run: cmake --build . --config ${{env.BUILD_TYPE}} -DBUILD_TESTING=ON + run: cmake --build . --config ${{env.BUILD_TYPE}} - name: run test (Linux) working-directory: ${{github.workspace}}/build diff --git a/.github/workflows/cmake_windows.yml b/.github/workflows/cmake_windows.yml index 9861eccc5..720e6e514 100644 --- a/.github/workflows/cmake_windows.yml +++ b/.github/workflows/cmake_windows.yml @@ -39,12 +39,12 @@ jobs: - name: Configure CMake shell: bash working-directory: ${{github.workspace}}/build - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DBUILD_TESTING=ON - name: Build working-directory: ${{github.workspace}}/build shell: bash - run: cmake --build . --config ${{env.BUILD_TYPE}} -DBUILD_TESTING=ON + run: cmake --build . --config ${{env.BUILD_TYPE}} - name: run test (Windows) working-directory: ${{github.workspace}}/build diff --git a/pixi.toml b/pixi.toml index 6bba2f1e7..5b3f42172 100644 --- a/pixi.toml +++ b/pixi.toml @@ -13,7 +13,7 @@ test = "PATH=\"$PATH;build/Release\" build/tests/Release/behaviortree_cpp_test.e test = "./build/tests/behaviortree_cpp_test" [tasks] -build = "mkdir -p build && cd build && cmake ../ -DCMAKE_BUILD_TYPE=Release && cmake --build . --parallel --config Release --DBUILD_TESTING=ON" +build = "mkdir -p build && cd build && cmake ../ -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON && cmake --build . --parallel --config Release" [dependencies] cmake = ">=3.16.3" From cf7752683c89f3e29f6f779e702f26066ab9bf26 Mon Sep 17 00:00:00 2001 From: Jake Keller Date: Wed, 16 Apr 2025 18:49:57 +0000 Subject: [PATCH 4/5] Reduce Ubuntu version in CI --- .github/workflows/cmake_ubuntu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake_ubuntu.yml b/.github/workflows/cmake_ubuntu.yml index 4f26e3039..4e5706f23 100644 --- a/.github/workflows/cmake_ubuntu.yml +++ b/.github/workflows/cmake_ubuntu.yml @@ -15,7 +15,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-24.04] + os: [ubuntu-22.04] steps: - uses: actions/checkout@v2 From b8eb85dd1df60211fe962588234d70309e6df864 Mon Sep 17 00:00:00 2001 From: Jake Keller Date: Wed, 16 Apr 2025 18:22:28 -0400 Subject: [PATCH 5/5] Update CMake to enable tests by default Co-authored-by: Scott K Logan --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8cdb0a713..ec5a91d26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -237,6 +237,7 @@ endif() ###################################################### +include(CTest) if (BTCPP_UNIT_TESTS AND BUILD_TESTING) add_subdirectory(tests) endif()