From 1ac48139c7b23c22572d7824d9209e5af22ccca7 Mon Sep 17 00:00:00 2001 From: scawful Date: Sun, 28 Sep 2025 17:36:19 -0400 Subject: [PATCH] Update CMake configuration to enhance test suite management - Modified `CMakeLists.txt` to cache the `YAZE_BUILD_TESTS` option, improving clarity in test suite configuration. - Updated the GitHub Actions workflow to include verification steps for the CMake configuration, ensuring that test targets are correctly identified. - Adjusted test discovery logic in `test/CMakeLists.txt` to double-check that tests are enabled, enhancing the robustness of the build process. --- .github/workflows/release.yml | 8 ++++++++ CMakeLists.txt | 2 +- test/CMakeLists.txt | 5 +++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 674c251c..87c46e0b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -242,6 +242,8 @@ jobs: shell: pwsh run: | Write-Host "Configuring CMake for Windows build..." + Write-Host "Build type: ${{ env.BUILD_TYPE }}" + Write-Host "YAZE_BUILD_TESTS will be set to OFF" # Check if vcpkg is available if ((Test-Path "${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake") -and ($env:VCPKG_AVAILABLE -ne "false")) { @@ -274,6 +276,12 @@ jobs: } Write-Host "CMake configuration completed successfully" + + # Verify the configuration + Write-Host "Verifying CMake configuration..." + Write-Host "Checking if test targets are present..." + cmake --build build --target help 2>&1 | findstr "yaze_test" || echo "yaze_test target not found (good!)" + Write-Host "Configuration verification completed" # Build - name: Build diff --git a/CMakeLists.txt b/CMakeLists.txt index bec6dace..5c50052e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,7 +42,7 @@ set(YAZE_BUILD_APP ON) set(YAZE_BUILD_LIB ON) set(YAZE_BUILD_EMU ON) set(YAZE_BUILD_Z3ED ON) -set(YAZE_BUILD_TESTS ON) +set(YAZE_BUILD_TESTS ON CACHE BOOL "Build test suite") set(YAZE_INSTALL_LIB OFF) # Testing and CI Configuration diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 84c7d4d2..94b7c4a4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -12,7 +12,8 @@ foreach (file endforeach() # Only build test executable if tests are enabled -if(YAZE_BUILD_TESTS) +# Double-check to ensure tests are actually enabled +if(YAZE_BUILD_TESTS AND NOT YAZE_BUILD_TESTS STREQUAL "OFF") # Main test executable with enhanced argument handling for AI agents # Use CI version for minimal builds, full version for development if(YAZE_MINIMAL_BUILD) @@ -218,7 +219,7 @@ endif() # Configure test discovery with efficient labeling for CI/CD # Only discover tests if tests are enabled -if(YAZE_BUILD_TESTS) +if(YAZE_BUILD_TESTS AND NOT YAZE_BUILD_TESTS STREQUAL "OFF") include(GoogleTest) # Discover all tests with default properties