Files
pdf/engine/tests/CMakeLists.txt
T
2026-06-16 19:06:48 +05:30

52 lines
1.4 KiB
CMake

# Engine test suite. Phase 0: a single smoke test that backs Gate G0.
add_executable(pdfengine_smoke
smoke_test.cpp
fonts_test.cpp
graphics_state_test.cpp
display_list_test.cpp
document_test.cpp
skia_renderer_test.cpp
lexer_test.cpp
parser_test.cpp
content_builder_test.cpp
ast_serializer_test.cpp
content_serializer_test.cpp
qpdf_writer_test.cpp
)
if(PDFENGINE_WITH_QPDF)
target_sources(pdfengine_smoke PRIVATE qpdf_extractor_test.cpp)
endif()
target_link_libraries(pdfengine_smoke
PRIVATE
pdfengine::pdfengine
GTest::gtest
GTest::gtest_main
)
if(PDFENGINE_WITH_SKIA)
target_link_libraries(pdfengine_smoke PRIVATE skia::skia)
endif()
if(MSVC)
target_link_options(pdfengine_smoke PRIVATE "/FORCE:MULTIPLE")
endif()
target_include_directories(pdfengine_smoke
PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/../src"
)
# Locate and normalize corpus path
set(TEST_CORPUS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../corpus" CACHE PATH "Path to test corpus")
file(TO_CMAKE_PATH "${TEST_CORPUS_DIR}" TEST_CORPUS_DIR_NORM)
target_compile_definitions(pdfengine_smoke PRIVATE TEST_CORPUS_DIR="${TEST_CORPUS_DIR_NORM}")
pdfengine_set_warnings(pdfengine_smoke)
pdfengine_enable_sanitizers(pdfengine_smoke)
# Registers each TEST() with CTest so `ctest --preset ...` runs them.
gtest_discover_tests(pdfengine_smoke)