Blame doxygen-1.8.17-test-suite-is-failing.patch

Than Ngo d1c487
commit cd9dee013dc749a10bbe019c350e0e62b6635795
Than Ngo d1c487
Author: albert-github <albert.tests@gmail.com>
Than Ngo d1c487
Date:   Wed Jan 1 17:51:53 2020 +0100
Than Ngo d1c487
Than Ngo d1c487
    issue #7464 1.8.17: test suite is failing
Than Ngo d1c487
    
Than Ngo d1c487
    On Windows the syntax with the command and arguments in one string worked but on *nix (and Cygwin) it didn't.
Than Ngo d1c487
    - changed calls to Popen to split command (see also: https://docs.python.org/3/library/subprocess.html).
Than Ngo d1c487
    - explicitly specify files to check for xhtml
Than Ngo d1c487
    - changed call to xmllint for xhtml and docbook (due to stdout overflow in some cases, we are not really interested in the, formatted, output of xmllint).
Than Ngo d1c487
    - in the update part a `read` was left, should have been removed.
Than Ngo d1c487
Than Ngo d1c487
diff --git a/testing/runtests.py b/testing/runtests.py
Than Ngo d1c487
index a4118b86..10fe5021 100755
Than Ngo d1c487
--- a/testing/runtests.py
Than Ngo d1c487
+++ b/testing/runtests.py
Than Ngo d1c487
@@ -3,6 +3,7 @@
Than Ngo d1c487
 from __future__ import print_function
Than Ngo d1c487
 import argparse, glob, itertools, re, shutil, os, sys
Than Ngo d1c487
 import subprocess
Than Ngo d1c487
+import shlex
Than Ngo d1c487
 
Than Ngo d1c487
 config_reg = re.compile('.*\/\/\s*(?P<name>\S+):\s*(?P<value>.*)$')
Than Ngo d1c487
 
Than Ngo d1c487
@@ -28,10 +29,10 @@ def xpopen(cmd, cmd1="",encoding='utf-8-sig', getStderr=False):
Than Ngo d1c487
 		return os.popen(cmd).read() # Python 2 without encoding
Than Ngo d1c487
 	else:
Than Ngo d1c487
 		if (getStderr):
Than Ngo d1c487
-			proc = subprocess.run(cmd1,encoding=encoding,capture_output=True) # Python 3 with encoding
Than Ngo d1c487
-			return proc.stderr
Than Ngo d1c487
+			proc = subprocess.Popen(shlex.split(cmd1),stdout=subprocess.PIPE,stderr=subprocess.PIPE,encoding=encoding) # Python 3 with encoding
Than Ngo d1c487
+			return proc.stderr.read()
Than Ngo d1c487
 		else:
Than Ngo d1c487
-			proc = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE,encoding=encoding) # Python 3 with encoding
Than Ngo d1c487
+			proc = subprocess.Popen(shlex.split(cmd),stdout=subprocess.PIPE,stderr=subprocess.PIPE,encoding=encoding) # Python 3 with encoding
Than Ngo d1c487
 			return proc.stdout.read()
Than Ngo d1c487
 
Than Ngo d1c487
 class Tester:
Than Ngo d1c487
@@ -137,7 +138,7 @@ class Tester:
Than Ngo d1c487
 				print('GENERATE_DOCBOOK=NO', file=f)
Than Ngo d1c487
 			if (self.args.xhtml):
Than Ngo d1c487
 				print('GENERATE_HTML=YES', file=f)
Than Ngo d1c487
-			# HTML_OUTPUT can also be set locally
Than Ngo d1c487
+			# HTML_OUTPUT can also have been set locally
Than Ngo d1c487
 			print('HTML_OUTPUT=%s/html' % self.test_out, file=f)
Than Ngo d1c487
 			print('HTML_FILE_EXTENSION=.xhtml', file=f)
Than Ngo d1c487
 			if (self.args.pdf):
Than Ngo d1c487
@@ -184,7 +185,7 @@ class Tester:
Than Ngo d1c487
 					print('Non-existing file %s after \'check:\' statement' % check_file)
Than Ngo d1c487
 					return
Than Ngo d1c487
 				# convert output to canonical form
Than Ngo d1c487
-				data = xpopen('%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file)).read()
Than Ngo d1c487
+				data = xpopen('%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file))
Than Ngo d1c487
 				if data:
Than Ngo d1c487
 					# strip version
Than Ngo d1c487
 					data = re.sub(r'xsd" version="[0-9.-]+"','xsd" version=""',data).rstrip('\n')
Than Ngo d1c487
@@ -326,7 +327,7 @@ class Tester:
Than Ngo d1c487
 			tests.append(glob.glob('%s/*.xml' % (docbook_output)))
Than Ngo d1c487
 			tests.append(glob.glob('%s/*/*/*.xml' % (docbook_output)))
Than Ngo d1c487
 			tests = ' '.join(list(itertools.chain.from_iterable(tests))).replace(self.args.outputdir +'/','').replace('\\','/')
Than Ngo d1c487
-			exe_string = '%s --nonet --postvalid %s' % (self.args.xmllint,tests)
Than Ngo d1c487
+			exe_string = '%s --noout --nonet --postvalid %s' % (self.args.xmllint,tests)
Than Ngo d1c487
 			exe_string1 = exe_string
Than Ngo d1c487
 			exe_string += ' %s' % (redirx)
Than Ngo d1c487
 			exe_string += ' %s more "%s/temp"' % (separ,docbook_output)
Than Ngo d1c487
@@ -346,7 +347,11 @@ class Tester:
Than Ngo d1c487
 				redirx=' 2> %s/temp >nul:'%html_output
Than Ngo d1c487
 			else:
Than Ngo d1c487
 				redirx='2>%s/temp >/dev/null'%html_output
Than Ngo d1c487
-			exe_string = '%s --path dtd --nonet --postvalid %s/*xhtml' % (self.args.xmllint,html_output)
Than Ngo d1c487
+			check_file = []
Than Ngo d1c487
+			check_file.append(glob.glob('%s/*.xhtml' % (html_output)))
Than Ngo d1c487
+			check_file.append(glob.glob('%s/*/*/*.xhtml' % (html_output)))
Than Ngo d1c487
+			check_file = ' '.join(list(itertools.chain.from_iterable(check_file))).replace(self.args.outputdir +'/','').replace('\\','/')
Than Ngo d1c487
+			exe_string = '%s --noout --path dtd --nonet --postvalid %s' % (self.args.xmllint,check_file)
Than Ngo d1c487
 			exe_string1 = exe_string
Than Ngo d1c487
 			exe_string += ' %s' % (redirx)
Than Ngo d1c487
 			exe_string += ' %s more "%s/temp"' % (separ,html_output)