[Libreoffice-commits] core.git: 6 commits - config_host/config_writerperfect.h.in configure.ac m4/libo_pkg_version.m4 writerperfect/CppunitTest_writerperfect_calc.mk writerperfect/CppunitTest_writerperfect_draw.mk writerperfect/CppunitTest_writerperfect_impress.mk writerperfect/CppunitTest_writerperfect_writer.mk writerperfect/qa writerperfect/source
David Tardon
dtardon at redhat.com
Thu Dec 17 14:05:34 PST 2015
config_host/config_writerperfect.h.in | 31 ++++++++++++
configure.ac | 13 +++--
m4/libo_pkg_version.m4 | 48 ++++++++++++++++++++
writerperfect/CppunitTest_writerperfect_calc.mk | 1
writerperfect/CppunitTest_writerperfect_draw.mk | 1
writerperfect/CppunitTest_writerperfect_impress.mk | 1
writerperfect/CppunitTest_writerperfect_writer.mk | 1
writerperfect/qa/unit/WpftCalcFilterTest.cxx | 7 ++
writerperfect/qa/unit/WpftDrawFilterTest.cxx | 13 +++++
writerperfect/qa/unit/WpftImportTestBase.cxx | 20 ++++++++
writerperfect/qa/unit/WpftImportTestBase.hxx | 26 ++++++++++
writerperfect/qa/unit/WpftImpressFilterTest.cxx | 15 +++++-
writerperfect/qa/unit/WpftWriterFilterTest.cxx | 27 +++++++++--
writerperfect/source/writer/MSWorksImportFilter.cxx | 2
14 files changed, 193 insertions(+), 13 deletions(-)
New commits:
commit 22d0a7bf86da9e795b1bcedae9e18f18245dc2fe
Author: David Tardon <dtardon at redhat.com>
Date: Thu Dec 17 15:44:43 2015 +0100
do not require newest libe-book for build
Change-Id: I4be3de970eabf00fd73b466adc15b6a84528a2d1
diff --git a/config_host/config_writerperfect.h.in b/config_host/config_writerperfect.h.in
index 0ce167d..b42b3a7 100644
--- a/config_host/config_writerperfect.h.in
+++ b/config_host/config_writerperfect.h.in
@@ -12,6 +12,10 @@
* version.
*/
+#undef EBOOK_VERSION_MAJOR
+#undef EBOOK_VERSION_MINOR
+#undef EBOOK_VERSION_MICRO
+
#undef ETONYEK_VERSION_MAJOR
#undef ETONYEK_VERSION_MINOR
#undef ETONYEK_VERSION_MICRO
diff --git a/configure.ac b/configure.ac
index 2a9dfb7..ce6d9cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7702,7 +7702,8 @@ libo_CHECK_SYSTEM_MODULE([librevenge],[REVENGE],[librevenge-0.0 >= 0.0.1],["-I${
dnl ===================================================================
dnl Check for system libe-book
dnl ===================================================================
-libo_CHECK_SYSTEM_MODULE([libebook],[EBOOK],[libe-book-0.1 >= 0.1.1])
+libo_CHECK_SYSTEM_MODULE([libebook],[EBOOK],[libe-book-0.1])
+libo_PKG_VERSION([EBOOK], [libe-book-0.1], [0.1.2])
dnl ===================================================================
dnl Check for system libetonyek
diff --git a/writerperfect/qa/unit/WpftImportTestBase.hxx b/writerperfect/qa/unit/WpftImportTestBase.hxx
index 514561f..7e20987 100644
--- a/writerperfect/qa/unit/WpftImportTestBase.hxx
+++ b/writerperfect/qa/unit/WpftImportTestBase.hxx
@@ -29,6 +29,9 @@
((minor) > (req_minor) \
|| ((minor) == (req_minor) && ((micro) >= (req_micro)))))
+#define REQUIRE_EBOOK_VERSION(major, minor, micro) \
+ REQUIRE_VERSION(EBOOK_VERSION_MAJOR, EBOOK_VERSION_MINOR, EBOOK_VERSION_MICRO, major, minor, micro)
+
#define REQUIRE_ETONYEK_VERSION(major, minor, micro) \
REQUIRE_VERSION(ETONYEK_VERSION_MAJOR, ETONYEK_VERSION_MINOR, ETONYEK_VERSION_MICRO, major, minor, micro)
diff --git a/writerperfect/qa/unit/WpftWriterFilterTest.cxx b/writerperfect/qa/unit/WpftWriterFilterTest.cxx
index 4de3ea6..9e8bd02 100644
--- a/writerperfect/qa/unit/WpftWriterFilterTest.cxx
+++ b/writerperfect/qa/unit/WpftWriterFilterTest.cxx
@@ -31,6 +31,10 @@ WpftWriterFilterTest::WpftWriterFilterTest()
void WpftWriterFilterTest::test()
{
+ const writerperfect::test::WpftOptionalMap_t aEBookOptional
+ {
+ {"FictionBook2.fb2.zip", REQUIRE_EBOOK_VERSION(0, 1, 1)},
+ };
const writerperfect::test::WpftOptionalMap_t aEtonyekOptional
{
{"Pages_4.pages", REQUIRE_ETONYEK_VERSION(0, 1, 2)},
@@ -47,8 +51,8 @@ void WpftWriterFilterTest::test()
};
doTest("com.sun.star.comp.Writer.AbiWordImportFilter", "/writerperfect/qa/unit/data/writer/libabw/");
- doTest("org.libreoffice.comp.Writer.EBookImportFilter", "/writerperfect/qa/unit/data/writer/libe-book/");
- doTest("com.sun.star.comp.Writer.MSWorksImportFilter", "/writerperfect/qa/unit/data/writer/libwps/");
+ doTest("org.libreoffice.comp.Writer.EBookImportFilter", "/writerperfect/qa/unit/data/writer/libe-book/", aEBookOptional);
+ doTest("com.sun.star.comp.Writer.MSWorksImportFilter", "/writerperfect/qa/unit/data/writer/libwps/", aWpsOptional);
doTest("com.sun.star.comp.Writer.MWAWImportFilter", "/writerperfect/qa/unit/data/writer/libmwaw/", aMWAWOptional);
doTest("org.libreoffice.comp.Writer.PagesImportFilter", "/writerperfect/qa/unit/data/writer/libetonyek/", aEtonyekOptional);
doTest("com.sun.star.comp.Writer.WordPerfectImportFilter", "/writerperfect/qa/unit/data/writer/libwpd/");
commit 36b087f8b04ea46428a2c20e26d4230e59cdfd4d
Author: David Tardon <dtardon at redhat.com>
Date: Thu Dec 17 15:43:24 2015 +0100
do not require newest libwps for build
Change-Id: Iba0090da0591b6f9a6d74bb18ebaabef53448063
diff --git a/config_host/config_writerperfect.h.in b/config_host/config_writerperfect.h.in
index df10014..0ce167d 100644
--- a/config_host/config_writerperfect.h.in
+++ b/config_host/config_writerperfect.h.in
@@ -20,4 +20,8 @@
#undef MWAW_VERSION_MINOR
#undef MWAW_VERSION_MICRO
+#undef WPS_VERSION_MAJOR
+#undef WPS_VERSION_MINOR
+#undef WPS_VERSION_MICRO
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configure.ac b/configure.ac
index 7590a70..2a9dfb7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7827,7 +7827,8 @@ libo_CHECK_SYSTEM_MODULE([libabw],[ABW],[libabw-0.1])
dnl ===================================================================
dnl Check for system libwps
dnl ===================================================================
-libo_CHECK_SYSTEM_MODULE([libwps],[WPS],[libwps-0.4 >= 0.4.2])
+libo_CHECK_SYSTEM_MODULE([libwps],[WPS],[libwps-0.4])
+libo_PKG_VERSION([WPS], [libwps-0.4], [0.4.2])
dnl ===================================================================
dnl Check for system libwpg
diff --git a/writerperfect/qa/unit/WpftImportTestBase.hxx b/writerperfect/qa/unit/WpftImportTestBase.hxx
index e545103..514561f 100644
--- a/writerperfect/qa/unit/WpftImportTestBase.hxx
+++ b/writerperfect/qa/unit/WpftImportTestBase.hxx
@@ -35,6 +35,9 @@
#define REQUIRE_MWAW_VERSION(major, minor, micro) \
REQUIRE_VERSION(MWAW_VERSION_MAJOR, MWAW_VERSION_MINOR, MWAW_VERSION_MICRO, major, minor, micro)
+#define REQUIRE_WPS_VERSION(major, minor, micro) \
+ REQUIRE_VERSION(WPS_VERSION_MAJOR, WPS_VERSION_MINOR, WPS_VERSION_MICRO, major, minor, micro)
+
namespace com
{
namespace sun
diff --git a/writerperfect/qa/unit/WpftWriterFilterTest.cxx b/writerperfect/qa/unit/WpftWriterFilterTest.cxx
index 7b4fd74..4de3ea6 100644
--- a/writerperfect/qa/unit/WpftWriterFilterTest.cxx
+++ b/writerperfect/qa/unit/WpftWriterFilterTest.cxx
@@ -41,6 +41,10 @@ void WpftWriterFilterTest::test()
{"RagTime_3.2.hqx", REQUIRE_MWAW_VERSION(0, 3, 2)},
{"RagTime_5.5.rag", REQUIRE_MWAW_VERSION(0, 3, 6)},
};
+ const writerperfect::test::WpftOptionalMap_t aWpsOptional
+ {
+ {"Write_3.1.wri", REQUIRE_WPS_VERSION(0, 4, 2)},
+ };
doTest("com.sun.star.comp.Writer.AbiWordImportFilter", "/writerperfect/qa/unit/data/writer/libabw/");
doTest("org.libreoffice.comp.Writer.EBookImportFilter", "/writerperfect/qa/unit/data/writer/libe-book/");
diff --git a/writerperfect/source/writer/MSWorksImportFilter.cxx b/writerperfect/source/writer/MSWorksImportFilter.cxx
index 42bd1cd..f787d52 100644
--- a/writerperfect/source/writer/MSWorksImportFilter.cxx
+++ b/writerperfect/source/writer/MSWorksImportFilter.cxx
@@ -55,7 +55,7 @@ bool MSWorksImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput,
else if (pDlg->hasUserCalledCancel())
return false;
}
- else if ((kind == libwps::WPS_TEXT) && (creator == libwps::WPS_MSWRITE) && (confidence == libwps::WPS_CONFIDENCE_EXCELLENT) && needEncoding)
+ else if ((kind == libwps::WPS_TEXT) && (creator == libwps::WPS_RESERVED_0) && (confidence == libwps::WPS_CONFIDENCE_EXCELLENT) && needEncoding)
{
const ScopedVclPtrInstance<writerperfect::WPFTEncodingDialog> pDlg(
"Import MsWrite files(libwps)", "CP1252");
commit 3fd652b3de435e85d91154352f9a2029fd47b2d4
Author: David Tardon <dtardon at redhat.com>
Date: Thu Dec 17 14:00:17 2015 +0100
do not require newest libmwaw for build
Change-Id: Ic0f9e47c2128b74deb0a948c1853afb13ae5fd1d
diff --git a/config_host/config_writerperfect.h.in b/config_host/config_writerperfect.h.in
index fea81dd..df10014 100644
--- a/config_host/config_writerperfect.h.in
+++ b/config_host/config_writerperfect.h.in
@@ -16,4 +16,8 @@
#undef ETONYEK_VERSION_MINOR
#undef ETONYEK_VERSION_MICRO
+#undef MWAW_VERSION_MAJOR
+#undef MWAW_VERSION_MINOR
+#undef MWAW_VERSION_MICRO
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configure.ac b/configure.ac
index e2da4e3..7590a70 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7733,7 +7733,8 @@ libo_CHECK_SYSTEM_MODULE([libmspub],[MSPUB],[libmspub-0.1])
dnl ===================================================================
dnl Check for system libmwaw
dnl ===================================================================
-libo_CHECK_SYSTEM_MODULE([libmwaw],[MWAW],[libmwaw-0.3 >= 0.3.6])
+libo_CHECK_SYSTEM_MODULE([libmwaw],[MWAW],[libmwaw-0.3 >= 0.3.1])
+libo_PKG_VERSION([MWAW], [libmwaw-0.3], [0.3.7])
dnl ===================================================================
dnl Check for system libpagemaker
diff --git a/writerperfect/qa/unit/WpftDrawFilterTest.cxx b/writerperfect/qa/unit/WpftDrawFilterTest.cxx
index 8ae087c..56eebec 100644
--- a/writerperfect/qa/unit/WpftDrawFilterTest.cxx
+++ b/writerperfect/qa/unit/WpftDrawFilterTest.cxx
@@ -31,11 +31,22 @@ WpftDrawFilterTest::WpftDrawFilterTest()
void WpftDrawFilterTest::test()
{
+ const writerperfect::test::WpftOptionalMap_t aMWAWOptional
+ {
+ {"ClarisDraw.hqx", REQUIRE_MWAW_VERSION(0, 3, 5)},
+ {"MacDraft_1.0.hqx", REQUIRE_MWAW_VERSION(0, 3, 5)},
+ {"MacDraft_5.5.drw", REQUIRE_MWAW_VERSION(0, 3, 6)},
+ {"MacDraw_0.hqx", REQUIRE_MWAW_VERSION(0, 3, 2)},
+ {"MacDraw_1.hqx", REQUIRE_MWAW_VERSION(0, 3, 2)},
+ {"MacDraw_II.hqx", REQUIRE_MWAW_VERSION(0, 3, 3)},
+ {"MacDraw_Pro_1.0.hqx", REQUIRE_MWAW_VERSION(0, 3, 4)},
+ };
+
doTest("com.sun.star.comp.Draw.CDRImportFilter", "/writerperfect/qa/unit/data/draw/libcdr/");
doTest("com.sun.star.comp.Draw.CMXImportFilter", "/writerperfect/qa/unit/data/draw/libcdr-cmx/");
doTest("com.sun.star.comp.Draw.FreehandImportFilter", "/writerperfect/qa/unit/data/draw/libfreehand/");
doTest("com.sun.star.comp.Draw.MSPUBImportFilter", "/writerperfect/qa/unit/data/draw/libmspub/");
- doTest("com.sun.star.comp.Draw.MWAWDrawImportFilter", "/writerperfect/qa/unit/data/draw/libmwaw/");
+ doTest("com.sun.star.comp.Draw.MWAWDrawImportFilter", "/writerperfect/qa/unit/data/draw/libmwaw/", aMWAWOptional);
doTest("com.sun.star.comp.Draw.VisioImportFilter", "/writerperfect/qa/unit/data/draw/libvisio/");
doTest("com.sun.star.comp.Draw.WPGImportFilter", "/writerperfect/qa/unit/data/draw/libwpg/");
doTest("org.libreoffice.comp.Draw.PageMakerImportFilter", "/writerperfect/qa/unit/data/draw/libpagemaker/");
diff --git a/writerperfect/qa/unit/WpftImportTestBase.hxx b/writerperfect/qa/unit/WpftImportTestBase.hxx
index 1d83586..e545103 100644
--- a/writerperfect/qa/unit/WpftImportTestBase.hxx
+++ b/writerperfect/qa/unit/WpftImportTestBase.hxx
@@ -32,6 +32,9 @@
#define REQUIRE_ETONYEK_VERSION(major, minor, micro) \
REQUIRE_VERSION(ETONYEK_VERSION_MAJOR, ETONYEK_VERSION_MINOR, ETONYEK_VERSION_MICRO, major, minor, micro)
+#define REQUIRE_MWAW_VERSION(major, minor, micro) \
+ REQUIRE_VERSION(MWAW_VERSION_MAJOR, MWAW_VERSION_MINOR, MWAW_VERSION_MICRO, major, minor, micro)
+
namespace com
{
namespace sun
diff --git a/writerperfect/qa/unit/WpftImpressFilterTest.cxx b/writerperfect/qa/unit/WpftImpressFilterTest.cxx
index ec16a11..579fb9a 100644
--- a/writerperfect/qa/unit/WpftImpressFilterTest.cxx
+++ b/writerperfect/qa/unit/WpftImpressFilterTest.cxx
@@ -37,9 +37,13 @@ void WpftImpressFilterTest::test()
{"v3.zip", REQUIRE_ETONYEK_VERSION(0, 1, 1)},
{"v6.zip", REQUIRE_ETONYEK_VERSION(0, 1, 4)},
};
+ const writerperfect::test::WpftOptionalMap_t aMWAWOptional
+ {
+ {"ClarisWorks_6.0.cwk", REQUIRE_MWAW_VERSION(0, 3, 3)},
+ };
doTest("org.libreoffice.comp.Impress.KeynoteImportFilter", "/writerperfect/qa/unit/data/impress/libetonyek/", aEtonyekOptional);
- doTest("com.sun.star.comp.Impress.MWAWPresentationImportFilter", "/writerperfect/qa/unit/data/impress/libmwaw/");
+ doTest("com.sun.star.comp.Impress.MWAWPresentationImportFilter", "/writerperfect/qa/unit/data/impress/libmwaw/", aMWAWOptional);
}
CPPUNIT_TEST_SUITE_REGISTRATION(WpftImpressFilterTest);
diff --git a/writerperfect/qa/unit/WpftWriterFilterTest.cxx b/writerperfect/qa/unit/WpftWriterFilterTest.cxx
index a72b206..7b4fd74 100644
--- a/writerperfect/qa/unit/WpftWriterFilterTest.cxx
+++ b/writerperfect/qa/unit/WpftWriterFilterTest.cxx
@@ -35,11 +35,17 @@ void WpftWriterFilterTest::test()
{
{"Pages_4.pages", REQUIRE_ETONYEK_VERSION(0, 1, 2)},
};
+ const writerperfect::test::WpftOptionalMap_t aMWAWOptional
+ {
+ {"RagTime_2.1.hqx", REQUIRE_MWAW_VERSION(0, 3, 2)},
+ {"RagTime_3.2.hqx", REQUIRE_MWAW_VERSION(0, 3, 2)},
+ {"RagTime_5.5.rag", REQUIRE_MWAW_VERSION(0, 3, 6)},
+ };
doTest("com.sun.star.comp.Writer.AbiWordImportFilter", "/writerperfect/qa/unit/data/writer/libabw/");
doTest("org.libreoffice.comp.Writer.EBookImportFilter", "/writerperfect/qa/unit/data/writer/libe-book/");
doTest("com.sun.star.comp.Writer.MSWorksImportFilter", "/writerperfect/qa/unit/data/writer/libwps/");
- doTest("com.sun.star.comp.Writer.MWAWImportFilter", "/writerperfect/qa/unit/data/writer/libmwaw/");
+ doTest("com.sun.star.comp.Writer.MWAWImportFilter", "/writerperfect/qa/unit/data/writer/libmwaw/", aMWAWOptional);
doTest("org.libreoffice.comp.Writer.PagesImportFilter", "/writerperfect/qa/unit/data/writer/libetonyek/", aEtonyekOptional);
doTest("com.sun.star.comp.Writer.WordPerfectImportFilter", "/writerperfect/qa/unit/data/writer/libwpd/");
}
commit 71f92e9a6959b2b468aa4310633e4785d4bd0ea0
Author: David Tardon <dtardon at redhat.com>
Date: Thu Dec 17 13:16:29 2015 +0100
do not require newest libetonyek for build
Change-Id: I6e023cd25a1481dd18e3a16b8756c43dde4560ce
diff --git a/config_host/config_writerperfect.h.in b/config_host/config_writerperfect.h.in
index 4331b4f..fea81dd 100644
--- a/config_host/config_writerperfect.h.in
+++ b/config_host/config_writerperfect.h.in
@@ -12,4 +12,8 @@
* version.
*/
+#undef ETONYEK_VERSION_MAJOR
+#undef ETONYEK_VERSION_MINOR
+#undef ETONYEK_VERSION_MICRO
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configure.ac b/configure.ac
index e0bec55..e2da4e3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7707,7 +7707,8 @@ libo_CHECK_SYSTEM_MODULE([libebook],[EBOOK],[libe-book-0.1 >= 0.1.1])
dnl ===================================================================
dnl Check for system libetonyek
dnl ===================================================================
-libo_CHECK_SYSTEM_MODULE([libetonyek],[ETONYEK],[libetonyek-0.1 >= 0.1.4])
+libo_CHECK_SYSTEM_MODULE([libetonyek],[ETONYEK],[libetonyek-0.1])
+libo_PKG_VERSION([ETONYEK], [libetonyek-0.1], [0.1.5])
dnl ===================================================================
dnl Check for system libfreehand
diff --git a/writerperfect/qa/unit/WpftCalcFilterTest.cxx b/writerperfect/qa/unit/WpftCalcFilterTest.cxx
index 40d1ace..848f7e2 100644
--- a/writerperfect/qa/unit/WpftCalcFilterTest.cxx
+++ b/writerperfect/qa/unit/WpftCalcFilterTest.cxx
@@ -31,9 +31,14 @@ WpftCalcFilterTest::WpftCalcFilterTest()
void WpftCalcFilterTest::test()
{
+ const writerperfect::test::WpftOptionalMap_t aEtonyekOptional
+ {
+ {"Numbers_2.numbers", REQUIRE_ETONYEK_VERSION(0, 1, 2)},
+ };
+
doTest("com.sun.star.comp.Calc.MWAWCalcImportFilter", "/writerperfect/qa/unit/data/calc/libmwaw/");
doTest("com.sun.star.comp.Calc.MSWorksCalcImportFilter", "/writerperfect/qa/unit/data/calc/libwps/");
- doTest("org.libreoffice.comp.Calc.NumbersImportFilter", "/writerperfect/qa/unit/data/calc/libetonyek/");
+ doTest("org.libreoffice.comp.Calc.NumbersImportFilter", "/writerperfect/qa/unit/data/calc/libetonyek/", aEtonyekOptional);
}
CPPUNIT_TEST_SUITE_REGISTRATION(WpftCalcFilterTest);
diff --git a/writerperfect/qa/unit/WpftImportTestBase.hxx b/writerperfect/qa/unit/WpftImportTestBase.hxx
index 4689f98..1d83586 100644
--- a/writerperfect/qa/unit/WpftImportTestBase.hxx
+++ b/writerperfect/qa/unit/WpftImportTestBase.hxx
@@ -29,6 +29,9 @@
((minor) > (req_minor) \
|| ((minor) == (req_minor) && ((micro) >= (req_micro)))))
+#define REQUIRE_ETONYEK_VERSION(major, minor, micro) \
+ REQUIRE_VERSION(ETONYEK_VERSION_MAJOR, ETONYEK_VERSION_MINOR, ETONYEK_VERSION_MICRO, major, minor, micro)
+
namespace com
{
namespace sun
diff --git a/writerperfect/qa/unit/WpftImpressFilterTest.cxx b/writerperfect/qa/unit/WpftImpressFilterTest.cxx
index 1b5590a..ec16a11 100644
--- a/writerperfect/qa/unit/WpftImpressFilterTest.cxx
+++ b/writerperfect/qa/unit/WpftImpressFilterTest.cxx
@@ -31,7 +31,14 @@ WpftImpressFilterTest::WpftImpressFilterTest()
void WpftImpressFilterTest::test()
{
- doTest("org.libreoffice.comp.Impress.KeynoteImportFilter", "/writerperfect/qa/unit/data/impress/libetonyek/");
+ const writerperfect::test::WpftOptionalMap_t aEtonyekOptional
+ {
+ {"v2.zip", REQUIRE_ETONYEK_VERSION(0, 1, 1)},
+ {"v3.zip", REQUIRE_ETONYEK_VERSION(0, 1, 1)},
+ {"v6.zip", REQUIRE_ETONYEK_VERSION(0, 1, 4)},
+ };
+
+ doTest("org.libreoffice.comp.Impress.KeynoteImportFilter", "/writerperfect/qa/unit/data/impress/libetonyek/", aEtonyekOptional);
doTest("com.sun.star.comp.Impress.MWAWPresentationImportFilter", "/writerperfect/qa/unit/data/impress/libmwaw/");
}
diff --git a/writerperfect/qa/unit/WpftWriterFilterTest.cxx b/writerperfect/qa/unit/WpftWriterFilterTest.cxx
index f8f9f85..a72b206 100644
--- a/writerperfect/qa/unit/WpftWriterFilterTest.cxx
+++ b/writerperfect/qa/unit/WpftWriterFilterTest.cxx
@@ -31,11 +31,16 @@ WpftWriterFilterTest::WpftWriterFilterTest()
void WpftWriterFilterTest::test()
{
+ const writerperfect::test::WpftOptionalMap_t aEtonyekOptional
+ {
+ {"Pages_4.pages", REQUIRE_ETONYEK_VERSION(0, 1, 2)},
+ };
+
doTest("com.sun.star.comp.Writer.AbiWordImportFilter", "/writerperfect/qa/unit/data/writer/libabw/");
doTest("org.libreoffice.comp.Writer.EBookImportFilter", "/writerperfect/qa/unit/data/writer/libe-book/");
doTest("com.sun.star.comp.Writer.MSWorksImportFilter", "/writerperfect/qa/unit/data/writer/libwps/");
doTest("com.sun.star.comp.Writer.MWAWImportFilter", "/writerperfect/qa/unit/data/writer/libmwaw/");
- doTest("org.libreoffice.comp.Writer.PagesImportFilter", "/writerperfect/qa/unit/data/writer/libetonyek/");
+ doTest("org.libreoffice.comp.Writer.PagesImportFilter", "/writerperfect/qa/unit/data/writer/libetonyek/", aEtonyekOptional);
doTest("com.sun.star.comp.Writer.WordPerfectImportFilter", "/writerperfect/qa/unit/data/writer/libwpd/");
}
commit ddbba41b39399644b1ce7008d8922998446411e7
Author: David Tardon <dtardon at redhat.com>
Date: Thu Dec 17 13:06:20 2015 +0100
allow to skip import tests based on library version
That way we don't have to require the newest version for build just to
run tests.
Change-Id: I4f91828a13821b235004ff16a69043d6d43686c1
diff --git a/config_host/config_writerperfect.h.in b/config_host/config_writerperfect.h.in
new file mode 100644
index 0000000..4331b4f
--- /dev/null
+++ b/config_host/config_writerperfect.h.in
@@ -0,0 +1,15 @@
+/* -*- 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/.
+ */
+
+/* Configuration for versions of import libraries used by writerperfect.
+ * This is needed to skip test files that are not supported by the used
+ * version.
+ */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configure.ac b/configure.ac
index 79625e2..e0bec55 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12916,6 +12916,7 @@ AC_CONFIG_HEADERS([config_host/config_version.h])
AC_CONFIG_HEADERS([config_host/config_oauth2.h])
AC_CONFIG_HEADERS([config_host/config_poppler.h])
AC_CONFIG_HEADERS([config_host/config_python.h])
+AC_CONFIG_HEADERS([config_host/config_writerperfect.h])
AC_OUTPUT
if test "$CROSS_COMPILING" = TRUE; then
diff --git a/writerperfect/CppunitTest_writerperfect_calc.mk b/writerperfect/CppunitTest_writerperfect_calc.mk
index 75716b3..db0212a 100644
--- a/writerperfect/CppunitTest_writerperfect_calc.mk
+++ b/writerperfect/CppunitTest_writerperfect_calc.mk
@@ -24,6 +24,7 @@ $(eval $(call gb_CppunitTest_use_libraries,writerperfect_calc,\
cppuhelper \
sal \
test \
+ tl \
ucbhelper \
unotest \
$(gb_UWINAPI) \
diff --git a/writerperfect/CppunitTest_writerperfect_draw.mk b/writerperfect/CppunitTest_writerperfect_draw.mk
index fac4476..232ef34 100644
--- a/writerperfect/CppunitTest_writerperfect_draw.mk
+++ b/writerperfect/CppunitTest_writerperfect_draw.mk
@@ -24,6 +24,7 @@ $(eval $(call gb_CppunitTest_use_libraries,writerperfect_draw,\
cppuhelper \
sal \
test \
+ tl \
ucbhelper \
unotest \
$(gb_UWINAPI) \
diff --git a/writerperfect/CppunitTest_writerperfect_impress.mk b/writerperfect/CppunitTest_writerperfect_impress.mk
index 4da810c..1c3bb7a 100644
--- a/writerperfect/CppunitTest_writerperfect_impress.mk
+++ b/writerperfect/CppunitTest_writerperfect_impress.mk
@@ -24,6 +24,7 @@ $(eval $(call gb_CppunitTest_use_libraries,writerperfect_impress,\
cppuhelper \
sal \
test \
+ tl \
ucbhelper \
unotest \
$(gb_UWINAPI) \
diff --git a/writerperfect/CppunitTest_writerperfect_writer.mk b/writerperfect/CppunitTest_writerperfect_writer.mk
index 0c3e615..ca0ee0a 100644
--- a/writerperfect/CppunitTest_writerperfect_writer.mk
+++ b/writerperfect/CppunitTest_writerperfect_writer.mk
@@ -24,6 +24,7 @@ $(eval $(call gb_CppunitTest_use_libraries,writerperfect_writer,\
cppuhelper \
sal \
test \
+ tl \
ucbhelper \
unotest \
$(gb_UWINAPI) \
diff --git a/writerperfect/qa/unit/WpftImportTestBase.cxx b/writerperfect/qa/unit/WpftImportTestBase.cxx
index 874b4d6..8b66c3b 100644
--- a/writerperfect/qa/unit/WpftImportTestBase.cxx
+++ b/writerperfect/qa/unit/WpftImportTestBase.cxx
@@ -24,6 +24,8 @@
#include <com/sun/star/ucb/XContent.hpp>
#include <com/sun/star/util/XCloseable.hpp>
+#include <tools/urlobj.hxx>
+
#include <ucbhelper/content.hxx>
#include "WpftImportTestBase.hxx"
@@ -50,6 +52,7 @@ WpftImportTestBase::WpftImportTestBase(const rtl::OUString &rFactoryURL)
, m_xDesktop()
, m_xFilter()
, m_xTypeMap()
+ , m_pOptionalMap(nullptr)
{
}
@@ -75,6 +78,15 @@ void WpftImportTestBase::tearDown()
bool WpftImportTestBase::load(const OUString &, const OUString &rURL, const OUString &,
SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
+ if (m_pOptionalMap)
+ {
+ // first check if this test file is supported by the used version of the library
+ const INetURLObject aUrl(rURL);
+ const WpftOptionalMap_t::const_iterator it(m_pOptionalMap->find(aUrl.getName()));
+ if ((it != m_pOptionalMap->end()) && !it->second)
+ return true; // skip the file
+ }
+
// create an empty frame
const uno::Reference<lang::XComponent> xDoc(
m_xDesktop->loadComponentFromURL(m_aFactoryURL, "_blank", 0, uno::Sequence<beans::PropertyValue>()),
@@ -163,6 +175,14 @@ void WpftImportTestBase::doTest(const rtl::OUString &rFilter, const rtl::OUStrin
testDir(OUString(), getURLFromSrc(rPath), OUString());
}
+void WpftImportTestBase::doTest(const rtl::OUString &rFilter, const rtl::OUString &rPath, const WpftOptionalMap_t &rOptionalMap)
+{
+ m_xFilter.set(m_xFactory->createInstanceWithContext(rFilter, m_xContext), uno::UNO_QUERY_THROW);
+ m_pOptionalMap = &rOptionalMap;
+ testDir(OUString(), getURLFromSrc(rPath), OUString());
+ m_pOptionalMap = nullptr;
+}
+
void WpftImportTestBase::impl_detectFilterName(uno::Sequence<beans::PropertyValue> &rDescriptor, const rtl::OUString &rTypeName)
{
const sal_Int32 nDescriptorLen = rDescriptor.getLength();
diff --git a/writerperfect/qa/unit/WpftImportTestBase.hxx b/writerperfect/qa/unit/WpftImportTestBase.hxx
index 43e1bf1..4689f98 100644
--- a/writerperfect/qa/unit/WpftImportTestBase.hxx
+++ b/writerperfect/qa/unit/WpftImportTestBase.hxx
@@ -10,6 +10,10 @@
#ifndef INCLUDED_WRITERPERFECT_QA_UNIT_WPFTIMPORTTESTBASE_HXX
#define INCLUDED_WRITERPERFECT_QA_UNIT_WPFTIMPORTTESTBASE_HXX
+#include "config_writerperfect.h"
+
+#include <unordered_map>
+
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/Sequence.hxx>
@@ -19,6 +23,12 @@
#include <unotest/filters-test.hxx>
+#define REQUIRE_VERSION(major, minor, micro, req_major, req_minor, req_micro) \
+ (major) > (req_major) || \
+ ((major) == (req_major) && \
+ ((minor) > (req_minor) \
+ || ((minor) == (req_minor) && ((micro) >= (req_micro)))))
+
namespace com
{
namespace sun
@@ -54,6 +64,8 @@ namespace writerperfect
namespace test
{
+typedef std::unordered_map<rtl::OUString, bool, rtl::OUStringHash> WpftOptionalMap_t;
+
class WpftImportTestBase
: public ::test::FiltersTest
, public ::test::BootstrapFixture
@@ -66,6 +78,7 @@ public:
protected:
void doTest(const rtl::OUString &rFilter, const rtl::OUString &rPath);
+ void doTest(const rtl::OUString &rFilter, const rtl::OUString &rPath, const WpftOptionalMap_t &rOptionalMap);
private:
virtual bool load(const OUString &, const OUString &rURL, const OUString &,
@@ -79,6 +92,7 @@ private:
css::uno::Reference<css::ucb::XSimpleFileAccess> m_xFileAccess;
css::uno::Reference<css::document::XFilter> m_xFilter;
css::uno::Reference<css::container::XNameAccess> m_xTypeMap;
+ const WpftOptionalMap_t *m_pOptionalMap;
};
}
commit bc0f3f0df24b05d749481ca99e5251546611aaf4
Author: David Tardon <dtardon at redhat.com>
Date: Wed Dec 16 17:55:11 2015 +0100
add support for version detection of libs
Change-Id: Id5f84306926b6c28bef0d213aba151d8834b7b2d
diff --git a/m4/libo_pkg_version.m4 b/m4/libo_pkg_version.m4
new file mode 100644
index 0000000..c004b92
--- /dev/null
+++ b/m4/libo_pkg_version.m4
@@ -0,0 +1,48 @@
+dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; fill-column: 102 -*-
+#
+# 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/.
+#
+
+m4_define([_libo_define_pkg_version], [
+ save_IFS="$IFS"
+ IFS=.
+ echo "$ver" | while read major minor micro; do
+ AC_DEFINE_UNQUOTED([$1_VERSION_MAJOR], [$major])
+ AC_DEFINE_UNQUOTED([$1_VERSION_MINOR], [$minor])
+ AC_DEFINE_UNQUOTED([$1_VERSION_MICRO], [$micro])
+ done
+ IFS="$save_IFS"
+])
+
+m4_define([_libo_define_pkg_version_direct], [
+ AC_DEFINE([$1_VERSION_MAJOR], [$2])
+ AC_DEFINE([$1_VERSION_MINOR], [$3])
+ AC_DEFINE([$1_VERSION_MICRO], [$4])
+])
+
+# libo_PKG_VERSION(VARIABLE-STEM, MODULE, BUNDLED-VERSION)
+AC_DEFUN([libo_PKG_VERSION], [
+ AS_IF([test -n "$SYSTEM_$1"], [
+ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+ AC_MSG_CHECKING([for $1 version])
+ AS_IF([test -n "$PKG_CONFIG"], [
+ ver=`$PKG_CONFIG --modversion "$2"`
+ AS_IF([test -n "$ver"], [
+ AC_MSG_RESULT([$ver])
+ _libo_define_pkg_version([$1], [$ver])
+ ], [
+ AC_MSG_ERROR([not found])
+ ])
+ ], [
+ AC_MSG_ERROR([not found])
+ ])
+ ], [
+ _libo_define_pkg_version_direct([$1], m4_translit([$3], [.], [,]))
+ ])
+])
+
+dnl vim:set shiftwidth=4 softtabstop=4 expandtab:
More information about the Libreoffice-commits
mailing list