# Unit tests for the SDK-independent core (fgc_core). No Vimba X / Paho needed, # so these run anywhere - including CI with -DWITH_VIMBA=OFF -DWITH_MQTT=OFF. include(FetchContent) # doctest from the official upstream, pinned. For maximum integrity pin to a # commit SHA or add URL_HASH of a release tarball. set(DOCTEST_TAG "v2.4.11" CACHE STRING "doctest git tag/commit") FetchContent_Declare(doctest GIT_REPOSITORY https://github.com/doctest/doctest.git GIT_TAG ${DOCTEST_TAG} GIT_SHALLOW TRUE ) # doctest's bundled CMakeLists uses a cmake_minimum_required below CMake 4's # floor; allow it to configure under modern CMake. set(CMAKE_POLICY_VERSION_MINIMUM 3.5) FetchContent_MakeAvailable(doctest) unset(CMAKE_POLICY_VERSION_MINIMUM) add_executable(fgc_tests doctest_main.cpp test_paths.cpp test_singleinstance.cpp test_config.cpp test_iniedit.cpp test_camerastall.cpp test_remotecommands.cpp test_mcuenv.cpp test_operatingmode.cpp test_tmccurrent.cpp test_hardwarepresence.cpp test_hardwarechecks.cpp test_filelogsink.cpp test_axisspeed.cpp test_firmwareconfig.cpp test_cameraprofile.cpp test_camerasettingsxml.cpp test_hash.cpp test_channelhistory.cpp test_telemetry.cpp test_command.cpp test_scheduler.cpp test_logger.cpp test_geometry.cpp test_scangrid.cpp test_uisnapshot.cpp test_scroll.cpp test_mtiprotocol.cpp test_imumount.cpp test_sht41.cpp test_dumpparser.cpp test_helptext.cpp test_diagparser.cpp test_calibration.cpp test_headingfit.cpp test_pitchsetup.cpp test_testreport.cpp test_hostmetrics.cpp test_testrunner.cpp test_rawimage.cpp test_thermalstats.cpp test_composite.cpp test_tariscamerasource.cpp test_settlerule.cpp test_thermalguard.cpp ) target_link_libraries(fgc_tests PRIVATE fgc_core doctest::doctest) # So a test can read the shipped config/config.example.ini and hold it to what # the docs promise a new tower gets. target_compile_definitions(fgc_tests PRIVATE FGC_SOURCE_DIR="${PROJECT_SOURCE_DIR}") include(${doctest_SOURCE_DIR}/scripts/cmake/doctest.cmake) doctest_discover_tests(fgc_tests) # Image tests: the JPEG XL encoder and the frame-to-image pipeline, which need # OpenCV and libjxl (fgc_imaging) - still no camera SDK. add_executable(fgc_imaging_tests doctest_main.cpp test_jpegxl.cpp test_imagepipeline.cpp ) target_link_libraries(fgc_imaging_tests PRIVATE fgc_imaging doctest::doctest) doctest_discover_tests(fgc_imaging_tests)