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 85ebc3fa2355a59c726fcdb78da38477cce4f6c2 Author: Peter Kovacs <[email protected]> AuthorDate: Sun Jun 21 06:19:17 2026 +0200 removed an obsolete test again. --- CLAUDE.md | 8 ++++--- main/cppu/BUILD.bazel | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++- main/sal/BUILD.bazel | 16 +++++++++---- main/test/readme.md | 25 +++++++++++++++++--- 4 files changed, 100 insertions(+), 12 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index e2d4833b5f..f9ecc852fe 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -15,9 +15,11 @@ test 🔨 C++ unit-test infra runnable — NOW THE FRONT-LINE TASK: br DLLs + CRT + external manifest into one dir or R6034); libtest (test.dll) builds. GREEN: o3tl_test (5), tools_pathutils, //main/sal:sal_tests (22) via sal_qa_test macro, salhelper_test, - comphelper_test_string + comphelper_test_weakbag, sax_test_converter. - See main/test/readme.md. NEXT: sweep qa/ across the other migrated - modules (svl, svtools, …; svl/qa/test_URIHelper bootstraps a UNO + comphelper_test_string + comphelper_test_weakbag, sax_test_converter, + cppu_qa_{any,unotype,reference,recursion} (private types.idl → headers + via idl_library reuse). See main/test/readme.md. NEXT: sweep qa/ + across the other migrated modules (cppuhelper [5 subdirs], svl, + svtools, …; svl/qa/test_URIHelper bootstraps a UNO component context → subsequent test, needs the soffice fixture, not standalone); OfficeConnection (UNO subsequent) tests need a running-soffice fixture; cppunit suites need Phase-4 dep. diff --git a/main/cppu/BUILD.bazel b/main/cppu/BUILD.bazel index 88022145b1..710ede207c 100644 --- a/main/cppu/BUILD.bazel +++ b/main/cppu/BUILD.bazel @@ -1,6 +1,8 @@ package(default_visibility = ["//visibility:public"]) load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") +load("//build/rules:idl_pipeline.bzl", "idl_library") +load("//build/rules:gtest_test.bzl", "gtest_test") # ── Compiler / preprocessor options (mirrors sal conventions) ──── _COPTS = [ @@ -232,4 +234,63 @@ cc_binary( "$(execpath :cppu3_implib)", ], visibility = ["//visibility:public"], -) \ No newline at end of file +) + +# ── qa unit tests ───────────────────────────────────────────────── +# Four standalone GoogleTest apps (qa/main.cxx + qa/test_<x>.cxx), each linking +# cppu + sal only. They exercise UNO type machinery against private test types +# defined in qa/types.idl (Enum1/Struct1/Interface1/Exception1/Poly/Rec, mostly +# in the global namespace) — generated to C++ headers and #include'd by bare +# name (e.g. "Enum1.hpp"), so the generated inc dir goes on the include path. + +# qa/types.idl → headers. Exception1 etc. derive from com::sun::star::uno:: +# Exception, so idlc needs udkapi on -I and cppumaker the udkapi rdb. +idl_library( + name = "cppu_qa_idl", + srcs = ["qa/types.idl"], + include_dirs = ["main/udkapi"], + extra_rdbs = ["//main/udkapi:udkapi_idl"], +) + +cc_library( + name = "cppu_qa_idl_headers", + hdrs = [":cppu_qa_idl"], + includes = ["cppu_qa_idl_inc"], +) + +_QA_DEPS = [ + ":cppu_qa_idl_headers", + ":cppu_headers", + "//main/sal:sal_headers", + "//main/udkapi:udkapi_idl_headers", + "@boost.legacy//:boost.legacy", +] + +_QA_LINKER_INPUTS = [ + "//main/sal:sal_implib", + ":cppu3_implib", +] + +_QA_LINKOPTS = [ + "$(execpath //main/sal:sal_implib)", + "$(execpath :cppu3_implib)", +] + +_QA_RUNTIME_DLLS = [ + "//main/sal:sal3", + ":cppu3", +] + +[ + gtest_test( + name = "cppu_qa_" + t, + srcs = ["qa/test_%s.cxx" % t, "qa/main.cxx"], + copts = ["/Zc:wchar_t-"], + defines = _DEFINES, + deps = _QA_DEPS, + additional_linker_inputs = _QA_LINKER_INPUTS, + linkopts = _QA_LINKOPTS, + runtime_dlls = _QA_RUNTIME_DLLS, + ) + for t in ["any", "unotype", "reference", "recursion"] +] \ No newline at end of file diff --git a/main/sal/BUILD.bazel b/main/sal/BUILD.bazel index 1e4582ba26..ae1699829d 100644 --- a/main/sal/BUILD.bazel +++ b/main/sal/BUILD.bazel @@ -236,16 +236,23 @@ sal_qa_test(name = "osl_Mutex", srcs = ["qa/osl/mutex/osl_Mutex.cxx"], subdir = sal_qa_test(name = "sal_ut_osl_thread", srcs = ["qa/osl/thread/test_thread.cxx"], subdir = "osl/thread") sal_qa_test(name = "osl_old_testprofile", srcs = ["qa/osl/profile/osl_old_testprofile.cxx"], subdir = "osl/profile") sal_qa_test(name = "test-setthreadname", srcs = ["qa/osl/setthreadname/test-setthreadname.cxx"], subdir = "osl/setthreadname") -# osl_Security uses Win32 SID/registry APIs directly: <windows.h> + advapi32. -sal_qa_test(name = "osl_Security", srcs = ["qa/osl/security/osl_Security.cxx"], subdir = "osl/security", copts = ["/FIwindows.h"], linkopts = ["advapi32.lib"]) +# osl_Security — BLOCKED on retired testshl2: osl_Security.cxx uses WIN_BYTE/ +# WIN_BOOL and getForwardString() from testshl2's cmdlinebits.hxx (see the +# commented-out include in osl_Security_Const.h). testshl2 was removed from AOO +# and has no replacement in-tree, so the test cannot compile (the Win32 part — +# SID/registry APIs, /FIwindows.h + advapi32 — was only half the story). Left +# unwired until/unless a getForwardString shim is provided. Was: +# sal_qa_test(name="osl_Security", srcs=["qa/osl/security/osl_Security.cxx"], +# subdir="osl/security", copts=["/FIwindows.h"], linkopts=["advapi32.lib"]) sal_qa_test(name = "osl_Module", srcs = ["qa/osl/module/osl_Module.cxx"], subdir = "osl/module") sal_qa_test(name = "sal_ut_osl_pipe", srcs = ["qa/osl/pipe/osl_Pipe.cxx"], subdir = "osl/pipe") # osl_File uses Win32 directly (MAX_PATH/DWORD, GetLogicalDrives/GetFileAttributes -# — all kernel32, default-linked): force-include <windows.h> like osl_Security. +# — all kernel32, default-linked): force-include <windows.h>. sal_qa_test(name = "osl_File", srcs = ["qa/osl/file/osl_File.cxx"], subdir = "osl/file", copts = ["/FIwindows.h"]) sal_qa_test(name = "tcwf", srcs = ["qa/osl/file/test_cpy_wrt_file.cxx"], subdir = "osl/file") sal_qa_test(name = "osl_old_test_file", srcs = ["qa/osl/file/osl_old_test_file.cxx"], subdir = "osl/file") -sal_qa_test(name = "osl_Thread", srcs = ["qa/osl/process/osl_Thread.cxx"], subdir = "osl/process") +# osl_Thread calls Win32 Sleep() (kernel32, default-linked): force-include <windows.h>. +sal_qa_test(name = "osl_Thread", srcs = ["qa/osl/process/osl_Thread.cxx"], subdir = "osl/process", copts = ["/FIwindows.h"]) # systools — Win32 COM smart pointers (needs ole32 + CoInitialize). sal_qa_test(name = "test_comtools", srcs = ["qa/systools/test_comtools.cxx"], subdir = "systools", copts = ["/FIwindows.h"], linkopts = ["ole32.lib"]) @@ -312,7 +319,6 @@ test_suite( ":sal_ut_osl_thread", ":osl_old_testprofile", ":test-setthreadname", - ":osl_Security", ":osl_Module", ":sal_ut_osl_pipe", ":osl_File", diff --git a/main/test/readme.md b/main/test/readme.md index 732cfffdbc..97391d6622 100644 --- a/main/test/readme.md +++ b/main/test/readme.md @@ -23,6 +23,16 @@ holdouts). This brings the test layer onto Bazel so suites run under - `//main/salhelper:salhelper_test` - `//main/comphelper:comphelper_test_string`, `:comphelper_test_weakbag` - `//main/sax:sax_test_converter` + - `//main/cppu:cppu_qa_any` / `:cppu_qa_unotype` / `:cppu_qa_reference` / + `:cppu_qa_recursion` + + **Tests with private IDL types** (cppu/qa has a `types.idl` defining + Enum1/Struct1/Interface1/… used only by the tests): reuse the `idl_library` + rule (`//build/rules:idl_pipeline.bzl`) to compile the .idl → C++ headers, + wrap it in a `cc_library(includes=["<name>_inc"])`, and add that as a test + dep. The test `#include`s the generated headers by bare name (`"Enum1.hpp"`) + because the types sit in the global IDL namespace. `test_any` also needs + `@boost.legacy` (boost/type_traits). For a test that links a module DLL (not just sal), the staged exe needs that DLL **and its transitive runtime DLLs** co-located (the loader only @@ -45,8 +55,13 @@ holdouts). This brings the test layer onto Bazel so suites run under `source.json` + `bazel mod deps --lockfile_mode=refresh`.** Otherwise Bazel reuses the cached extraction and silently ignores the edit. - **`$(TESTSHL2LIB)` in the dmake `*STDLIBS` is a no-op** — AOO retired - `testshl2`; the variable is undefined (expands empty). So those suites are not - blocked by a missing lib. + `testshl2`; the variable is undefined (expands empty). So most suites are not + blocked by a missing *lib*. But a few still `#include` testshl2 *headers* + (`cmdlinebits.hxx` → `getForwardString()`, plus its `WIN_BYTE`/`WIN_BOOL` + typedefs) — those genuinely can't compile without a shim. `osl_Security` is + the one that bites: it's left **unwired** (not a green-gate exclusion — it + won't build at all). Don't be fooled by the half-fix: `/FIwindows.h` + + advapi32 satisfies its Win32 SID/registry calls but not the testshl2 include. ## Excluded from the sal green gate @@ -60,7 +75,11 @@ they fail on their own merits (source is out of scope, so not fixed): - `rtl_logfile` — writes/reads `c:/temp` and asserts on it (env/permission). - `rtl_textcvt` — text-conversion / mime / codepage table expectations (sal's conversion works in the running app; this is test-data drift). -- `osl_Security` — Win32 SID/registry APIs (needs `<windows.h>` + advapi32). +- `osl_File` — builds (`/FIwindows.h`) but 10/208 cases assert on a specific + drive topology (CD/floppy/RAM disk) absent on the test machine; the rest pass. + +(`osl_Security` is NOT here — it fails to *build* on testshl2, see the gotcha +above; it's unwired entirely, not a green-gate exclusion.) Also deferred: cppunit suites (`osl/socket`, `rtl_strings`) → need a CppUnit external dep; child-process tests (`osl/process`, `rtl/bootstrap`, `rtl/process`)
