Kaydet (Commit) fb8377fe authored tarafından Laurent Godard's avatar Laurent Godard Kaydeden (comit) Miklos Vajna

unit test for tdf#91095

and ready for any docbook export tests

Change-Id: Ia1c7a5066fc72c502c3b0ebb5811910797943742
Reviewed-on: https://gerrit.libreoffice.org/15653Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst 2c798538
# -*- 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_docbookexport))
$(eval $(call gb_CppunitTest_add_exception_objects,sw_docbookexport, \
sw/qa/extras/docbookexport/docbookexport \
))
$(eval $(call gb_CppunitTest_use_libraries,sw_docbookexport, \
comphelper \
cppu \
cppuhelper \
i18nlangtag \
sal \
sw \
test \
tl \
unotest \
utl \
vcl \
$(gb_UWINAPI) \
))
$(eval $(call gb_CppunitTest_use_externals,sw_docbookexport,\
boost_headers \
libxml2 \
))
$(eval $(call gb_CppunitTest_set_include,sw_docbookexport,\
-I$(SRCDIR)/sw/inc \
-I$(SRCDIR)/sw/source/core/inc \
-I$(SRCDIR)/sw/source/uibase/inc \
-I$(SRCDIR)/sw/qa/extras/inc \
$$(INCLUDE) \
))
$(eval $(call gb_CppunitTest_use_api,sw_docbookexport,\
offapi \
udkapi \
))
$(eval $(call gb_CppunitTest_use_ure,sw_docbookexport))
$(eval $(call gb_CppunitTest_use_vcl,sw_docbookexport))
$(eval $(call gb_CppunitTest_use_rdb,sw_docbookexport,services))
$(eval $(call gb_CppunitTest_use_configuration,sw_docbookexport))
# vim: set noet sw=4 ts=4:
...@@ -48,6 +48,7 @@ endif ...@@ -48,6 +48,7 @@ endif
$(eval $(call gb_Module_add_slowcheck_targets,sw,\ $(eval $(call gb_Module_add_slowcheck_targets,sw,\
$(if $(and $(filter $(COM),MSC),$(MERGELIBS)),, \ $(if $(and $(filter $(COM),MSC),$(MERGELIBS)),, \
CppunitTest_sw_uwriter) \ CppunitTest_sw_uwriter) \
CppunitTest_sw_docbookexport \
CppunitTest_sw_htmlexport \ CppunitTest_sw_htmlexport \
CppunitTest_sw_htmlimport \ CppunitTest_sw_htmlimport \
CppunitTest_sw_macros_test \ CppunitTest_sw_macros_test \
......
/* -*- 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 <swmodule.hxx>
#include <swdll.hxx>
#include <usrpref.hxx>
#include <test/xmltesttools.hxx>
class DocbookExportTest : public SwModelTestBase
{
private:
FieldUnit m_eUnit;
public:
DocbookExportTest() :
SwModelTestBase("/sw/qa/extras/docbookexport/data/", "DocBook File"),
m_eUnit(FUNIT_NONE)
{}
};
#define DECLARE_DOCBOOKEXPORT_TEST(TestName, filename) DECLARE_SW_EXPORT_TEST(TestName, filename, DocbookExportTest)
DECLARE_DOCBOOKEXPORT_TEST(testsimple, "simple.docx")
{
xmlDocPtr pDoc = parseXml(maTempFile);
CPPUNIT_ASSERT(pDoc);
assertXPathContent(pDoc, "/article/para", "aaaa");
}
/* the test actually should crash with this file */
DECLARE_DOCBOOKEXPORT_TEST(testtdf91095, "tdf91095.docx")
{
xmlDocPtr pDoc = parseXml(maTempFile);
CPPUNIT_ASSERT(pDoc);
}
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment