Enable doctrenderer (V8) gtest suites under CTest#104
Open
juliusknorr wants to merge 2 commits into
Open
Conversation
c2d9edf to
2828d5d
Compare
Migrate the three doctrenderer GoogleTest suites from qmake .pro files to CMake targets registered with CTest: - DesktopEditor/doctrenderer/test/json (JSON_GOOGLE_TEST) - DesktopEditor/doctrenderer/test/js_internal (JS_INTERNAL_GOOGLE_TEST) - DesktopEditor/doctrenderer/test/embed/internal/hash Each suite links the existing doctrenderer shared library (guard-added via add_subdirectory) and builds through the add_core_gtest() helper. json and js_internal compile out their own main() under their *_GOOGLE_TEST define, and hash has none, so all three use GTEST_MAIN. Per-suite compile definitions and include dirs mirror the .pro DEFINES/INCLUDEPATH; on Linux the unresolved- symbols link flag and -ldl are reproduced. The suites instantiate CJSContext (V8). The V8 monolith built in CI is self- contained at run time (v8_use_external_startup_data=false, embedded snapshot; v8_enable_i18n_support=false, no external icudtl.dat), and all test JS is built inline via runScript with no fixtures, so the suites run headless in CI without extra provisioning. Registered in the top-level CMakeLists EO_BUILD_TESTS block and documented in TESTING.md. Signed-off-by: Julius Knorr <jus@bitgrid.net> Assisted-by: Claude Code:Opus 4.8
Two test sources failed to compile in the Linux CI build: - json/main.cpp referenced the NSJSON::ImageFormat enumerators (ifBGRA, ifRGBA, ifARGB, ifInvalid) unqualified, but ImageFormat is an `enum class`. Add in-scope constexpr aliases so the image tests compile. - embed/internal/hash/main.cpp used std::setw/std::setfill without including <iomanip>. Add the include. Signed-off-by: Julius Knorr <jus@bitgrid.net> Assisted-by: Claude Code:Opus 4.8
2828d5d to
78771ee
Compare
DmySyz
approved these changes
Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the three
doctrendererGoogleTest suites from legacy qmake.profiles to CMake targets registered with CTest, in one PR. Each gets aCMakeLists.txtmodeled on the existingTestSMConverterreference and the sharedadd_core_gtest()helper.main()?GTEST_MAINtest/jsondoctrenderer_json_testJSON_GOOGLE_TESTtest/js_internaldoctrenderer_jsinternal_testJS_INTERNAL_GOOGLE_TESTtest/embed/internal/hashdoctrenderer_hash_testFor
jsonandjs_internal,main.cppguards itsint main()behind#ifndef <SUITE>_GOOGLE_TEST— so with the define active there is no ownmain(), henceGTEST_MAIN. Thehashsuite has nomain()and no google-test define, so it also usesGTEST_MAIN.Each suite:
doctrenderershared library viaif(NOT TARGET doctrenderer) add_subdirectory(...) endif();.proINCLUDEPATH(DesktopEditor/doctrenderer) viatarget_include_directories;DEFINESviatarget_compile_definitions;-Wl,-unresolved-symbols=ignore-in-shared-libsand-ldlviatarget_link_options/target_link_libraries.All three are registered in the top-level
CMakeLists.txtif(EO_BUILD_TESTS)block, andTESTING.mdis updated (the three entries moved to Done with a V8-runtime note).V8 runtime decision: registered normally (CI-gated)
These suites instantiate
CJSContext(a V8 isolate) at test time, so they need a working V8 runtime. I investigated whether that is reliably satisfiable in CI and concluded yes, so theadd_subdirectorylines are registered normally (not commented out):common.cmakebuilds the V8 monolith viabuild_3rdparty.pyand populatesV8_INSTALL_DIR; CI configures with-DVCPKG_MANIFEST_FEATURES=tests -DEO_BUILD_TESTS=ONand builds beforectest.Common/3dParty/v8/.../nc-build.sh) setsv8_use_external_startup_data=false(startup snapshot is linked into the monolith, no externalsnapshot_blob.bin) andv8_enable_i18n_support=false(no externalicudtl.dat). SoCJSContextinitializes with no external V8 runtime data files staged next to the binary.doctrenderershared library is already built in CI (thedocbuilderapp links it), so no new library provisioning is required.runScript(...)and load no embedded-script or fixture files.Build / verify note
cmake + ninja are present locally but there is no vcpkg toolchain (
VCPKG_ROOTunset), so a full local build is not possible and I did not bootstrap vcpkg. The CMake wiring mirrors the provenTestSMConverter/TestEQNtoOOXMLreferences; the PR's CI (configure with thetestsfeature +EO_BUILD_TESTS=ON, build,ctest --output-on-failure) is the gate.Residual uncertainty
The V8 self-containment conclusion is read from the build flags rather than observed at runtime locally. If CI surfaces an unexpected external-data dependency, the fix would be to stage that data next to the test binaries (or point
WORKING_DIRECTORY), not to change the test wiring.https://claude.ai/code/session_01TJrhgZT4PwYaBKWiUCXmGg
Generated by Claude Code