You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by pe...@apache.org on 2026/08/14 05:24:51 UTC
(openoffice) 08/31: test(writerfilter): wire the doctok GoogleTest suite
This is an automated email from the ASF dual-hosted git repository.
leginee pushed a commit to branch bazel-migration
in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit ab5a8f2650eb117b51d544a8271b579898942048
Author: Peter Kovacs <pe...@apache.org>
AuthorDate: Sun Aug 2 00:45:59 2026 +0200
test(writerfilter): wire the doctok GoogleTest suite
//main/writerfilter:writerfilter_qa_doctok, porting
GoogleTest_writerfilter_doctok.mk. The qa/cppunittests directory name is a
misnomer: this suite is GoogleTest. Its four siblings (odiapi, qname, sl, xxml)
are the ones still on the retired testshl harness and are not migratable.
Bootstraps UNO in-process (defaultBootstrap_InitialComponentContext + the UCB
ContentBroker), so it takes uno_install.
RED, deliberately: testInitUno passes — 815ms of real UNO bootstrap, which is
useful coverage of the fixture itself — but testOpenFile and testEvents read
"<cwd>/test.doc" and no test.doc exists anywhere in the tree; the sample was
never checked in (the qa dir holds only the .cxx and doctok.job). testEvents
then trips a shared_ptr assert on the resulting null document. That is the
suite's own missing fixture, not a build problem, so it is wired rather than
withheld.
Also records in CLAUDE.md what each remaining suite actually needs, so the next
pass does not have to re-derive it: configmgr/qa/unit wants its own mini
installation plus a unit.rdb built with //main/cpputools:regcomp and a
CONFIGMGR_UNIT_FORWARD_STRING env var (which means gtest_test needs to accept a
custom ure_bootstrap root and extra env, not just uno_install);
cppuhelper/qa/propertysetmixin needs a UNO component DLL + its own types.idl and
services.rdb; xmlsecurity/qa/certext uses test::OfficeConnection; the sal
child-process suites need the `companions` hook.
Co-Authored-By: Claude Opus 5 <no...@anthropic.com>
---
CLAUDE.md | 22 +++++++++++++-------
main/test/readme.md | 9 ++++++++
main/writerfilter/BUILD.bazel | 48 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 72 insertions(+), 7 deletions(-)
diff --git a/CLAUDE.md b/CLAUDE.md
index a913554291..7b9f7c5d39 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -96,13 +96,21 @@ test 🔨 C++ unit-test infra runnable — NOW THE FRONT-LINE TASK: br
sfx2_qa_metadatable, desktop_qa_dp_version. uno_install doubles as
"give me the whole office DLL closure on PATH", which beats
enumerating dozens of transitive DLLs for sw/sfx-sized libraries.
- STILL TODO in this sweep: configmgr/qa/unit (builds its OWN mini
- installation — urebootstrap.ini + data.xcd + generated inis — so it
- needs a genrule, not //main/staging:install), cppuhelper/qa/
- propertysetmixin (UNO component DLL + own types.idl + services.rdb),
- xmlsecurity/qa/certext + sal child-process suites (osl/process,
- rtl/bootstrap, rtl/process) which need OfficeConnection / companion
- staging, and writerfilter doctok.
+ writerfilter_qa_doctok wired too (RED on its own missing fixture:
+ reads <cwd>/test.doc, never checked in; testInitUno passes).
+ STILL TODO, with what each actually needs:
+ • configmgr/qa/unit — its OWN mini installation (urebootstrap.ini +
+ data.xcd + 2 generated inis) plus unit.rdb = types.rdb with
+ configmgr.uno registered via //main/cpputools:regcomp (that tool
+ IS built), and env CONFIGMGR_UNIT_FORWARD_STRING=<unit.rdb>.
+ Needs gtest_test to accept a CUSTOM ure_bootstrap root + extra
+ env, not just uno_install=//main/staging:install.
+ • cppuhelper/qa/propertysetmixin — UNO component DLL + own
+ types.idl + a per-test services.rdb (packcomponents.xslt).
+ • xmlsecurity/qa/certext — uses test::OfficeConnection ⇒ fixture (b).
+ • sal child-process suites (osl/process, rtl/bootstrap,
+ rtl/process) — helper exe via getExecutablePath()+"/../bin";
+ gtest_test's `companions` hook exists for this.
testtools ⬜ (bridgetest — pure-C++ UNO bridge round-trip; cli/pyuno/java variants
need rules_java — see Java bucket)
qadevOOo 🔨 OOoRunner.jar built (//main/qadevOOo:OOoRunner — qadevOOo QA
diff --git a/main/test/readme.md b/main/test/readme.md
index 6ca14e2658..92ff1fda42 100644
--- a/main/test/readme.md
+++ b/main/test/readme.md
@@ -259,6 +259,15 @@ near-total failure to a small residual set — none of it a build problem:
- **DNS/host dependent.** `getHostname_001`, `getSocketAddrHandle_002`,
`getLocalPort_002` resolve names against whatever network the machine is on.
+### Red on their own fixture, wired anyway
+
+- `//main/writerfilter:writerfilter_qa_doctok` — `testInitUno` passes (a real
+ in-process UNO bootstrap + UCB ContentBroker), but `testOpenFile` /
+ `testEvents` read `<cwd>/test.doc` and **no `test.doc` exists anywhere in the
+ tree** — the sample was never checked in (the qa dir holds only the `.cxx` and
+ `doctok.job`). `testEvents` then trips a `shared_ptr` assert on the null
+ document. That is the suite's own missing fixture, not the build.
+
Earlier revisions of this file listed `rtl_str`/`rtl_ustr`/`rtl_string` as
NULL-deref crashes; those were since fixed (boundary checks in the tests plus
`NULL` guards at the rtl entry points) and now pass.
diff --git a/main/writerfilter/BUILD.bazel b/main/writerfilter/BUILD.bazel
index 20a6ca71da..1d286fede3 100644
--- a/main/writerfilter/BUILD.bazel
+++ b/main/writerfilter/BUILD.bazel
@@ -2,6 +2,7 @@ package(default_visibility = ["//visibility:public"])
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
load(":ooxml_ns_rules.bzl", "OOXML_NS", "ooxml_ns_factory_rules")
+load("//build/rules:gtest_test.bzl", "gtest_test")
# ── Constants ────────────────────────────────────────────────────────────────
@@ -516,3 +517,50 @@ cc_binary(
exports_files(glob(["**/*.component"]))
+
+# ── qa unit test ──────────────────────────────────────────────────
+# doctok WW8Document event walk (qa/cppunittests/doctok). Ports
+# GoogleTest_writerfilter_doctok.mk (writerfilter ucbhelper cppuhelper cppu sal
+# stl). The directory name "cppunittests" is a misnomer — this suite is
+# GoogleTest; its four siblings (odiapi/qname/sl/xxml) are the ones still on the
+# retired testshl harness and are NOT migratable.
+#
+# Bootstraps UNO in-process (defaultBootstrap_InitialComponentContext + the UCB
+# ContentBroker), hence uno_install.
+#
+# EXPECTED RED: testOpenFile/testEvents read "<cwd>/test.doc", and no test.doc
+# exists anywhere in the tree (the qa dir holds only the .cxx and doctok.job) —
+# the sample was never checked in. testInitUno/testEnd should pass. Wired
+# anyway: the failure is the suite's own missing fixture, not the build.
+gtest_test(
+ name = "writerfilter_qa_doctok",
+ srcs = ["qa/cppunittests/doctok/testdoctok.cxx"],
+ copts = _COPTS,
+ defines = _DEFINES,
+ deps = [
+ ":writerfilter_headers",
+ "//main/sal:sal_headers",
+ "//main/cppu:cppu_headers",
+ "//main/cppuhelper:cppuhelper_headers",
+ "//main/ucbhelper:ucbhelper_headers",
+ "//main/udkapi:udkapi_idl_headers",
+ "//main/offapi:offapi_idl_headers",
+ "//main/stlport:stlport",
+ "@boost.legacy//:boost.legacy",
+ ],
+ additional_linker_inputs = [
+ "//main/sal:sal_implib",
+ "//main/cppu:cppu3_implib",
+ "//main/cppuhelper:cppuhelper_implib",
+ "//main/ucbhelper:ucbhelperMSC_implib",
+ ":writerfilter_implib",
+ ],
+ linkopts = [
+ "$(execpath //main/sal:sal_implib)",
+ "$(execpath //main/cppu:cppu3_implib)",
+ "$(execpath //main/cppuhelper:cppuhelper_implib)",
+ "$(execpath //main/ucbhelper:ucbhelperMSC_implib)",
+ "$(execpath :writerfilter_implib)",
+ ],
+ uno_install = "//main/staging:install",
+)