summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-06-22 18:34:01 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2018-06-29 12:59:30 +0200
commite8b1dab67fd041103546e5427dd75b40ddb0431a (patch)
treea1109aeaf7f30a59dab2c64c4322bd7caabdffc1 /test
parent0a182c2841fa48029bfd66814f2fa4cb59e907d3 (diff)
test: invoke ODF validator with custom schemas
This requires a new validator jar for the -m flag to specify MathML schema. Change-Id: If99cf70f386a16a90ba676f8f5ff65a537c9ce56 Reviewed-on: https://gerrit.libreoffice.org/56487 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'test')
-rw-r--r--test/source/bootstrapfixture.cxx17
1 files changed, 14 insertions, 3 deletions
diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx
index 184f4ad34c52..5f5d4d9bad4b 100644
--- a/test/source/bootstrapfixture.cxx
+++ b/test/source/bootstrapfixture.cxx
@@ -137,7 +137,7 @@ OString loadFile(const OUString& rURL)
}
#endif
-void test::BootstrapFixture::validate(const OUString& rPath, test::ValidationFormat eFormat )
+void test::BootstrapFixture::validate(const OUString& rPath, test::ValidationFormat eFormat) const
{
#if HAVE_EXPORT_VALIDATION
OUString var;
@@ -166,12 +166,23 @@ void test::BootstrapFixture::validate(const OUString& rPath, test::ValidationFor
CPPUNIT_ASSERT_MESSAGE(
OUString("empty get env var " + var).toUtf8().getStr(),
!aValidator.isEmpty());
- aValidator += " ";
+
+ if (eFormat == test::ODF)
+ {
+ aValidator += " -e -M "
+ + m_directories.getPathFromSrc("/schema/libreoffice/OpenDocument-manifest-schema-v1.3+libreoffice.rng")
+ + " -D "
+ + m_directories.getPathFromSrc("/schema/libreoffice/OpenDocument-dsig-schema-v1.3+libreoffice.rng")
+ + " -O "
+ + m_directories.getPathFromSrc("/schema/libreoffice/OpenDocument-schema-v1.3+libreoffice.rng")
+ + " -m "
+ + m_directories.getPathFromSrc("/schema/mathml2/mathml2.xsd");
+ }
utl::TempFile aOutput;
aOutput.EnableKillingFile();
OUString aOutputFile = aOutput.GetFileName();
- OUString aCommand = aValidator + rPath + " > " + aOutputFile;
+ OUString aCommand = aValidator + " " + rPath + " > " + aOutputFile;
int returnValue = system(OUStringToOString(aCommand, RTL_TEXTENCODING_UTF8).getStr());
CPPUNIT_ASSERT_EQUAL_MESSAGE(