office-gobmx/sw/UITest_sw_styleInspector.mk
Miklos Vajna f5d97d14a2 uitest: add a way to optionally use the same soffice process for a testsuite
A uitest suite may have several testcases and we spend a lot of time
spinning up a new soffice process for each testcase, while we typically
do such initialization only once for per testsuites in the cppunit case,
slowing down uitests.

The problem is that this way today's uitest cases don't really have to
clean up after themselves, since they know that the next testcase will
gets its own clean state (back to the start center).

Fix the problem by adding an opt-in way, so that a uitest suite can
declare that it's safe to run the entire suite with the same soffice
process. To be more specific:
- add a new --oneprocess for test_main.py, which will create a shared
  connection to a soffice process
- UITest then closes the document (returning to the start center)
  instead of disposing the component in the oneprocess case
- UITestCase won't create its own soffice connection in the oneprocess
  case
- add a new gb_UITest_use_oneprocess method to gbuild, to request this
  new, faster behavior
E.g. on my machine this means UITest_sw_styleInspector takes 26,345s
instead of 40,652s, probably such a speedup is worth the added
complexity.

This works nicely when the testsuite is a list of simple/boring test
cases, always loading one component/document at a time and always using
close_doc() to close it. It may not be safe for testsuites that do
something special (they may fail or hang), we'll see.

Change-Id: Ib14439d48aa547c92652245ee1c0cf37d2d7b6e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149134
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-03-20 12:40:22 +00:00

18 lines
565 B
Makefile

# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_UITest_UITest,sw_styleInspector))
$(eval $(call gb_UITest_add_modules,sw_styleInspector,$(SRCDIR)/sw/qa/uitest,\
styleInspector/ \
))
$(eval $(call gb_UITest_set_defs,sw_styleInspector, \
TDOC="$(SRCDIR)/sw/qa/uitest/data" \
))
$(eval $(call gb_UITest_use_oneprocess,sw_styleInspector))