[libxml2/2.9] More fixes to --without-valid build



commit 98a0a965150722b66aa4c6e01251582c78b8732a
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Tue Feb 22 11:52:38 2022 +0100

    More fixes to --without-valid build
    
    Fix runtest and Python bindings when building --without-valid.
    
    The Python tests still fail. There doesn't seem to be a mechanism to
    disable tests depending on feature flags.

 python/libxml.c | 4 ++++
 runtest.c       | 8 ++++++++
 2 files changed, 12 insertions(+)
---
diff --git a/python/libxml.c b/python/libxml.c
index e6a9e9f3..ef630254 100644
--- a/python/libxml.c
+++ b/python/libxml.c
@@ -1886,6 +1886,7 @@ libxml_xmlFreeParserCtxt(ATTRIBUTE_UNUSED PyObject *self, PyObject *args) {
     return(Py_None);
 }
 
+#ifdef LIBXML_VALID_ENABLED
 /***
  * xmlValidCtxt stuff
  */
@@ -2045,6 +2046,7 @@ libxml_xmlFreeValidCtxt(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
     Py_INCREF(Py_None);
     return(Py_None);
 }
+#endif /* LIBXML_VALID_ENABLED */
 
 #ifdef LIBXML_READER_ENABLED
 /************************************************************************
@@ -3838,8 +3840,10 @@ static PyMethodDef libxmlMethods[] = {
     {(char *) "doc", libxml_doc, METH_VARARGS, NULL},
     {(char *) "xmlNewNode", libxml_xmlNewNode, METH_VARARGS, NULL},
     {(char *) "xmlNodeRemoveNsDef", libxml_xmlNodeRemoveNsDef, METH_VARARGS, NULL},
+#ifdef LIBXML_VALID_ENABLED
     {(char *)"xmlSetValidErrors", libxml_xmlSetValidErrors, METH_VARARGS, NULL},
     {(char *)"xmlFreeValidCtxt", libxml_xmlFreeValidCtxt, METH_VARARGS, NULL},
+#endif /* LIBXML_VALID_ENABLED */
 #ifdef LIBXML_OUTPUT_ENABLED
     {(char *) "serializeNode", libxml_serializeNode, METH_VARARGS, NULL},
     {(char *) "saveNodeTo", libxml_saveNodeTo, METH_VARARGS, NULL},
diff --git a/runtest.c b/runtest.c
index 61e41200..e6b2cbb0 100644
--- a/runtest.c
+++ b/runtest.c
@@ -2647,6 +2647,7 @@ xptrDocTest(const char *filename,
 }
 #endif /* LIBXML_XPTR_ENABLED */
 
+#ifdef LIBXML_VALID_ENABLED
 /**
  * xmlidDocTest:
  * @filename: the file to parse
@@ -2714,6 +2715,7 @@ xmlidDocTest(const char *filename,
     }
     return(res);
 }
+#endif /* LIBXML_VALID_ENABLED */
 
 #endif /* LIBXML_DEBUG_ENABLED */
 #endif /* XPATH */
@@ -4315,6 +4317,7 @@ testDesc testDescriptions[] = {
     { "XML Namespaces regression tests",
       errParseTest, "./test/namespaces/*", "result/namespaces/", "", ".err",
       0 },
+#ifdef LIBXML_VALID_ENABLED
     { "Error cases regression tests",
       errParseTest, "./test/errors/*.xml", "result/errors/", "", ".err",
       0 },
@@ -4327,10 +4330,13 @@ testDesc testDescriptions[] = {
     { "Error cases regression tests (old 1.0)",
       errParseTest, "./test/errors10/*.xml", "result/errors10/", "", ".err",
       XML_PARSE_OLD10 },
+#endif
 #ifdef LIBXML_READER_ENABLED
+#ifdef LIBXML_VALID_ENABLED
     { "Error cases stream regression tests",
       streamParseTest, "./test/errors/*.xml", "result/errors/", NULL, ".str",
       0 },
+#endif
     { "Reader regression tests",
       streamParseTest, "./test/*", "result/", ".rdr", NULL,
       0 },
@@ -4430,10 +4436,12 @@ testDesc testDescriptions[] = {
       xptrDocTest, "./test/XPath/docs/*", NULL, NULL, NULL,
       0 },
 #endif
+#ifdef LIBXML_VALID_ENABLED
     { "xml:id regression tests" ,
       xmlidDocTest, "./test/xmlid/*", "result/xmlid/", "", ".err",
       0 },
 #endif
+#endif
 #endif
     { "URI parsing tests" ,
       uriParseTest, "./test/URI/*.uri", "result/URI/", "", NULL,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]