add_library(pp_test_harness INTERFACE)
target_include_directories(pp_test_harness INTERFACE
    "${CMAKE_CURRENT_SOURCE_DIR}")
target_link_libraries(pp_test_harness INTERFACE
    pp_project_options
    pp_project_warnings)

add_executable(pp_foundation_binary_stream_tests
    foundation/binary_stream_tests.cpp
)
target_link_libraries(pp_foundation_binary_stream_tests PRIVATE
    pp_foundation
    pp_test_harness)

add_test(NAME pp_foundation_binary_stream_tests COMMAND pp_foundation_binary_stream_tests)
set_tests_properties(pp_foundation_binary_stream_tests PROPERTIES
    LABELS "foundation;desktop-fast")

add_executable(pp_foundation_parse_tests
    foundation/parse_tests.cpp)
target_link_libraries(pp_foundation_parse_tests PRIVATE
    pp_foundation
    pp_test_harness)

add_test(NAME pp_foundation_parse_tests COMMAND pp_foundation_parse_tests)
set_tests_properties(pp_foundation_parse_tests PROPERTIES
    LABELS "foundation;desktop-fast")

add_executable(pp_foundation_trace_tests
    foundation/trace_tests.cpp)
target_link_libraries(pp_foundation_trace_tests PRIVATE
    pp_foundation
    pp_test_harness)

add_test(NAME pp_foundation_trace_tests COMMAND pp_foundation_trace_tests)
set_tests_properties(pp_foundation_trace_tests PROPERTIES
    LABELS "foundation;desktop-fast")

add_executable(pp_assets_image_format_tests
    assets/image_format_tests.cpp)
target_link_libraries(pp_assets_image_format_tests PRIVATE
    pp_assets
    pp_test_harness)

add_test(NAME pp_assets_image_format_tests COMMAND pp_assets_image_format_tests)
set_tests_properties(pp_assets_image_format_tests PROPERTIES
    LABELS "assets;desktop-fast")

if(TARGET pano_cli)
    add_test(NAME pano_cli_create_document_smoke
        COMMAND pano_cli create-document --width 64 --height 32 --layers 2)
    set_tests_properties(pano_cli_create_document_smoke PROPERTIES
        LABELS "integration;desktop-fast")

    add_test(NAME pano_cli_inspect_image_rejects_unsupported
        COMMAND pano_cli inspect-image --path "${CMAKE_CURRENT_SOURCE_DIR}/data/images/unsupported-image.txt")
    set_tests_properties(pano_cli_inspect_image_rejects_unsupported PROPERTIES
        LABELS "assets;integration;desktop-fast"
        WILL_FAIL TRUE)
endif()
