Files
pdf/engine/tests/smoke_test.cpp
T

28 lines
1.0 KiB
C++
Raw Normal View History

2026-05-15 10:39:16 +05:30
// Phase 0 smoke test: proves the engine library compiles, links against its
// vcpkg dependencies, and is callable. This is what Gate G0 ("infrastructure
// compiles on all platforms") checks in CI.
#include <gtest/gtest.h>
#include <pdfengine/pdf_engine.hpp>
#include <string_view>
TEST(EngineSmoke, VersionIsReported) {
EXPECT_FALSE(pdfengine::engineVersion().empty());
EXPECT_EQ(pdfengine::engineVersion(), pdfengine::version_string);
}
TEST(EngineSmoke, BuildInfoMentionsVersion) {
const std::string_view info = pdfengine::engineBuildInfo();
EXPECT_NE(info.find(pdfengine::version_string), std::string_view::npos);
}
TEST(EngineSmoke, BuildInfoConsistentWithPdfiumLinkage) {
const std::string_view info = pdfengine::engineBuildInfo();
const bool says_on = info.find("pdfium=on") != std::string_view::npos;
EXPECT_EQ(says_on, pdfengine::engineHasPdfium());
}
TEST(EngineSmoke, LogBuildInfoDoesNotThrow) {
// Exercises the spdlog dependency end to end (compile + link + call).
EXPECT_NO_THROW(pdfengine::engineLogBuildInfo());
}