Bug 131407 - move UItest to CppunitTest
Summary: move UItest to CppunitTest
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.0.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.0.0 target:7.2.0
Keywords: difficultyMedium, easyHack, skillCpp, topicDebug, topicQA
Depends on:
Blocks: Dev-related
  Show dependency treegraph
 
Reported: 2020-03-18 18:26 UTC by Xisco Faulí
Modified: 2022-07-14 14:09 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2020-03-18 18:26:23 UTC
LibreOffice uses a python framework called UITest to test its UI. see https://wiki.documentfoundation.org/Development/UITests
However, some UI tests has been written for testing other stuff not related to the UI, like simulating user's action on a document ( undo, redo, delete, type, etc )

For this kind of tests, it's desirable to use C++ CppunitTest for two reasons
1. It's faster
2. it runs on all platforms ( UITests only run in gerrit_linux_clang_dbgutil in Jenkins )

The idea of this easyhack is to convert the UI tests not calling any UI dialog to 
CppunitTest. The list of tests that can be converted is here: https://wiki.documentfoundation.org/UiTestsToCppUnittests

Some examples of Writer tests moved to CppunitTest:
- https://cgit.freedesktop.org/libreoffice/core/commit/?id=ab623953b92d82d615bd2af6a9369915fe6fb7a8
- https://cgit.freedesktop.org/libreoffice/core/commit/?id=4a33c86a5b44184a3ed34398cd795a9d42ac1a72
- https://cgit.freedesktop.org/libreoffice/core/commit/?id=bf16e836dd7094cb5679042bbd49cb8b49c869d2

Some examples of Calc tests moved to CppunitTest:
- https://cgit.freedesktop.org/libreoffice/core/commit/?id=55a97625c56d4b1bf6948628559f7e63d01d8333
- https://cgit.freedesktop.org/libreoffice/core/commit/?id=2af67c35d283abefe6030a5b90b831b0b797dd62
- https://cgit.freedesktop.org/libreoffice/core/commit/?id=056ba01ee95db5dfd7df362e72bb418893c4c530

of course, you don't need to run 'make' everything you want to test your code. You can use 'make CppunitTest_sw_uiwriter' or 'make CppunitTest_sc_uicalc' or even faster
make CppunitTest_sw_uiwriter CPPUNIT_TEST_NAME="<test_name>". eg: make CppunitTest_sw_uiwriter CPPUNIT_TEST_NAME="testTdf130746::TestBody"
Comment 2 Commit Notification 2020-04-17 12:00:44 UTC
Coming___soON committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/84993213de77efb47e65c6cf5e01ba50a8dbf378

tdf#131407: move UItest to CppunitTest

It will be available in 7.0.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Commit Notification 2021-01-07 14:25:35 UTC
diwanshu885 committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/572651b74e914e6bdbad2f4a00bf5a6f55905e4d

tdf131407 Move UItest to CppUnitTest

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2021-01-21 08:32:39 UTC
diwanshu885 committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4e6f0f39854e2a0e6c3ea6e9f5d80b2c9dcab3c6

tdf#131407: Move UITest to Cppunit

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Xisco Faulí 2022-07-14 14:09:22 UTC
I guess we can close it now