Rebased ref, commits from common ancestor:
commit c4d42e0a37b761c5d35bd14ff4c395f13dde8553
Author:     Thorsten Behrens <[email protected]>
AuthorDate: Sun Feb 20 15:41:01 2022 +0100
Commit:     Thorsten Behrens <[email protected]>
CommitDate: Sun Feb 20 17:06:28 2022 +0100

    sw: add ODF-based feature test files
    
    Start with a set of very basic text processing features, where each
    test triggers one and only one high-level, user-visible feature
    (like rendering bold text).
    
    Change-Id: I08f66a67e8b5fe4af030415553c073242f965dfc

diff --git a/sw/CppunitTest_sw_odffeatures.mk b/sw/CppunitTest_sw_odffeatures.mk
new file mode 100644
index 000000000000..c1b6e562c4f9
--- /dev/null
+++ b/sw/CppunitTest_sw_odffeatures.mk
@@ -0,0 +1,64 @@
+# -*- 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_CppunitTest,sw_odffeatures))
+
+$(eval $(call gb_CppunitTest_use_common_precompiled_header,sw_odffeatures))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sw_odffeatures, \
+    sw/qa/extras/odffeatures/basicodffeatures \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sw_odffeatures, \
+    comphelper \
+    editeng \
+    cppu \
+    cppuhelper \
+    sal \
+       svt \
+       sfx \
+       svl \
+       sw \
+       swqahelper \
+    test \
+    unotest \
+    vcl \
+    tl \
+       utl \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,sw_odffeatures,\
+       boost_headers \
+    libxml2 \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sw_odffeatures,\
+    -I$(SRCDIR)/sw/inc \
+    -I$(SRCDIR)/sw/source/core/inc \
+    -I$(SRCDIR)/sw/source/uibase/inc \
+       -I$(SRCDIR)/sw/qa/inc \
+    $$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_api,sw_odffeatures,\
+       udkapi \
+       offapi \
+       oovbaapi \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,sw_odffeatures))
+$(eval $(call gb_CppunitTest_use_vcl,sw_odffeatures))
+
+$(eval $(call gb_CppunitTest_use_rdb,sw_odffeatures,services))
+
+$(eval $(call gb_CppunitTest_use_configuration,sw_odffeatures))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index baaafcbc5b76..701237c3348d 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -104,6 +104,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\
     CppunitTest_sw_odfexport \
     CppunitTest_sw_odfexport2 \
     CppunitTest_sw_odfimport \
+    CppunitTest_sw_odffeatures \
     CppunitTest_sw_txtexport \
     CppunitTest_sw_txtencexport \
     CppunitTest_sw_txtimport \
diff --git a/sw/qa/extras/odffeatures/basicodffeatures.cxx 
b/sw/qa/extras/odffeatures/basicodffeatures.cxx
new file mode 100644
index 000000000000..5fd26946ae43
--- /dev/null
+++ b/sw/qa/extras/odffeatures/basicodffeatures.cxx
@@ -0,0 +1,33 @@
+/* -*- 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 <swmodeltestbase.hxx>
+
+#include <config_features.h>
+
+class Test : public SwModelTestBase
+{
+    public:
+        Test() : SwModelTestBase("/sw/qa/extras/odffeatures/data/", "writer8") 
{}
+};
+
+CPPUNIT_TEST_FIXTURE(Test, loadPlainODT)
+{
+    load(mpTestDocumentPath, "text_plain.odt");
+    CPPUNIT_ASSERT_EQUAL( 1, getPages() );
+}
+
+CPPUNIT_TEST_FIXTURE(Test, loadBoldTextODT)
+{
+    load(mpTestDocumentPath, "text_bold.odt");
+    CPPUNIT_ASSERT_EQUAL( 1, getPages() );
+}
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/odffeatures/data/text_bold.odt 
b/sw/qa/extras/odffeatures/data/text_bold.odt
new file mode 100644
index 000000000000..d899017328b1
Binary files /dev/null and b/sw/qa/extras/odffeatures/data/text_bold.odt differ
diff --git a/sw/qa/extras/odffeatures/data/text_plain.odt 
b/sw/qa/extras/odffeatures/data/text_plain.odt
new file mode 100644
index 000000000000..fa55c4c4522d
Binary files /dev/null and b/sw/qa/extras/odffeatures/data/text_plain.odt differ

Reply via email to