"""
Configuration for FastLED test suite.

This module contains all configuration data for test discovery, naming,
and categorization. Separating configuration from build logic makes it
easier to maintain and modify test organization.
"""

from pathlib import Path


# ============================================================================
# Test Discovery Configuration
# ============================================================================

# Root directory for test files
TESTS_DIR: Path = Path(__file__).parent.resolve()

# Files to exclude from test discovery (special tests with custom build rules)
# Includes infrastructure files like test runner and doctest main
EXCLUDED_TEST_FILES: set[Path] = {
    TESTS_DIR / "doctest_main.cpp",
    TESTS_DIR
    / "misc"
    / "coroutine_impl.cpp",  # Compiled into test_shared_objs, not a test
    TESTS_DIR
    / "fx"
    / "profile_chasing_spirals.cpp",  # Standalone profiling binary, not a test
    TESTS_DIR
    / "fl"
    / "remote"
    / "transport"
    / "http"
    / "test_utils"
    / "server_thread.cpp.hpp",  # Utility class, not a test (included by loopback.cpp)
    # Grouped into sibling test files via #include
    TESTS_DIR / "fl" / "grid.cpp",  # → geometry.cpp
    TESTS_DIR / "fl" / "tile2x2.cpp",  # → geometry.cpp
    TESTS_DIR / "fl" / "traverse_grid.cpp",  # → geometry.cpp
    TESTS_DIR / "fl" / "sin32.cpp",  # → trig8.cpp
    TESTS_DIR / "fl" / "time_alpha.cpp",  # → timeout.cpp
    TESTS_DIR / "fl" / "assume_aligned.cpp",  # → align.cpp
    TESTS_DIR / "fl" / "map_range.cpp",  # → clamp.cpp
    TESTS_DIR / "fl" / "unordered_map_lru.cpp",  # → hash.cpp
    TESTS_DIR / "fl" / "insert_result.cpp",  # → hash.cpp
    TESTS_DIR / "fl" / "alloca.cpp",  # → memory.cpp
    TESTS_DIR / "fl" / "numeric_limits.cpp",  # → types.cpp
    TESTS_DIR / "fl" / "trace.cpp",  # → log.cpp
    TESTS_DIR / "fl" / "eorder.cpp",  # → hsv16.cpp
    TESTS_DIR / "fl" / "xymap.cpp",  # → screenmap.cpp
    TESTS_DIR / "fl" / "splat.cpp",  # → downscale.cpp
}

# Directories to exclude from recursive test discovery.
# Infrastructure dirs (contain build helpers, not tests):
#   shared   — runner.exe, crash_handler_main.cpp
#   testing  — sketch_runner.cpp, stub_led_capture.cpp
#   data     — test data files (codecs, etc.)
#   manual   — manual-only tests
#   profile  — standalone profiling binaries with malloc/free overrides (not unit tests)
# Build artifact dirs (generated by build tools):
#   build, builddir, x64, bin — CMake/MSVC/binary output
#   example_compile_direct, fastled_js — generated wrappers / WASM output
# Note: directories starting with '.' are auto-excluded (see discover_tests.py)
EXCLUDED_TEST_DIRS: set[Path] = {
    TESTS_DIR / "shared",
    TESTS_DIR / "testing",
    TESTS_DIR / "data",
    TESTS_DIR / "manual",
    TESTS_DIR / "profile",  # CRITICAL: Contains malloc/free overrides, must be excluded
    TESTS_DIR / "build",
    TESTS_DIR / "builddir",
    TESTS_DIR / "x64",
    TESTS_DIR / "bin",
    TESTS_DIR / "example_compile_direct",
    TESTS_DIR / "fastled_js",
    # Consolidated test directories (individual files included via parent .cpp)
    TESTS_DIR / "fl" / "chipsets" / "encoders",
    TESTS_DIR / "fl" / "log",
    # NOTE: tests/fl/audio/detector/ is NOT excluded — it contains standalone .cpp test files
    # The old entry "detectors" (with 's') was a typo for a non-existent directory
    TESTS_DIR / "fl" / "channels" / "detail" / "validation",
    TESTS_DIR / "fl" / "remote" / "rpc",
    TESTS_DIR / "fl" / "codec",
    TESTS_DIR / "fl" / "fx" / "2d",
    # Standalone PIO project fixture (driven by ci/tests/test_fbuild_qemu.py),
    # NOT a host unit test. Its src/main.cpp includes <Arduino.h> which the
    # native test compiler can't resolve. Renamed from main.ino to main.cpp
    # to satisfy arduino-lint LD003 (see FastLED #2593); that rename made
    # meson's test discovery pick it up, breaking linux_native. Excluding
    # keeps both side-effects happy.
    TESTS_DIR / "fbuild_qemu_smoke",
}
