summaryrefslogtreecommitdiff
path: root/solenv/gbuild/CppunitTest.mk
AgeCommit message (Collapse)Author
2025-01-15Fix Windows `make CppunitTest_... CPPUNITTRACE=TRUE`Stephan Bergmann
...after b20d18054ca5c13376bfd723b7e442c2e011c6de "Move setting of LD_LIBRARY_PATH closer to invocation of cppunittester" had caused that to just start VS without a program to debug Change-Id: I0e9039acf3b63f2cf43f64aeecd05d51aff58979 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180284 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2025-01-11fix debugging unit tests under macOS 15.2Noel Grandin
as of macOS 15.2, trying to debug a unit test will fail because "env" is hardened and we were calling that around our actual executable. But we don't need that, since we already pass in the required stuff via a command that is inserted before the call to lldb. Change-Id: I4caa91d8ef45326375aa86944b0cee9799acaa59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180090 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2025-01-07Move setting of LD_LIBRARY_PATH closer to invocation of cppunittesterStephan Bergmann
At least for a Linux build of mine, `make CppunitTest_vcl_gtk3_a11y` would fail with something like > workdir/LinkTarget/Executable/cppunittester X11 error: Can't open display: > Set DISPLAY environment variable, use -display option > or check permissions of your X-Server > (See "man X" resp. "man xhost" for details) apparently because that test adds an invocation of xvfb-run to ICECREAM_RUN, which appeared on the command line after gb_CppunitTest_CPPTESTPRECOMMAND (which, on Linux, sets up LD_LIBRARY_PATH to include instdir/program), so that the execution of xvfb-run picked up libraries from instdir/program instead of from the system (at least libpixman-1.so.0, it appears), which then apparently caused things to not work well. So move the contents of gb_CppunitTest_CPPTESTPRECOMMAND further down on the command line (which then requires an invocation of `env`). (This still leaves me with a `make CppunitTest_vcl_gtk3_a11y` that fails in a different way now, but that's something for another day...) Change-Id: Ic53dd8f87e3fa548a998363f5489819a02b2bf8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179862 Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de> Tested-by: Jenkins
2024-07-17Simplify checking for "running under unit/ui test"Noel Grandin
In various places, the code checks if we are running as a unit test or a UI test. This code grew organically, and is most re-using environment variables that were designed for narrower purposes. Rather than being clever, just add two new explicit and simple environment variables in the natural place (the command that runs them), and check for those variables in the code. Change-Id: Icce0997914fa0be30a5ac1f29bd870bdb5893a8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170618 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-02-27Remove unused gb_CppunitTest_localized_runStephan Bergmann
...that appears to be unused ever since it got introduced in d8a8ed04b14390d4469ea19b079778fa6f074bb2 "gbuild allow unitest to run once per lang in WITH_LANG_LIST" Change-Id: Id43b8498ca68c274902dfb3dfd4b035e199cb9b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163993 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-02-26Fix --enable-coredumpctl in CppunitTestStephan Bergmann
...which 533e993f2d11814252c40d60bdab469de03b14db "Don't reuse --unit values across (sequential, even) systemd-run invocations" had broken by moving the setting of the LIBO_TEST_UNIT var to a place where the use of that env var would no longer see it. Fix it by making the individual LO_TEST_LOCALE=* tests of gb_CppunitTest_localized more autonomous. Each one now has an individual log file and gets an individual gb_CppunitTest_postprocess treatment. Change-Id: Ie6875dda874e357426370d4d5166c05e36881210 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163967 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-02-20merge desktop_detector library into vcl libraryNoel Grandin
Noting that the main feature of using a separate library - avoiding linking against SM and ICE - is no longer a thing, since we have not used those in some time. Change-Id: I9ecd6758e97f0fa19b224346aa577a04b46793b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163638 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-17Don't reuse --unit values across (sequential, even) systemd-run invocationsStephan Bergmann
At least some old versions of systemd-run apparently have occasional issues when sequential invocations reuse the same --unit value, as <https://ci.libreoffice.org/job/lo_ubsan/2982/> now (i.e., after the machine was updated to auto-detect --with-coredumpctl) failed with > [build CUT] basctl_dialogs_test > LO_TEST_LOCALE=de > Running scope as unit: -home-tdf-lode-jenkins-workspace-lo_ubsan-workdir-CppunitTest-basctl_dialogs_test.test:20231117013657:704127.scope [...] > LO_TEST_LOCALE=en-US > Running scope as unit: -home-tdf-lode-jenkins-workspace-lo_ubsan-workdir-CppunitTest-basctl_dialogs_test.test:20231117013657:704127.scope [...] > LO_TEST_LOCALE=fi > Failed to start transient scope unit: Unit -home-tdf-lode-jenkins-workspace-lo_ubsan-workdir-CppunitTest-basctl_dialogs_test.test:20231117013657:704127.scope already exists. Change-Id: If009e26231228bec739637e4140be90c0b86d6b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159569 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-04-02New --with-coredumpctl to obtain core dumps of crashed tests from coredumpctlStephan Bergmann
...for (Linux) systems that don't store core.* files in the current working directory. When enabled, this wraps test execution in `systemd-run --scope --user --unit=...` with unit values unique per individual test invocation, so that solenv/bin/gdb-core-bt.sh can query coredumpctl for matching core dumps. (See the mailing list thread starting at <https://lists.freedesktop.org/archives/systemd-devel/2023-March/048884.html> "[systemd-devel] coredumpctl: matching by e.g. env var?" for further details.) The used --unit=... scheme is a best effort to produce system-wide unique values, combining the target location path of the given test with a second-granularity date/time and the current PID. (In case there would be multiple invocations of the same test per second, which then hopefully wouldn't reuse the same PID. The date/time and PID could be replaced with a high-resolution system-wide monotonic clock/counter if one were easily available. The advantage of the current scheme is that it only uses Posix features.) The overall length of the unit value (incl. the appended ".scope" suffix) must not exceed 256 characters, or else systemd-run would fail with "Failed to mangle scope name: Invalid argument". It might look more natural to pass the unit value into gdb-core-bt.sh as a fourth positional argument rather than via a new LIBO_TEST_UNIT env var. But for one, the unit value is most easily computed from within the recipe shell command lines, where an env var is the most natural fit. And for another, this avoids having to tunnel yet another value through the tearDown method in unotest/source/java/org/openoffice/test/OfficeConnection.java to the given postprocesscommand. Change-Id: Idcb20cd1e1141d8ec7f10947e5edc70aa2aa7d32 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149690 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-09-02Fix setting SAL_NON_APPLICATION_FONT_USEStephan Bergmann
...after a342b72f4218cd617aa6fb413fcf5fbb182c316f "gbuild: set SAL_NON_APPLICATION_FONT_USE in gb_CppunitTest_use_more_fonts" had caused e.g. CppunitTest_vcl_pdfexport to be executed with merely SAL_NON_APPLICATION_FONT_USE=deny rather than the stronger SAL_NON_APPLICATION_FONT_USE=abort that vcl/CppunitTest_vcl_pdfexport.mk asked for. So introduce a dedicated gb_CppunitTest_set_non_application_font_use that accumulates the requested modes and then selects the strongest requested one ("allow" over "abort" over "deny"). That also means we can go back to model "allow" with an unset SAL_NON_APPLICATION_FONT_USE env var. Change-Id: I32ba0a94c1965f0e3336e676b17f4f5efb85efce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139251 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-09-01gbuild: set SAL_NON_APPLICATION_FONT_USE in gb_CppunitTest_use_more_fontsKhaled Hosny
So it applies to all tests using HAVE_MORE_FONTS. Change-Id: I60567c996286aa8a76c7180c58aea7f214a99d87 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139144 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-07-18Mend python support for lldb cppunit tests.Hannah Meeks
Change-Id: I02f4872ac75d82f2d77c1854ce040b72883b484a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137204 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-07-14Change make file so that debugging works - Previous error:Hannah Meeks
hannah@localhost:~/master/sw> make CppunitTest_sw_macros_test CPPUNITTRACE="gdb --args" [CUT] sw_macros_test S=/data/opt/libreoffice/master && I=$S/instdir && W=$S/workdir && mkdir -p $W/CppunitTest/ && rm -fr $W/CppunitTest/sw_macros_test.test.user && cp -r $W/unittest $W/CppunitTest/sw_macros_test.test.user && ( MAX_CONCURRENCY=4 MOZILLA_CERTIFICATE_FOLDER=dbm: SAL_DISABLE_SYNCHRONOUS_PRINTER_DETECTION=1 SAL_USE_VCLPLUGIN=svp LIBO_LANG=C icerun PYTHONWARNINGS=default gdb -return-child-result -ex "add-auto-load-safe-path $S/instdir" -ex "set environment LD_LIBRARY_PATH ${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}"$I/program:$I/program":$W/UnpackedTarball/cppunit/src/cppunit/.libs" -ex 'set environment MALLOC_CHECK_=2; set environment MALLOC_PERTURB_=153' --args $W/LinkTarget/Executable/cppunittester $W/LinkTarget/CppunitTest/libtest_sw_macros_test.so --headless "-env:BRAND_BASE_DIR=file://$S/instdir" "-env:BRAND_SHARE_SUBDIR=share" "-env:BRAND_SHARE_RESOURCE_SUBDIR=program/resource" "-env:UserInstallation=file://$W/CppunitTest/sw_macros_test.test.user" "-env:CONFIGURATION_LAYERS=xcsxcu:file://$I/share/registry xcsxcu:file://$W/unittest/registry" "-env:UNO_TYPES=file://$I/program/types/offapi.rdb file://$I/program/types/oovbaapi.rdb file://$I/program/types.rdb" "-env:UNO_SERVICES=file://$W/Rdb/ure/services.rdb file://$W/Rdb/services.rdb" -env:URE_BIN_DIR=file://$I/program -env:URE_INTERNAL_LIB_DIR=file://$I/program -env:LO_LIB_DIR=file://$I/program -env:LO_JAVA_DIR=file://$I/program/classes --protector $W/LinkTarget/Library/unoexceptionprotector.so unoexceptionprotector --protector $W/LinkTarget/Library/unobootstrapprotector.so unobootstrapprotector --protector $W/LinkTarget/Library/libvclbootstrapprotector.so vclbootstrapprotector "-env:CPPUNITTESTTARGET=$W/CppunitTest/sw_macros_test.test" ) ICECC[448] 2022-07-13 13:23:02: couldn't find any PYTHONWARNINGS=default ICECC[448] 2022-07-13 13:23:02: could not find PYTHONWARNINGS=default in PATH. make: *** [/data/opt/libreoffice/master/solenv/gbuild/CppunitTest.mk:121: /data/opt/libreoffice/master/workdir/CppunitTest/sw_macros_test.test] Error 115 hannah@localhost:~/master/sw> Change-Id: Idebbd385f70edd9b691d91f6eded8ee02ac9cce7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137032 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-12unittest: Split out registry entries to alter UI definition search pathColomban Wendling
Accessibility tests will require testing the normal UI, so will need not alter the search path for definitions. It will however benefit from other environmental overrides (locale, fonts, etc.). The solution here splits out to a separate registry the piece of configuration that alter the UI, so users can select the features set they need. The default gb_CppunitTest_use_configuration is updated to keep working the same as before, using both layers. gb_CppunitTest_use_unittest_configuration is replaced by specific ones for each configuration layer, and the two direct call sites removed as they were redundant anyway (gb_CppunitTest_use_unittest_configuration is only a subset of gb_CppunitTest_use_configuration). New macros are gb_CppunitTest_use_common_configuration for the common layer and gb_CppunitTest_use_user_ui_configuration for the UI one. Change-Id: I75f82092079752b4e173e48ab463636e7b7515b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136997 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-13officecfg,stoc: allow running JVM UNO components out-of-processMichael Stahl
The problem is that 32-bit Win32 applications have very little VM, and soffice.bin can run out, so try to move the JVM to a separate process (uno.bin) and connect to it via pipe. Add a new config to enable this: "org.openoffice.Office.Java/VirtualMachine/RunUnoComponentsOutOfProcess" If enabled, ServiceManager instantiates *all* JVM components out-of-process, by instantiating "com.sun.star.java.theJavaVirtualMachine" out-of-process. To ensure that the remote connection is disconnected at shutdown (and thereby prevent crashes with remote calls during late shutdown), JavaComponentLoader is now a "single-instance" service; this change should be harmless for the default in-process configuration case. Tested with these extensions: Wiki Publisher smoketest TestExtension.oxt odk CalcAddins.oxt Inspector.oxt ToDo.oxt Also passed "make check" on Linux when enabled, if the variable URE_BIN_DIR is set properly for CppunitTest_services. Change-Id: I76bf17a9512414b67dbd20daee25a6d29c05f9d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133218 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-03-28Drop support for OpenGL denylist on X11Stephan Bergmann
...which appears to have become even less relevant with db89f53c31af997b9bf422b0e784afba8d62a42e "remove OpenGL VCL backend code". And the vcl/unx/glxtest.cxx machinery that it is based on is (a) known to cause issues like <https://gitlab.freedesktop.org/mesa/mesa/-/issues/3957> "LibreOffice's OpenGL version detection code hangs when running inside a flatpak container with a different mesa version", and (b) is one of the two reasons why an soffice that uses Wayland nevertheless also requires Xwayland during startup (the other reason being oosplash). So getting rid of the glxtest machinery is beneficial. The remaining two potential uses of OpenGL on X11/Wayland are the obscure css.rendering.SpriteCanvas.OGL service implementation (about which db89f53c31af997b9bf422b0e784afba8d62a42e states that "it seems has never been finished or enabled (or so it most probably should be dumped too)") and some slideshow transitions. About the latter, Caolán stated on IRC: "I think we grew this set of stuff to check for dodgy opengl primarily for the case where vcl used opengl for ordinary UI optimizations; but I think that use is gone now so I wonder does it make sense to just drop all of that entirely; for just slide transitions we apparently survived fine without the denylist for ages". (And in any case there is still the WatchdogThread support with OpenGLZone::hardDisable in VCLExceptionSignal_impl, vcl/source/app/svmain.cxx, should any OpenGL code run into problems.) (The removal of gb_LinkTarget_use_glxtest from gb_LinkTarget_use_vclmain, which indirectly brought in gb_LinkTarget_use_libraries,*,vcl, revealed that an explicit use of vcl was missing from various Executables etc., which thus had to be added now.) Change-Id: Ifa5220fd09910a4459ca546d9655e479a2e38f1e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131943 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-01-19WASM gbuild: add --pre-js dependenciesJan-Marek Glogowski
Currently includes environment.js for general environment settings and soffice_args.js for soffice command line flags. Change-Id: I1166c5a9ae53c56a69b9223c865b4df525d07450 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128590 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-12-31gbuild: introduce gb_%_linktarget_targetJan-Marek Glogowski
Just some refactoring. Change-Id: I47adb93f8a413d289f6abb2a48ed3f049f582a46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127799 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-10-28Fix passing DYLD_LIBRARY_PATH into lldb on macOSStephan Bergmann
...making sure that the shell expands the leading DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH:+$DYLD_LIBRARY_PATH:}... before it reaches lldb. (This gets rid of gb_{Cppunit,Pyhton}_{PRE,POST}GDBTRACE again. No idea why c38a4d9ce248b4b3fcc9208b25dfa599fe506ac0 "Make the CPPUNITTRACE="lldb --" thing work again (on macOS)" used -s with a temp file rather than -o to pass that env var into lldb.) Change-Id: I9ae5217a9629981c8652fc5aca8f97fa6eb99729 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124331 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-29qt6: Add a qt6 VCL pluginMichael Weghorn
This adds a new "qt6" VCL plugin based on Qt 6. Building the plugin is enabled by autogen option '--enable-qt6' (and optionally setting 'QT6DIR' as needed). Use the 'SAL_USE_VCLPLUGIN=qt6' environment variable before running LO to select this VCL plugin. Taking qt6 into account at all relevant places certainly still requires follow-up changes, but this builds and runs with a self-compiled qtbase from the 'dev' git branch as of commit 3ce0672143d2eb3c3809f82998a4d71c5800d77a. I didn't see anything obviously broken in a quick run, but didn't test much. This reuses and shares the qt5 VCL plugin code; the qt6 headers and sources for now just '#include' the qt5 ones. Version checks are used for the code places that need different handling to be built against Qt 6. The build system parts in this commit were mostly done by copying the qt5 equivalents, then adapting as needed. Some notes on things I came across while porting to qt6: 1) At least in my self-compiled Qt versions, 'moc' (the meta-object compiler) is located in the 'libexec' subdirectory in 'QT6DIR', while the Qt 5 equivalent is located in the "bin" subdirectory of 'QT5DIR', so the configure.ac check uses the former. 2) moc does not process classes from the included headers. Since the headers in 'vcl/inc/qt6' just '#include' the ones from 'vcl/inc/qt5', running moc on the qt6 headers doesn't work, so moc is currently run on the qt5 headers for qt6 as well (s. 'vcl/CustomTarget_qt6_moc.mk'). That will have to be adapted in case the qt6 VCL plugin uses "own" headers instead of just including the qt5 ones at some point. 3) QX11Extras has been removed from Qt 6. [1] says: > Changes to Qt X11 Extras > > The QX11Info class has been removed. > > Clients that still rely on the functionality can include the private > header <QtGui/private/qtx11extras_p.h> as a stopgap solution. To enable > private headers use QT += core-private with qmake, or add a project > dependency to Qt::CorePrivate with CMake. I didn't take any closer look, just dropped the use of QtX11Extras for qt6 for now. 4) XCB_ICCCM is no longer needed. It is only used in qt5 to workaround a Qt bug fixed in Qt 5.12, s. commit fe2baf9e84e0ca9aeaa683e37076f57fa3f38dca Author: Jan-Marek Glogowski <jan-marek.glogowski@extern.cib.de> Date: Tue Dec 3 08:32:58 2019 +0100 Qt5 fix missing XCB_ICCCM_WM_HINT_WINDOW_GROUP 5) X11-specific code is still used for key modifier handling. Therefore, still check for the XCB headers when 'USING_X11' is set in configure.ac, and use a 'QT6_USING_X11' define (as qt5 uses 'QT5_USING_X11'). 6) There's currently no Qt 6 video sink for GStreamer. As of today, qt-gstreamer is unmaintained and there is no Qt 6 version. The project's README [2] says: > 0. Maintenance Notice > --------------------- > > This code is unmaintained. You can use it at your own risk. > > If you want to integrate video display in your QML-based UI, > you should consider using 'qmlglsink', from gst-plugins-good. > This is a well supported video sink that uses the generic > gstreamer-gl stack and is in many ways superior to 'qtquick2videosink' > that is provided by qt-gstreamer. You can use this code as an example: > https://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/examples/qt/qmlsink > > If you are not interested in using QML in your UI, then you > may use one of the other elements provided by this module > (see below). If you do that, it would be helpful to let us > know that this code is still useful to you. We may consider > adding these elements in one of the core gstreamer modules. > > If you are here for the Qt-style bindings, I'm sorry to disappoint you. > The alternative is to use the C API, or the GStreamermm C++ API. > Qt-style bindings are cool, but unfortunately they are very hard > to maintain because they are written by hand. If you are interested > in continuing this project, you are welcome to implement a > generator for them, probably based on GObject-Introspection. > I am happy to provide directions if you want to pursue such a thing. Therefore, the Qt video sink handling is qt5-only and the corresponding handling for GOBJECT (used for the GStreamer video sink handling) was not taken over for qt6. This presumably means that video playback in Impress presentations does not work when using qt6 with they Qt Wayland plugin, s. tdf#125219 for the corresponding bug for qt5/kf5. (I did not build the qtwayland module to actually test this, though. Video playback with the Qt xcb plugin in a Wayland session works.) [1] https://doc-snapshots.qt.io/qt6-dev/extras-changes-qt6.html [2] https://cgit.freedesktop.org/gstreamer/qt-gstreamer/tree/README Change-Id: Ib105ccfb2c3630ec5d5403793a3cd9ba31d85bdf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122808 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-05-29gbuild: implement gb_Library_get_target_for_buildJan-Marek Glogowski
I was wondering why removing instdir stuff forced a rebuild of the cross toolset. Turned out some cross-toolset bits were wrongly depending on host build stuff. It even had FIXME... As a consequence, gb_CPPU_ENV was replaced by config_host.mk flags to provide an CPPU_ENV_FOR_BUILD and also uses the correct OS_FOR_BUILD. Change-Id: I50e8e8dca50ab1ad3164948a585a792a52e4a39a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116359 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-05-26gbuild: Handle glxtest + vclmain usage via macrosJan-Marek Glogowski
Use a macro to do the same checks for all Executable with glxtest or vclmain usage. Both are static libraries, so every user has the same dependencies. Introduces: * gb_Executable_use_vclmain * gb_Executable_use_glxtest Change-Id: Ib80b4e7c6f5078d47ad8f1ec5708a7174415f705 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116145 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-05-10bodge a gtk4 starting point into existenceCaolán McNamara
this is not supposed to work or anything even close to that Change-Id: I46b4fed6a1e6cfc885cb4f7c24660bb6438d5101 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115293 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-25Revert "Use { ... } for grouping that does not need a sub-shell"Stephan Bergmann
This reverts commit 51f4691e7f4f3bceac1d5ec9cbbf37de7e71e471. The gb_CppunitTest_localized case did need the sub-shell for its $(if $(gb_CppunitTest_localized),|| exit $$?; done) \ part, or else a failed sub-command would exit the whole recipe line and suppress the non-gb_CppunitTest__interactive postprocessing part. Change-Id: I115388ce4fe834f73ebd0abf2591775189c0121b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108280 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-09-25Adapt PythonTest on macOS to PRE-/POSTGDBTRACEStephan Bergmann
Change-Id: Ie23f2fc2e588721ab87e35f52f306e342a5ab246 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103368 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-09-25Run gdb with PYTHONWARNINGS=defaultStephan Bergmann
Otherwise, --enable-werror (setting PYTHONWARNINGS=error) would cause Cppunit-/PythonTest with CPPUNITTRACE='gdb --args' on Linux to print lots of messages like > Python Exception <class 'DeprecationWarning'> the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses: > gdb: warning: > Could not load the Python gdb module from `/usr/share/gdb/python'. > Limited Python support is available from the _gdb module. > Suggest passing --data-directory=/path/to/gdb/data-directory. and > Traceback (most recent call last): > File "instdir/program/python.bin-gdb.py", line 48, in <module> > import gdb > File "/usr/share/gdb/python/gdb/__init__.py", line 23, in <module> > from imp import reload > File "/usr/lib64/python3.8/imp.py", line 31, in <module> > warnings.warn("the imp module is deprecated in favour of importlib; " DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses Change-Id: Id85b2ee6d3cfaeaf91659bfb649a3cb78c707447 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103349 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-09-24PythonTest CPPUNITTRACE='gdb --args' needs to tunnel setting LD_LIBRARY_PATHStephan Bergmann
...so that it doesn't affect gdb itself, just like CppunitTest already did. Otherwise, e.g. make PythonTest_sc_python CPPUNITTRACE='gdb --args' in a Linux ASan and --enable-python=fully-internal build on Fedora 32 would fail with > gdb: symbol lookup error: instdir/program/libpython3.8.so.1.0: undefined symbol: __asan_option_detect_stack_use_after_return as /usr/bin/gdb would try to use LO's instdir/program/libpython3.8.so.1.0 instead of /usr/lib64/libpython3.8.so.1.0. So, at least on Linux, the gb_PythonTest_PRECOMMAND settings are now passed into the test process either directly upfront (if gb_PythonTest_GDBTRACE is not set) or tunneled past gdb via gb_PythonTest_GDBTRACE (if it is set). At least on some platforms, gb_PythonTest_PRECOMMAND has a different value than gb_CppunitTest_CPPTESTPRECOMMAND, so gb_CppunitTest_GDBTRACE would reflect the settings from gb_CppunitTest_CPPTESTPRECOMMAND but not from gb_PythonTest_PRECOMMAND, so introduce a new gb_PythonTest_GDBTRACE (which is to gb_PythonTest_PRECOMMAND what gb_CppunitTest_GDBTRACE is to gb_CppunitTest_CPPTESTPRECOMMAND). macOS with its split gb_CppunitTest_{,PRE,POST}GDBTRACE variables will likely need some work to adopt that to PythonTest, but which is rather orthogonal to this change, so just note that as a TODO for now. Change-Id: I7e6681de638095cb58b44de381248ae7326ce412 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103345 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-09-24Implement DEBUGCPPUNIT as a special case of CPPUNITTRACEStephan Bergmann
...so that gb_CppunitTest_GDBTRACE is only defined in a single place now (in solenv/gbuild/CppunitTest.mk), which should make reasoning about the code simpler Change-Id: I275a20c2fe473e68f4bb08a3fe2691a5809f91a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103298 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-09-24Move some settings from just DEBUGCPPUNIT to all gdb CPPUNITTRACEStephan Bergmann
For one, it is probably a good idea to always (a) return the tested process' exit code, and (b) help users without a proper .gdbinit by setting auto-load-safe-path. And for another, this change works towards the goal of implementing DEBUGCPPUNIT as a special case of CPPUNITTRACE, ultimately simplifying the setting of gb_CppunitTest_GDBTRACE. Change-Id: I186434fa8645d8b068c69dbcfedf9b7d6374f99c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103297 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-09-17Report each value of LO_TEST_LOCALE in localized CppunitTestStephan Bergmann
Change-Id: I7ad091ec163f2324f2b8481e4caa6beb12188ea4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102896 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-09-11Use { ... } for grouping that does not need a sub-shellStephan Bergmann
...in case that makes ever so small a difference, esp. on Windows (where spawning processes is known to be expensinve; but note that at least Bash seems to not spawn a sub-shell anyway when what is enclosed in ( ... ) is just a simple single process, which is commonly the case for these cppunittester invocations) Change-Id: Ie9200270743754e02fbfdb2b17239e9873031dab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102407 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-25dont turn on malloc debugging for gdb itselfNoel Grandin
fix the command such that, when we insert the malloc debugging env vars, we only do it for the executable itself, not for gdb, or some gdb operations will be very very slow. Before this fix, if I did a make Cppunit... CPPUNITRACE=... ran the program, then ran it again, the second time would take 5 min to get going. Now the second time it runs in seconds. Change-Id: Id08c3a82679164588b88af65a6a7b5f7dd19ff05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101318 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-14solenv: fix typo in CppunitTestMiklos Vajna
Added in commit 2edc86a592bc943fcffef0a8ae8db220e18e2b37 (Default all tests to run with the svp plugin, 2018-11-23), if svp is to be avoided, it has to be filtered out from the environment variables, not filtered for. With this, the unexpected SAL_USE_VCLPLUGIN=gen is gone from the generated cmdline when using gb_CppunitTest_use_vcl_non_headless. Change-Id: Ib666f3df007898165f2019f0a9b0677f679aa6e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100742 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2020-05-06Move all public Java classes to libreoffice.jarSamuel Mehrbrodt
This moves the classes from juh.jar and ridl.jar to libreoffice.jar The goal is to have one single jar (and Java module, will be added later) which developers can include to work with LO. juh.jar and ridl.jar are kept as basically empty jars with libreoffice.jar on its classpath to keep backwards compatibility. This is a continuation of ae855bf48163ff64d94cfc34aff8e37abdb5518d and a preparation to have Java 9 module support. Change-Id: Ifbbfb97f60373d14256e62ae3122913bd17d5bbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91930 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-04-20prefer building Skia with Clang if possible (tdf#131697)Luboš Luňák
I.e. try to find and use Clang even if the default compiler is something else. Skia is optimized to be built with Clang(-cl) and in CPU-based raster mode some operations are several times slower if built with something else (e.g. fmax/fmin do not get optimized to inline assembly). It is enough to select Clang to be installed in the MSVS installer. At this point it unclear how to handle release binaries, if it should work this way and enforced, or maybe Clang could be used for building everything, or maybe some other way. Change-Id: I6b95a0f2d5cbf176942d9e01136990b14be6dba8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92415 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-02-16GBUILD_TRACE, support for finding out where the build time is spentLuboš Luňák
See instructions in solenv/gbuild/Trace.mk . This generates a file than can be viewed e.g. in the Chromium tracing view. Change-Id: I5f90647c58ca729375525b6daed2d4918adc8188 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88754 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-02-06gb_CppunitTest__use_java_ure can be private againStephan Bergmann
...(which it already was until 1f6e670605cc856a6e9febb024f9cb2427156020 "gbuild: require java UNO runtime explicitly"), as 2a87b3b5aed8296a7506374fd5324c5659a88cb5 made that implicitly called from gb_CppunitTest_use_jar(s), so its (sole outside) use in postprocess/CppunitTest_services.mk is redundant Change-Id: I9928521d184c54688de134ff3b9b5743ba3509c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88134 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-02-06Missing test dependencyStephan Bergmann
...for CppunitTest that use Java, like CppunitTest_dbaccess_hsqldb_test failing with something like > warn:jfw:2880195:2880195:jvmfwk/source/fwkbase.cxx:94: [Java framework] A vendor settings file was not specified.Check the bootstrap parameter UNO_JAVA_JFW_VENDOR_SETTINGS. > warn:jfw:2880195:2880195:jvmfwk/source/framework.cxx:582: [Java framework] A vendor settings file was not specified.Check the bootstrap parameter UNO_JAVA_JFW_VENDOR_SETTINGS. because the jvmfwk3 ini file is missing from instdir. (Should those tests also set UNO_JAVA_JFW_ENV_JREHOME=true, as is done in unotest/source/cpp/officeconnection.cxx and unotest/source/java/org/openoffice/test/OfficeConnection.java?) Change-Id: Iabf1198246c17410e71d5b85454662ff85a7b478 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88112 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-02-06No more need to add unoil.jar to URE_MORE_JAVA_TYPESStephan Bergmann
...after ae855bf48163ff64d94cfc34aff8e37abdb5518d "tdf#117331 Merge jurt and unoil into ridl" Change-Id: Idf640b8c3bb9d8a19e26d494498b9902a75f4e64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88053 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-02-06Fix typo in call to gb_CppunitTest_use_java_ureStephan Bergmann
...which had been renamed from gb_CppunitTest__use_java_ure in 1f6e670605cc856a6e9febb024f9cb2427156020 "gbuild: require java UNO runtime explicitly", apparently forgetting to adapt this use Change-Id: Ia093fcf2a5728247c259e549722329ade7b60931 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88052 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-02-04tdf#117331 Merge jurt and unoil into ridlSamuel Mehrbrodt
jurt.jar and unoil.jar are kept as effectively empty jars, each with a Class-Path: ridl.jar in their meta-inf/manifest.mf, so that 3rd-party code loading them (with or without also loading ridl.jar) will still have access to their content. Conceptually, the UNOIDL entities in unoil.jar (corresponding to module offapi) are not part of the URE, but are now made available by URE's ridl.jar. This should probably not cause problems in practice. At least for now, we seal exactly those packages in ridl.jar that were originally sealed in jurt.jar. Ideally, all of ridl.jar could be sealed now, but that would be mildly incompatible, as it would prevent 3rd-party code from introducing additional UNOIDL entities in the relevant namespaces (even if that is something we do not want 3rd-party code to do anyway). However, some JunitTest_jurt_* define classes in those sealed packages. In the past they got away with that by using gb_JunitTest_use_jar_classset,*,jurt. Instead they now need to gb_JunitTest_use_jar_classset,*,ridl and drop the gb_JunitTest_use_jar,*,ridl. But the former only makes available the classes that are specified in ridljar/Jar_ridl.mk with gb_Jar_add_sourcefiles, not the UNOIDL entities specified via gb_Jar_add_packagedirs. But the tests need the udkapi UNOIDL entities, so introduce gb_JunitTest_add_classpath to let the tests get them explicitly. (Curiously, JunitTest_jurt_uno and JnitTest_jurt_util use gb_JunitTest_use_jar_classset,*,jurt but don't seem to acutally need it; lets leave that for a follow-up clean up.) As a follow-up clean up, relevant files could be moved from jurt/ to ridljar/. Change-Id: I836f4e7bb47fb41f1306e3f223da90dba988eb9a Co-authored-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/84946 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-16Revert "Make font-based unit test depend on instdir fonts"Jan-Marek Glogowski
The following build: $ make clean && make gb_CppunitTest_sc_ucalc [...] $ cd sc $ make gb_CppunitTest_sc_ucalc triggers: sc/CppunitTest_sc_subsequent_filters_test.mk:133: *** Missing font filelist -> run make more_fonts extras. This didn't help the general Win32 font build problem AFAIK. There were additional patches to the way Windows loads the LO provided fonts, so just revert this. This reverts commit 368c996b24e09c427a30972b3405493328db6779. Change-Id: I841f96fe8312c47980c8e3be2e9d88242df5b28d Reviewed-on: https://gerrit.libreoffice.org/84633 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-04add gbuild function for a common PCH and use it in sc/ and sax/Luboš Luňák
And make it simple to disable the whole feature by setting gb_DISABLE_PCH_REUSE=1, just in case. Also work around a possible BOOST_ALL_NO_LIB mismatch when using the common PCH. Change-Id: I96fd507edf1ada6242ac225026250e5a588d0193 Reviewed-on: https://gerrit.libreoffice.org/79365 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-10-04add gb_LinkTarget_reuse_precompiled_headerLuboš Luňák
Similar to gb_LinkTarget_set_precompiled_header, but uses PCH created by another linktarget. This allows using a PCH even for linktargets that are small and creating their own dedicated PCHs is not worth it. The ultimate goal is having some default PCH that will be used if no explicit PCH is set. Change-Id: I4d72acdba7181bb5c7c1cdead776f548be36ba33 Reviewed-on: https://gerrit.libreoffice.org/79362 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-09-30drop gtk2 supportCaolán McNamara
Change-Id: Ie838cabfecfef7e3225c1555536d5c9cf3b43f15 Reviewed-on: https://gerrit.libreoffice.org/77405 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-09-05Reduce some repeated codeMike Kaganski
Change-Id: I617f606b64706e8bc32e827644e5f1d1ef27702a Reviewed-on: https://gerrit.libreoffice.org/78624 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> Tested-by: Jenkins
2019-07-05Make font-based unit test depend on instdir fontsJan-Marek Glogowski
The current dependency is already a hack, because there is no way I know of to depend on delivered top-level modules like more_fonts. The original patch parses the gb_Package_MODULE_ooo_fonts list of registered packages to add them as build dependencies. But this is not sufficient, as it just adds the dependencies on the installed / unpacked fonts in the workdir (actually it's just the installer filelist), where they can't be found by the unit test running in the instdir environment. So this converts the depndency into a make error, if either the filelist is missing or the included font files. But if we are in a full run and know the more_fonts module, we simply depend on its delivered files. This needs some minimal changes to gbuild, as neither the delivered file list nor the modules class names are yet available. And this moves the fontconfig handling to extras, where the opensymbol font is already handled. Change-Id: I1b70a4c45ff189266ce56c57e534ddc45e7c5c19 Reviewed-on: https://gerrit.libreoffice.org/74624 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2019-05-24disable warnings in external libsLuboš Luňák
As in, really disable, so that they do not even show. This moreover avoids tons of D9025 warnings from MSVC about overriding -W4 with -w. Change-Id: Ia2e72fd72d883d91bdd89e467ee42f259e2ae033 Reviewed-on: https://gerrit.libreoffice.org/72899 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2018-12-17kde5: remove older kde/tde plugins, and references to thatThorsten Behrens
KDE4 is out of maintenance upstream since Nov. 2014, and binaries provided by TDF have switched to KDE5 as the official backend. Change-Id: I165465b56d3ba3a18912b203c06ae8fc6111c0c9 Reviewed-on: https://gerrit.libreoffice.org/60014 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-12-06Default all tests to run with the svp pluginJan-Marek Glogowski
Otherwise a test can already require a windowed VCL plugin by calling gb_CppunitTest_use_vcl_non_headless(_with_windows)?. For compatibility on unix --headless still implies the use of the svp plugin, but now a SAL_USE_VCLPLUGIN will override it. All the explicit SAL_USE_VCLPLUGIN=svp are not needed, as this is now included in the gb_TEST_ENV_VARS variable and gengal already calls Application::EnableConsoleOnly(). Change-Id: I6b4e75282aa88d747db87d60ffe6c8f282187c5f Reviewed-on: https://gerrit.libreoffice.org/64052 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>