From 68de8a9f281e1d0bed68bacae92ac09ba952036e Mon Sep 17 00:00:00 2001 From: dayfine Date: Wed, 18 Nov 2026 01:48:26 -0800 Subject: [PATCH 1/4] Logic tests: a Qt/OpenCV/ONNX-free unit test target and CI job Moved unchanged from autostory/shared-core (2cefcd3d6): SerialProgramsLogicTests runs the AutoStory, ScreenEvents and ScreenMachine suites with -DPA_CORE_ONLY=ON. --- .github/workflows/logic-tests.yml | 33 +++++ SerialPrograms/CMakeLists.txt | 7 + .../Tests/LogicTests/LogicTests_Main.cpp | 133 ++++++++++++++++++ SerialPrograms/cmake/LogicTests.cmake | 30 ++++ SerialPrograms/cmake/SourceFiles.cmake | 82 +++++++++++ 5 files changed, 285 insertions(+) create mode 100644 .github/workflows/logic-tests.yml create mode 100644 SerialPrograms/Source/Tests/LogicTests/LogicTests_Main.cpp create mode 100644 SerialPrograms/cmake/LogicTests.cmake diff --git a/.github/workflows/logic-tests.yml b/.github/workflows/logic-tests.yml new file mode 100644 index 0000000000..f8345d031f --- /dev/null +++ b/.github/workflows/logic-tests.yml @@ -0,0 +1,33 @@ +name: Logic Tests +# Builds and runs SerialProgramsLogicTests (SerialPrograms/cmake/LogicTests.cmake): the unit +# tests that need no Qt, OpenCV, ONNX Runtime, Tesseract or test images. It configures with +# -DPA_CORE_ONLY=ON, so it downloads nothing and keeps testing refactors when the full +# build's third-party downloads fail. Runs on every PR push, drafts included. +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + ubuntu: + runs-on: ubuntu-26.04 + steps: + - uses: actions/checkout@v7 + + - name: Install Ninja + run: | + sudo apt update + sudo apt install ninja-build + + - name: Configure + run: cmake -S SerialPrograms -B build-logic -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPA_CORE_ONLY=ON -DCOMMAND_LINE_EXE=OFF -DPA_LOGIC_TESTS=ON + + - name: Build + run: cmake --build build-logic --target SerialProgramsLogicTests --parallel 4 + + - name: Run the logic tests + run: build-logic/SerialProgramsLogicTests diff --git a/SerialPrograms/CMakeLists.txt b/SerialPrograms/CMakeLists.txt index 7165a721cb..66d4f0cc4b 100644 --- a/SerialPrograms/CMakeLists.txt +++ b/SerialPrograms/CMakeLists.txt @@ -101,6 +101,10 @@ option(PA_CORE_ONLY "Build only the GUI-free core (basic microcontroller functio # listing, so every file would be recompiled on every run. option(PA_ASSEMBLY_LISTINGS "Write an assembly listing of every source file to Assembly/ (MSVC and clang-cl only)" ON) +# With PA_CORE_ONLY, also build SerialProgramsLogicTests: the unit tests that need no +# Qt, OpenCV, ONNX Runtime, Tesseract or test images. See cmake/LogicTests.cmake. +option(PA_LOGIC_TESTS "With PA_CORE_ONLY, build the logic-only unit tests (SerialProgramsLogicTests)" OFF) + # Enable SDL by giving -DPA_SDL=ON on the CMake command line option(PA_SDL "Enable SDL library" OFF) @@ -111,6 +115,9 @@ if(PA_CORE_ONLY) set(CMAKE_AUTOUIC OFF) include(cmake/SourceFiles.cmake) include(cmake/CoreLib.cmake) + if(PA_LOGIC_TESTS) + include(cmake/LogicTests.cmake) + endif() if(COMMAND_LINE_EXE) include(Source/CommandLine/CommandLineExecutable.cmake) endif() diff --git a/SerialPrograms/Source/Tests/LogicTests/LogicTests_Main.cpp b/SerialPrograms/Source/Tests/LogicTests/LogicTests_Main.cpp new file mode 100644 index 0000000000..cb6f7b0636 --- /dev/null +++ b/SerialPrograms/Source/Tests/LogicTests/LogicTests_Main.cpp @@ -0,0 +1,133 @@ +/* Logic Tests Main + * + * From: https://github.com/PokemonAutomation/ + * + * SerialProgramsLogicTests: runs the unit tests of code that needs no Qt, OpenCV, + * ONNX Runtime or Tesseract, and no test images. It is built only with + * -DPA_CORE_ONLY=ON -DPA_LOGIC_TESTS=ON (see cmake/LogicTests.cmake), so it can + * test refactors even when the full build's third-party downloads are broken. + * + * This executable opens no serial port, camera or console: it only links the + * GUI-free CoreLib and the pure sources listed in LOGIC_LIBRARY_SOURCES. It is + * safe to run anywhere, unlike the SerialPrograms app. + * + * Usage: SerialProgramsLogicTests [--filter ] + * Runs every registered test (or those whose name contains ) one at a + * time, prints one line per test and a summary, and returns 1 if any test failed. + * + * A suite joins this runner when every file it includes is pure: add its sources to + * LOGIC_LIBRARY_SOURCES / LOGIC_TEST_SOURCES in cmake/SourceFiles.cmake and its + * add_tests_() call to make_logic_tests() below. The same suites also stay + * registered in the full test runner (ComputerPrograms_UnitTestRunner.cpp). + */ + +#include +#include +#include +#include +#include +#include "Common/Cpp/CancellableScope.h" +#include "Common/Cpp/Exceptions.h" +#include "Common/Cpp/Logging/AbstractLogger.h" +#include "Common/Cpp/TestRunners/UnitTest.h" +#include "Common/Cpp/TestRunners/UnitTestDatabase.h" +#include "CommonTools/ScreenEvents/ScreenEvents_Tests.h" +#include "CommonTools/ScreenMachine/ScreenMachine_Tests.h" +#include "Pokemon/AutoStory/Pokemon_AutoStory_Tests.h" + +namespace PokemonAutomation{ +namespace{ + + +UnitTestDatabase make_logic_tests(){ + UnitTestDatabase database; + Pokemon::add_tests_AutoStory(database); + add_tests_ScreenEvents(database); + add_tests_ScreenMachine(database); + return database; +} + + +class StdoutLogger : public Logger{ +public: + using Logger::log; + virtual void log(const std::string& msg, Color) override{ + std::cout << msg << std::endl; + } +}; + + +struct RunCounts{ + size_t passed = 0; + size_t failed = 0; + size_t skipped = 0; +}; + +UnitTestResult run_one(const UnitTest& test, Logger& logger){ + CancellableHolder scope; + try{ + return test.run(logger, scope); + }catch (const Exception& e){ + return UnitTestResult(UnitTestResult::FAILED, std::format("Exception: {}", e.to_str())); + }catch (const std::exception& e){ + return UnitTestResult(UnitTestResult::FAILED, std::format("std::exception: {}", e.what())); + } +} + +void record(const UnitTest& test, const UnitTestResult& result, RunCounts& counts){ + switch (result.result){ + case UnitTestResult::PASSED: + std::cout << "PASSED: " << test.name() << std::endl; + counts.passed++; + return; + case UnitTestResult::NOT_RUN: + case UnitTestResult::SKIPPED: + std::cout << "SKIPPED: " << test.name() << std::endl; + counts.skipped++; + return; + case UnitTestResult::FAILED: + case UnitTestResult::OOM: + std::cout << "FAILED: " << test.name() << ": " << result.message << std::endl; + counts.failed++; + return; + } +} + +int run_logic_tests(std::string_view filter){ + StdoutLogger logger; + RunCounts counts; + for (const auto& item : make_logic_tests()){ + if (!filter.empty() && !item.first.contains(filter)){ + continue; + } + record(*item.second, run_one(*item.second, logger), counts); + } + std::cout << "Tests Finished:" + << "\n Passed: " << counts.passed + << "\n Failed: " << counts.failed + << "\n Skipped: " << counts.skipped << std::endl; + if (counts.passed + counts.failed == 0){ + std::cout << "No test ran." << std::endl; + return 1; + } + return counts.failed > 0 ? 1 : 0; +} + + +} // namespace +} // namespace PokemonAutomation + + +int main(int argc, char* argv[]){ + std::string_view filter; + for (int c = 1; c < argc; c++){ + std::string_view arg = argv[c]; + if (arg == "--filter" && c + 1 < argc){ + filter = argv[++c]; + }else{ + std::cerr << "Usage: " << argv[0] << " [--filter ]" << std::endl; + return 2; + } + } + return PokemonAutomation::run_logic_tests(filter); +} diff --git a/SerialPrograms/cmake/LogicTests.cmake b/SerialPrograms/cmake/LogicTests.cmake new file mode 100644 index 0000000000..951528a7de --- /dev/null +++ b/SerialPrograms/cmake/LogicTests.cmake @@ -0,0 +1,30 @@ +# SerialProgramsLogicTests: the unit tests that need no Qt, OpenCV, ONNX Runtime, +# Tesseract or test images. +# +# Built only with -DPA_CORE_ONLY=ON -DPA_LOGIC_TESTS=ON, so it configures and builds +# even when the full build's third-party downloads fail, e.g.: +# cmake -S SerialPrograms -B build-logic -G Ninja -DPA_CORE_ONLY=ON -DCOMMAND_LINE_EXE=OFF -DPA_LOGIC_TESTS=ON +# cmake --build build-logic --target SerialProgramsLogicTests +# build-logic/SerialProgramsLogicTests [--filter ] +# +# It links CoreLib plus LogicLib, a static library of ${LOGIC_LIBRARY_SOURCES} +# (see SourceFiles.cmake). The full build does not use this file. +# +# Requires CoreLib.cmake (CoreLib and pa_apply_gui_free_target_properties()). + +add_library(LogicLib STATIC ${LOGIC_LIBRARY_SOURCES}) +pa_apply_gui_free_target_properties(LogicLib) + +add_executable(SerialProgramsLogicTests ${LOGIC_TEST_SOURCES}) +pa_apply_gui_free_target_properties(SerialProgramsLogicTests) +target_link_libraries(SerialProgramsLogicTests PRIVATE LogicLib CoreLib) + +foreach(logic_target LogicLib SerialProgramsLogicTests) + if (MSVC) + target_compile_options(${logic_target} PRIVATE /W4 /WX /external:W0 /utf-8 /wd5054 /wd4505) + elseif(APPLE) + target_compile_options(${logic_target} PRIVATE -Wall -Wextra -Wpedantic -Werror -Wshorten-64-to-32) + else() + target_compile_options(${logic_target} PRIVATE -Wall -Wextra -Wpedantic -Werror -fno-strict-aliasing) + endif() +endforeach() diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index e490a213a7..ba5a65a0b8 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -1383,6 +1383,8 @@ file(GLOB LIBRARY_SOURCES Source/NintendoSwitch/Inference/NintendoSwitch_SelectedSettingDetector.h Source/NintendoSwitch/Inference/NintendoSwitch_StartGameUserSelectDetector.cpp Source/NintendoSwitch/Inference/NintendoSwitch_StartGameUserSelectDetector.h + Source/NintendoSwitch/Inference/NintendoSwitch_SystemKeyboardDetector.cpp + Source/NintendoSwitch/Inference/NintendoSwitch_SystemKeyboardDetector.h Source/NintendoSwitch/Inference/NintendoSwitch_UpdatePopupDetector.cpp Source/NintendoSwitch/Inference/NintendoSwitch_UpdatePopupDetector.h Source/NintendoSwitch/NintendoSwitch_ConsoleHandle.cpp @@ -1434,6 +1436,8 @@ file(GLOB LIBRARY_SOURCES Source/NintendoSwitch/Programs/FastCodeEntry/NintendoSwitch_KeyboardCodeEntry.h Source/NintendoSwitch/Programs/FastCodeEntry/NintendoSwitch_NumberCodeEntry.cpp Source/NintendoSwitch/Programs/FastCodeEntry/NintendoSwitch_NumberCodeEntry.h + Source/NintendoSwitch/Programs/FastCodeEntry/NintendoSwitch_SystemKeyboardTyping.cpp + Source/NintendoSwitch/Programs/FastCodeEntry/NintendoSwitch_SystemKeyboardTyping.h Source/NintendoSwitch/Programs/NintendoSwitch_FriendCodeAdder.cpp Source/NintendoSwitch/Programs/NintendoSwitch_FriendCodeAdder.h Source/NintendoSwitch/Programs/NintendoSwitch_FriendDelete.cpp @@ -3299,3 +3303,81 @@ file(GLOB LIBRARY_SOURCES Source/VideoGames/ZeldaTotK/ZeldaTotK_Settings.cpp Source/VideoGames/ZeldaTotK/ZeldaTotK_Settings.h ) + +# Logic tests (-DPA_CORE_ONLY=ON -DPA_LOGIC_TESTS=ON, see cmake/LogicTests.cmake): +# unit tests that build and run with no Qt, OpenCV, ONNX Runtime or Tesseract. +# A file joins these lists only when everything it includes is pure as well. +# These files stay in LIBRARY_SOURCES above too; the lists below only add a +# second, smaller target. + +# Pure sources the logic tests need beyond CORE_LIBRARY_SOURCES. +# The kernels are the portable *_Default versions: the logic target turns on no +# run-time ISA dispatch, so the SIMD versions are never called. +set(LOGIC_LIBRARY_SOURCES + ../Common/Cpp/Rectangle.tpp + Source/CommonFramework/ImageTools/FloatPixel.cpp + Source/CommonFramework/ImageTools/ImageBoxes.cpp + Source/CommonFramework/ImageTools/ImageDiff.cpp + Source/CommonFramework/ImageTools/ImageStats.cpp + Source/CommonFramework/ImageTypes/ImageHSV32.cpp + Source/CommonFramework/ImageTypes/ImageViewHSV32.cpp + Source/CommonFramework/VideoPipeline/VideoOverlay.cpp + Source/CommonFramework/VideoPipeline/VideoOverlayTypes.cpp + Source/CommonTools/Images/SolidColorTest.cpp + Source/CommonTools/ScreenEvents/ScreenEvents.cpp + Source/CommonTools/ScreenMachine/ScreenMachine.cpp + Source/Kernels/BinaryMatrix/Kernels_BinaryMatrix.cpp + Source/Kernels/BinaryMatrix/Kernels_BinaryMatrix_Core_64xH_Default.cpp + Source/Kernels/BinaryMatrix/Kernels_PackedBinaryMatrixCore.tpp + Source/Kernels/BinaryMatrix/Kernels_SparseBinaryMatrixCore.tpp + Source/Kernels/ImageScaleBrightness/Kernels_ImageScaleBrightness.cpp + Source/Kernels/ImageScaleBrightness/Kernels_ImageScaleBrightness_Default.cpp + Source/Kernels/ImageStats/Kernels_ImagePixelSumSqr.cpp + Source/Kernels/ImageStats/Kernels_ImagePixelSumSqr_Default.cpp + Source/Kernels/ImageStats/Kernels_ImagePixelSumSqr_TestInfra.cpp + Source/Kernels/ImageStats/Kernels_ImagePixelSumSqrDev.cpp + Source/Kernels/ImageStats/Kernels_ImagePixelSumSqrDev_Default.cpp + Source/Kernels/ImageStats/Kernels_ImagePixelSumSqrDev_TestInfra.cpp + Source/Pokemon/AutoStory/Data/Pokemon_AuthoredCheckpointJson.cpp + Source/Pokemon/AutoStory/Data/Pokemon_StoryFiles.cpp + Source/Pokemon/AutoStory/Data/Pokemon_StoryRowExecution.cpp + Source/Pokemon/AutoStory/Data/Pokemon_StoryStepJson.cpp + Source/Pokemon/AutoStory/Engine/Pokemon_ScreenObservation.cpp + Source/Pokemon/AutoStory/Engine/Pokemon_StoryActionRegistry.cpp + Source/Pokemon/AutoStory/Engine/Pokemon_StoryBackend.cpp + Source/Pokemon/AutoStory/Engine/Pokemon_StoryEngine.cpp + Source/Pokemon/AutoStory/Engine/Pokemon_StoryFakeBackend.cpp + Source/Pokemon/AutoStory/Engine/Pokemon_StorySavePolicy.cpp + Source/Pokemon/AutoStory/Engine/Pokemon_StoryStepRunner.cpp + Source/Pokemon/AutoStory/Engine/Pokemon_ZonePose.cpp + Source/Pokemon/AutoStory/Options/Pokemon_StoryRangeOptions.cpp + Source/Pokemon/AutoStory/Pokemon_CheckpointAttempts.cpp + Source/Pokemon/AutoStory/Pokemon_StoryEvents.cpp + Source/Pokemon/AutoStory/Pokemon_StoryLog.cpp + Source/Pokemon/AutoStory/Pokemon_StoryOutcome.cpp + Source/Pokemon/AutoStory/Pokemon_StoryPose.cpp + Source/Pokemon/AutoStory/Types/Pokemon_StoryActionArg.cpp + Source/Pokemon/AutoStory/Types/Pokemon_StoryActionSpec.cpp + Source/Pokemon/AutoStory/Types/Pokemon_StoryCheckpointMetadata.cpp + Source/Pokemon/AutoStory/Types/Pokemon_StoryStepKind.cpp +) + +# The logic test suites and their runner. Each suite here is also registered in +# make_logic_tests() (Source/Tests/LogicTests/LogicTests_Main.cpp). +set(LOGIC_TEST_SOURCES + Source/CommonTools/ScreenEvents/ScreenEvents_Tests.cpp + Source/CommonTools/ScreenMachine/ScreenMachine_Tests.cpp + Source/Pokemon/AutoStory/Data/Pokemon_AuthoredCheckpointJson_Tests.cpp + Source/Pokemon/AutoStory/Data/Pokemon_StoryFiles_Tests.cpp + Source/Pokemon/AutoStory/Data/Pokemon_StoryStepJson_Tests.cpp + Source/Pokemon/AutoStory/Engine/Pokemon_StoryBackend_Tests.cpp + Source/Pokemon/AutoStory/Engine/Pokemon_StoryEngine_Tests.cpp + Source/Pokemon/AutoStory/Engine/Pokemon_StorySavePolicy_Tests.cpp + Source/Pokemon/AutoStory/Options/Pokemon_StoryRangeOptions_Tests.cpp + Source/Pokemon/AutoStory/Pokemon_AutoStorySelect_Tests.cpp + Source/Pokemon/AutoStory/Pokemon_CheckpointAttempts_Tests.cpp + Source/Pokemon/AutoStory/Pokemon_StoryEvents_Tests.cpp + Source/Pokemon/AutoStory/Pokemon_StoryLog_Tests.cpp + Source/Pokemon/AutoStory/Types/Pokemon_StoryActionArg_Tests.cpp + Source/Tests/LogicTests/LogicTests_Main.cpp +) From 8cbab39ea9e985b847224c41997aaea1bd434974 Mon Sep 17 00:00:00 2001 From: dayfine Date: Wed, 18 Nov 2026 01:49:57 -0800 Subject: [PATCH 2/4] Logic tests: drop the keyboard files from SourceFiles.cmake They left autostory/shared-core; the move commit picked their entries up again. --- SerialPrograms/cmake/SourceFiles.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index ba5a65a0b8..4d128e787d 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -1383,8 +1383,6 @@ file(GLOB LIBRARY_SOURCES Source/NintendoSwitch/Inference/NintendoSwitch_SelectedSettingDetector.h Source/NintendoSwitch/Inference/NintendoSwitch_StartGameUserSelectDetector.cpp Source/NintendoSwitch/Inference/NintendoSwitch_StartGameUserSelectDetector.h - Source/NintendoSwitch/Inference/NintendoSwitch_SystemKeyboardDetector.cpp - Source/NintendoSwitch/Inference/NintendoSwitch_SystemKeyboardDetector.h Source/NintendoSwitch/Inference/NintendoSwitch_UpdatePopupDetector.cpp Source/NintendoSwitch/Inference/NintendoSwitch_UpdatePopupDetector.h Source/NintendoSwitch/NintendoSwitch_ConsoleHandle.cpp @@ -1436,8 +1434,6 @@ file(GLOB LIBRARY_SOURCES Source/NintendoSwitch/Programs/FastCodeEntry/NintendoSwitch_KeyboardCodeEntry.h Source/NintendoSwitch/Programs/FastCodeEntry/NintendoSwitch_NumberCodeEntry.cpp Source/NintendoSwitch/Programs/FastCodeEntry/NintendoSwitch_NumberCodeEntry.h - Source/NintendoSwitch/Programs/FastCodeEntry/NintendoSwitch_SystemKeyboardTyping.cpp - Source/NintendoSwitch/Programs/FastCodeEntry/NintendoSwitch_SystemKeyboardTyping.h Source/NintendoSwitch/Programs/NintendoSwitch_FriendCodeAdder.cpp Source/NintendoSwitch/Programs/NintendoSwitch_FriendCodeAdder.h Source/NintendoSwitch/Programs/NintendoSwitch_FriendDelete.cpp From 1979fa6f370ca52b538ddf687e7fc92d3094d5a3 Mon Sep 17 00:00:00 2001 From: dayfine Date: Thu, 19 Nov 2026 00:43:57 -0800 Subject: [PATCH 3/4] Logic tests: lists follow #648's file set (StoryCheckpointJson, Testing/StoryFakeBackend; deleted files dropped) --- SerialPrograms/cmake/SourceFiles.cmake | 28 +++----------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index 34de5cbb7a..a70215f423 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -934,6 +934,7 @@ file(GLOB LIBRARY_SOURCES Source/CommonTools/ScreenMachine/ScreenMachine.cpp Source/CommonTools/ScreenMachine/ScreenMachine.h Source/CommonTools/ScreenMachine/ScreenMachine_Tests.cpp + Source/Pokemon/AutoStory/Data/Pokemon_StoryCheckpointJson_Tests.cpp Source/CommonTools/ScreenMachine/ScreenMachine_Tests.h Source/CommonTools/ScreenMachine/ScreenObservation.h Source/CommonTools/StartupChecks/StartProgramChecks.cpp @@ -1246,6 +1247,7 @@ file(GLOB LIBRARY_SOURCES Source/Kernels/ImageStats/Kernels_ImagePixelSumSqrDev.h Source/Kernels/ImageStats/Kernels_ImagePixelSumSqrDev_Default.cpp Source/Kernels/ImageStats/Kernels_ImagePixelSumSqrDev_TestInfra.cpp + Source/Pokemon/AutoStory/Data/Pokemon_StoryCheckpointJson.cpp Source/Kernels/ImageStats/Kernels_ImagePixelSumSqrDev_TestInfra.h Source/Kernels/ImageStats/Kernels_ImagePixelSumSqrDev_x64_AVX2.cpp Source/Kernels/ImageStats/Kernels_ImagePixelSumSqrDev_x64_AVX512.cpp @@ -1528,6 +1530,7 @@ file(GLOB LIBRARY_SOURCES Source/Pokemon/AutoStory/Engine/Pokemon_StoryGame.h Source/Pokemon/AutoStory/Pokemon_StoryFailure.h Source/Pokemon/AutoStory/Pokemon_StoryLog.cpp + Source/Pokemon/AutoStory/Testing/Pokemon_StoryFakeBackend.cpp Source/Pokemon/AutoStory/Pokemon_StoryLog.h Source/Pokemon/AutoStory/Pokemon_StoryLog_Tests.cpp Source/Pokemon/AutoStory/Pokemon_StoryLog_Tests.h @@ -3292,28 +3295,10 @@ set(LOGIC_LIBRARY_SOURCES Source/Kernels/ImageStats/Kernels_ImagePixelSumSqrDev.cpp Source/Kernels/ImageStats/Kernels_ImagePixelSumSqrDev_Default.cpp Source/Kernels/ImageStats/Kernels_ImagePixelSumSqrDev_TestInfra.cpp - Source/Pokemon/AutoStory/Data/Pokemon_AuthoredCheckpointJson.cpp - Source/Pokemon/AutoStory/Data/Pokemon_StoryFiles.cpp - Source/Pokemon/AutoStory/Data/Pokemon_StoryRowExecution.cpp - Source/Pokemon/AutoStory/Data/Pokemon_StoryStepJson.cpp Source/Pokemon/AutoStory/Engine/Pokemon_ScreenObservation.cpp - Source/Pokemon/AutoStory/Engine/Pokemon_StoryActionRegistry.cpp - Source/Pokemon/AutoStory/Engine/Pokemon_StoryBackend.cpp Source/Pokemon/AutoStory/Engine/Pokemon_StoryEngine.cpp - Source/Pokemon/AutoStory/Engine/Pokemon_StoryFakeBackend.cpp - Source/Pokemon/AutoStory/Engine/Pokemon_StorySavePolicy.cpp - Source/Pokemon/AutoStory/Engine/Pokemon_StoryStepRunner.cpp - Source/Pokemon/AutoStory/Engine/Pokemon_ZonePose.cpp Source/Pokemon/AutoStory/Options/Pokemon_StoryRangeOptions.cpp - Source/Pokemon/AutoStory/Pokemon_CheckpointAttempts.cpp - Source/Pokemon/AutoStory/Pokemon_StoryEvents.cpp Source/Pokemon/AutoStory/Pokemon_StoryLog.cpp - Source/Pokemon/AutoStory/Pokemon_StoryOutcome.cpp - Source/Pokemon/AutoStory/Pokemon_StoryPose.cpp - Source/Pokemon/AutoStory/Types/Pokemon_StoryActionArg.cpp - Source/Pokemon/AutoStory/Types/Pokemon_StoryActionSpec.cpp - Source/Pokemon/AutoStory/Types/Pokemon_StoryCheckpointMetadata.cpp - Source/Pokemon/AutoStory/Types/Pokemon_StoryStepKind.cpp ) # The logic test suites and their runner. Each suite here is also registered in @@ -3321,17 +3306,10 @@ set(LOGIC_LIBRARY_SOURCES set(LOGIC_TEST_SOURCES Source/CommonTools/ScreenEvents/ScreenEvents_Tests.cpp Source/CommonTools/ScreenMachine/ScreenMachine_Tests.cpp - Source/Pokemon/AutoStory/Data/Pokemon_AuthoredCheckpointJson_Tests.cpp - Source/Pokemon/AutoStory/Data/Pokemon_StoryFiles_Tests.cpp - Source/Pokemon/AutoStory/Data/Pokemon_StoryStepJson_Tests.cpp Source/Pokemon/AutoStory/Engine/Pokemon_StoryBackend_Tests.cpp Source/Pokemon/AutoStory/Engine/Pokemon_StoryEngine_Tests.cpp - Source/Pokemon/AutoStory/Engine/Pokemon_StorySavePolicy_Tests.cpp Source/Pokemon/AutoStory/Options/Pokemon_StoryRangeOptions_Tests.cpp Source/Pokemon/AutoStory/Pokemon_AutoStorySelect_Tests.cpp - Source/Pokemon/AutoStory/Pokemon_CheckpointAttempts_Tests.cpp - Source/Pokemon/AutoStory/Pokemon_StoryEvents_Tests.cpp Source/Pokemon/AutoStory/Pokemon_StoryLog_Tests.cpp - Source/Pokemon/AutoStory/Types/Pokemon_StoryActionArg_Tests.cpp Source/Tests/LogicTests/LogicTests_Main.cpp ) From f1f2207724c38811415008dade5c46753c9f963c Mon Sep 17 00:00:00 2001 From: dayfine Date: Thu, 19 Nov 2026 00:48:24 -0800 Subject: [PATCH 4/4] Logic tests: the checkpoint reader, its tests and the fake backend go in the logic lists, not the main list --- SerialPrograms/cmake/SourceFiles.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index a70215f423..c28d0afa0d 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -934,7 +934,6 @@ file(GLOB LIBRARY_SOURCES Source/CommonTools/ScreenMachine/ScreenMachine.cpp Source/CommonTools/ScreenMachine/ScreenMachine.h Source/CommonTools/ScreenMachine/ScreenMachine_Tests.cpp - Source/Pokemon/AutoStory/Data/Pokemon_StoryCheckpointJson_Tests.cpp Source/CommonTools/ScreenMachine/ScreenMachine_Tests.h Source/CommonTools/ScreenMachine/ScreenObservation.h Source/CommonTools/StartupChecks/StartProgramChecks.cpp @@ -1247,7 +1246,6 @@ file(GLOB LIBRARY_SOURCES Source/Kernels/ImageStats/Kernels_ImagePixelSumSqrDev.h Source/Kernels/ImageStats/Kernels_ImagePixelSumSqrDev_Default.cpp Source/Kernels/ImageStats/Kernels_ImagePixelSumSqrDev_TestInfra.cpp - Source/Pokemon/AutoStory/Data/Pokemon_StoryCheckpointJson.cpp Source/Kernels/ImageStats/Kernels_ImagePixelSumSqrDev_TestInfra.h Source/Kernels/ImageStats/Kernels_ImagePixelSumSqrDev_x64_AVX2.cpp Source/Kernels/ImageStats/Kernels_ImagePixelSumSqrDev_x64_AVX512.cpp @@ -1530,7 +1528,6 @@ file(GLOB LIBRARY_SOURCES Source/Pokemon/AutoStory/Engine/Pokemon_StoryGame.h Source/Pokemon/AutoStory/Pokemon_StoryFailure.h Source/Pokemon/AutoStory/Pokemon_StoryLog.cpp - Source/Pokemon/AutoStory/Testing/Pokemon_StoryFakeBackend.cpp Source/Pokemon/AutoStory/Pokemon_StoryLog.h Source/Pokemon/AutoStory/Pokemon_StoryLog_Tests.cpp Source/Pokemon/AutoStory/Pokemon_StoryLog_Tests.h @@ -3295,10 +3292,12 @@ set(LOGIC_LIBRARY_SOURCES Source/Kernels/ImageStats/Kernels_ImagePixelSumSqrDev.cpp Source/Kernels/ImageStats/Kernels_ImagePixelSumSqrDev_Default.cpp Source/Kernels/ImageStats/Kernels_ImagePixelSumSqrDev_TestInfra.cpp + Source/Pokemon/AutoStory/Data/Pokemon_StoryCheckpointJson.cpp Source/Pokemon/AutoStory/Engine/Pokemon_ScreenObservation.cpp Source/Pokemon/AutoStory/Engine/Pokemon_StoryEngine.cpp Source/Pokemon/AutoStory/Options/Pokemon_StoryRangeOptions.cpp Source/Pokemon/AutoStory/Pokemon_StoryLog.cpp + Source/Pokemon/AutoStory/Testing/Pokemon_StoryFakeBackend.cpp ) # The logic test suites and their runner. Each suite here is also registered in @@ -3306,6 +3305,7 @@ set(LOGIC_LIBRARY_SOURCES set(LOGIC_TEST_SOURCES Source/CommonTools/ScreenEvents/ScreenEvents_Tests.cpp Source/CommonTools/ScreenMachine/ScreenMachine_Tests.cpp + Source/Pokemon/AutoStory/Data/Pokemon_StoryCheckpointJson_Tests.cpp Source/Pokemon/AutoStory/Engine/Pokemon_StoryBackend_Tests.cpp Source/Pokemon/AutoStory/Engine/Pokemon_StoryEngine_Tests.cpp Source/Pokemon/AutoStory/Options/Pokemon_StoryRangeOptions_Tests.cpp