[Libreoffice-commits] core.git: writerperfect/CppunitTest_writerperfect_dialogs_test.mk writerperfect/Module_writerperfect.mk writerperfect/qa
Olivier Hallot (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jun 11 12:00:35 UTC 2020
writerperfect/CppunitTest_writerperfect_dialogs_test.mk | 68 ++++++++++++++
writerperfect/Module_writerperfect.mk | 4
writerperfect/qa/unit/data/writerperfect-dialogs-test.txt | 38 +++++++
writerperfect/qa/unit/writerperfect-dialogs-test.cxx | 58 +++++++++++
4 files changed, 168 insertions(+)
New commits:
commit 430a89fa4876a1ba4057f47c87d7882f11dc66b3
Author: Olivier Hallot <olivier.hallot at libreoffice.org>
AuthorDate: Wed May 27 18:22:35 2020 -0300
Commit: Olivier Hallot <olivier.hallot at libreoffice.org>
CommitDate: Thu Jun 11 13:59:54 2020 +0200
tdf#119114 Add writerperfect / epub screenshot
Create writerperfect screenshot
Change-Id: I59d33d7e60cbe7326f3ebd8fbe57e1a4545c31c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95008
Tested-by: Jenkins
Reviewed-by: Olivier Hallot <olivier.hallot at libreoffice.org>
diff --git a/writerperfect/CppunitTest_writerperfect_dialogs_test.mk b/writerperfect/CppunitTest_writerperfect_dialogs_test.mk
new file mode 100644
index 000000000000..1052d7700305
--- /dev/null
+++ b/writerperfect/CppunitTest_writerperfect_dialogs_test.mk
@@ -0,0 +1,68 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*************************************************************************
+#
+# 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_CppunitTest_CppunitScreenShot,writerperfect_dialogs_test))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,writerperfect_dialogs_test, \
+ writerperfect/qa/unit/writerperfect-dialogs-test \
+))
+
+$(eval $(call gb_CppunitTest_use_sdk_api,writerperfect_dialogs_test))
+
+$(eval $(call gb_CppunitTest_set_include,desktop_dialogs_test,\
+ -I$(SRCDIR)/writerperfect/inc \
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,writerperfect_dialogs_test, \
+ basegfx \
+ comphelper \
+ cppu \
+ cppuhelper \
+ drawinglayer \
+ editeng \
+ i18nlangtag \
+ i18nutil \
+ msfilter \
+ oox \
+ sal \
+ salhelper \
+ sax \
+ sfx \
+ sot \
+ svl \
+ svt \
+ test \
+ tl \
+ tk \
+ ucbhelper \
+ unotest \
+ utl \
+ vcl \
+ xo \
+))
+
+$(eval $(call gb_CppunitTest_use_external,writerperfect_dialogs_test,boost_headers))
+
+$(eval $(call gb_CppunitTest_use_sdk_api,writerperfect_dialogs_test))
+
+$(eval $(call gb_CppunitTest_use_ure,writerperfect_dialogs_test))
+$(eval $(call gb_CppunitTest_use_vcl_non_headless_with_windows,writerperfect_dialogs_test))
+
+$(eval $(call gb_CppunitTest_use_rdb,writerperfect_dialogs_test,services))
+
+$(eval $(call gb_CppunitTest_use_configuration,writerperfect_dialogs_test))
+
+$(eval $(call gb_CppunitTest_use_uiconfigs,writerperfect_dialogs_test,\
+ writerperfect \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/writerperfect/Module_writerperfect.mk b/writerperfect/Module_writerperfect.mk
index 01f8a0dc5e59..c24b0dd5bcc6 100644
--- a/writerperfect/Module_writerperfect.mk
+++ b/writerperfect/Module_writerperfect.mk
@@ -51,4 +51,8 @@ $(eval $(call gb_Module_add_uicheck_targets,writerperfect,\
UITest_writerperfect_epubexport \
))
+# screenshots
+$(eval $(call gb_Module_add_screenshot_targets,writerperfect,\
+ CppunitTest_writerperfect_dialogs_test \
+))
# vim: set noet sw=4 ts=4:
diff --git a/writerperfect/qa/unit/data/writerperfect-dialogs-test.txt b/writerperfect/qa/unit/data/writerperfect-dialogs-test.txt
new file mode 100644
index 000000000000..3a0cdf5cbb88
--- /dev/null
+++ b/writerperfect/qa/unit/data/writerperfect-dialogs-test.txt
@@ -0,0 +1,38 @@
+# -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+#
+# 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/.
+#
+
+# This file contains all dialogs that the unit tests in the module
+# will work on if it is in script mode. It will read one-by-one,
+# try to open it and create a screenshot that will be saved in
+# workdir/screenshots using the pattern of the ui-file name.
+#
+# Syntax:
+# - empty lines are allowed
+# - lines starting with '#' are treated as comment
+# - all other lines should contain a *.ui filename in the same
+# notation as in the dialog constructors (see code)
+
+#
+# The 'known' dialogs which have a hard-coded representation
+# in registerKnownDialogsByID/createDialogByID
+#
+
+# No known dialogs in writerperfect for now
+
+#
+# Dialogs without a hard-coded representation. These will
+# be visualized using a fallback based on VclBuilder
+#
+
+# currently deactivated, leads to problems and the test to not work
+# This is typically a hint that these should be hard-coded in the
+# test case since they need some document and model data to work
+
+writerperfect/ui/exportepub.ui
+#writerperfect/ui/wpfencodingdialog.ui
diff --git a/writerperfect/qa/unit/writerperfect-dialogs-test.cxx b/writerperfect/qa/unit/writerperfect-dialogs-test.cxx
new file mode 100644
index 000000000000..7dc5f9f08a04
--- /dev/null
+++ b/writerperfect/qa/unit/writerperfect-dialogs-test.cxx
@@ -0,0 +1,58 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+
+#include <sal/config.h>
+#include <test/screenshot_test.hxx>
+#include <vcl/abstdlg.hxx>
+
+using namespace ::com::sun::star;
+
+/// Test opening a dialog in writerperfect
+class WpfDialogsTest : public ScreenshotTest
+{
+private:
+ /// helper method to populate KnownDialogs, called in setUp(). Needs to be
+ /// written and has to add entries to KnownDialogs
+ virtual void registerKnownDialogsByID(mapType& rKnownDialogs) override;
+
+ /// dialog creation for known dialogs by ID. Has to be implemented for
+ /// each registered known dialog
+ virtual VclPtr<VclAbstractDialog> createDialogByID(sal_uInt32 nID) override;
+
+public:
+ WpfDialogsTest();
+
+ // try to open a dialog
+ void openAnyDialog();
+
+ CPPUNIT_TEST_SUITE(WpfDialogsTest);
+ CPPUNIT_TEST(openAnyDialog);
+ CPPUNIT_TEST_SUITE_END();
+};
+
+WpfDialogsTest::WpfDialogsTest() {}
+
+void WpfDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/)
+{
+ // fill map of known dialogs
+}
+
+VclPtr<VclAbstractDialog> WpfDialogsTest::createDialogByID(sal_uInt32 /*nID*/) { return nullptr; }
+
+void WpfDialogsTest::openAnyDialog()
+{
+ /// process input file containing the UXMLDescriptions of the dialogs to dump
+ processDialogBatchFile("writerperfect/qa/unit/data/writerperfect-dialogs-test.txt");
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(WpfDialogsTest);
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list