1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-24 13:33:01 +03:00

tests: Fix build --without-output

This commit is contained in:
Nick Wellnhofer
2025-06-30 16:23:03 +02:00
parent 9553695d17
commit c34742f301
4 changed files with 24 additions and 13 deletions

View File

@@ -176,11 +176,11 @@ check-local:
$(CHECKER) ./testModule$(EXEEXT) $(CHECKER) ./testModule$(EXEEXT)
$(CHECKER) ./runxmlconf$(EXEEXT) -d $(srcdir)/xmlconf $(CHECKER) ./runxmlconf$(EXEEXT) -d $(srcdir)/xmlconf
$(CHECKER) ./runsuite$(EXEEXT) $(CHECKER) ./runsuite$(EXEEXT)
if WITH_OUTPUT_SOURCES
if WITH_DEBUG_SOURCES if WITH_DEBUG_SOURCES
test/scripts/test.sh ./xmllint$(EXEEXT) test/scripts/test.sh ./xmllint$(EXEEXT)
endif endif
if WITH_CATALOG_SOURCES if WITH_CATALOG_SOURCES
if WITH_OUTPUT_SOURCES
ASAN_OPTIONS=detect_leaks=0 test/catalogs/test.sh ./xmlcatalog$(EXEEXT) ASAN_OPTIONS=detect_leaks=0 test/catalogs/test.sh ./xmlcatalog$(EXEEXT)
endif endif
endif endif

View File

@@ -534,6 +534,7 @@ foreach check, deps : checks
endif endif
endforeach endforeach
if want_output
sh = find_program('sh', required: false) sh = find_program('sh', required: false)
if sh.found() if sh.found()
@@ -542,12 +543,13 @@ if sh.found()
args: [ 'test/scripts/test.sh', xmllint.full_path() ], args: [ 'test/scripts/test.sh', xmllint.full_path() ],
workdir: meson.current_source_dir()) workdir: meson.current_source_dir())
endif endif
if want_catalog and want_output if want_catalog
test('xmlcatalog shell', sh, test('xmlcatalog shell', sh,
args: [ 'test/catalogs/test.sh', xmlcatalog.full_path() ], args: [ 'test/catalogs/test.sh', xmlcatalog.full_path() ],
workdir: meson.current_source_dir()) workdir: meson.current_source_dir())
endif endif
endif endif
endif
subdir('example') subdir('example')

View File

@@ -17,8 +17,9 @@
#include <libxml/parserInternals.h> #include <libxml/parserInternals.h>
#include <libxml/tree.h> #include <libxml/tree.h>
#include <libxml/uri.h> #include <libxml/uri.h>
#if (defined(LIBXML_RELAXNG_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)) && \ #if (defined(LIBXML_RELAXNG_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)) && \
defined(LIBXML_XPATH_ENABLED) defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
#include <libxml/xmlreader.h> #include <libxml/xmlreader.h>
#include <libxml/xpath.h> #include <libxml/xpath.h>

View File

@@ -621,6 +621,7 @@ testHtmlIds(void) {
#define MHE "meta http-equiv=\"Content-Type\"" #define MHE "meta http-equiv=\"Content-Type\""
#ifdef LIBXML_OUTPUT_ENABLED
static int static int
testHtmlInsertMetaEncoding(void) { testHtmlInsertMetaEncoding(void) {
/* We currently require a head element to be present. */ /* We currently require a head element to be present. */
@@ -741,6 +742,7 @@ testHtmlUpdateMetaEncoding(void) {
xmlFreeDoc(doc); xmlFreeDoc(doc);
return err; return err;
} }
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_PUSH_ENABLED #ifdef LIBXML_PUSH_ENABLED
static int static int
@@ -806,6 +808,7 @@ testReaderEncoding(void) {
return err; return err;
} }
#ifdef LIBXML_OUTPUT_ENABLED
static int static int
testReaderContent(void) { testReaderContent(void) {
xmlTextReader *reader; xmlTextReader *reader;
@@ -840,6 +843,7 @@ testReaderContent(void) {
xmlFreeTextReader(reader); xmlFreeTextReader(reader);
return err; return err;
} }
#endif /* LIBXML_OUTPUT_ENABLED */
static int static int
testReaderNode(xmlTextReader *reader) { testReaderNode(xmlTextReader *reader) {
@@ -1424,15 +1428,19 @@ main(void) {
#endif #endif
#ifdef LIBXML_HTML_ENABLED #ifdef LIBXML_HTML_ENABLED
err |= testHtmlIds(); err |= testHtmlIds();
#ifdef LIBXML_OUTPUT_ENABLED
err |= testHtmlInsertMetaEncoding(); err |= testHtmlInsertMetaEncoding();
err |= testHtmlUpdateMetaEncoding(); err |= testHtmlUpdateMetaEncoding();
#endif
#ifdef LIBXML_PUSH_ENABLED #ifdef LIBXML_PUSH_ENABLED
err |= testHtmlPushWithEncoding(); err |= testHtmlPushWithEncoding();
#endif #endif
#endif #endif
#ifdef LIBXML_READER_ENABLED #ifdef LIBXML_READER_ENABLED
err |= testReaderEncoding(); err |= testReaderEncoding();
#ifdef LIBXML_OUTPUT_ENABLED
err |= testReaderContent(); err |= testReaderContent();
#endif
err |= testReader(); err |= testReader();
#ifdef LIBXML_XINCLUDE_ENABLED #ifdef LIBXML_XINCLUDE_ENABLED
err |= testReaderXIncludeError(); err |= testReaderXIncludeError();