gnu: Add python-mediafile.
[jackhill/guix/guix.git] / gnu / packages / patches / doxygen-1.8.17-runtests.patch
CommitLineData
b34c1258
MB
11.8.17 was released with a broken test runner.
2
3https://github.com/doxygen/doxygen/issues/7464
4
5Taken from upstream:
6https://github.com/doxygen/doxygen/commit/cd9dee013dc749a10bbe019c350e0e62b6635795
7
8diff --git a/testing/runtests.py b/testing/runtests.py
9index a4118b865..10fe50214 100755
10--- a/testing/runtests.py
11+++ b/testing/runtests.py
12@@ -3,6 +3,7 @@
13 from __future__ import print_function
14 import argparse, glob, itertools, re, shutil, os, sys
15 import subprocess
16+import shlex
17
18 config_reg = re.compile('.*\/\/\s*(?P<name>\S+):\s*(?P<value>.*)$')
19
20@@ -28,10 +29,10 @@ def xpopen(cmd, cmd1="",encoding='utf-8-sig', getStderr=False):
21 return os.popen(cmd).read() # Python 2 without encoding
22 else:
23 if (getStderr):
24- proc = subprocess.run(cmd1,encoding=encoding,capture_output=True) # Python 3 with encoding
25- return proc.stderr
26+ proc = subprocess.Popen(shlex.split(cmd1),stdout=subprocess.PIPE,stderr=subprocess.PIPE,encoding=encoding) # Python 3 with encoding
27+ return proc.stderr.read()
28 else:
29- proc = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE,encoding=encoding) # Python 3 with encoding
30+ proc = subprocess.Popen(shlex.split(cmd),stdout=subprocess.PIPE,stderr=subprocess.PIPE,encoding=encoding) # Python 3 with encoding
31 return proc.stdout.read()
32
33 class Tester:
34@@ -137,7 +138,7 @@ def prepare_test(self):
35 print('GENERATE_DOCBOOK=NO', file=f)
36 if (self.args.xhtml):
37 print('GENERATE_HTML=YES', file=f)
38- # HTML_OUTPUT can also be set locally
39+ # HTML_OUTPUT can also have been set locally
40 print('HTML_OUTPUT=%s/html' % self.test_out, file=f)
41 print('HTML_FILE_EXTENSION=.xhtml', file=f)
42 if (self.args.pdf):
43@@ -184,7 +185,7 @@ def update_test(self,testmgr):
44 print('Non-existing file %s after \'check:\' statement' % check_file)
45 return
46 # convert output to canonical form
47- data = xpopen('%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file)).read()
48+ data = xpopen('%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file))
49 if data:
50 # strip version
51 data = re.sub(r'xsd" version="[0-9.-]+"','xsd" version=""',data).rstrip('\n')
52@@ -326,7 +327,7 @@ def perform_test(self,testmgr):
53 tests.append(glob.glob('%s/*.xml' % (docbook_output)))
54 tests.append(glob.glob('%s/*/*/*.xml' % (docbook_output)))
55 tests = ' '.join(list(itertools.chain.from_iterable(tests))).replace(self.args.outputdir +'/','').replace('\\','/')
56- exe_string = '%s --nonet --postvalid %s' % (self.args.xmllint,tests)
57+ exe_string = '%s --noout --nonet --postvalid %s' % (self.args.xmllint,tests)
58 exe_string1 = exe_string
59 exe_string += ' %s' % (redirx)
60 exe_string += ' %s more "%s/temp"' % (separ,docbook_output)
61@@ -346,7 +347,11 @@ def perform_test(self,testmgr):
62 redirx=' 2> %s/temp >nul:'%html_output
63 else:
64 redirx='2>%s/temp >/dev/null'%html_output
65- exe_string = '%s --path dtd --nonet --postvalid %s/*xhtml' % (self.args.xmllint,html_output)
66+ check_file = []
67+ check_file.append(glob.glob('%s/*.xhtml' % (html_output)))
68+ check_file.append(glob.glob('%s/*/*/*.xhtml' % (html_output)))
69+ check_file = ' '.join(list(itertools.chain.from_iterable(check_file))).replace(self.args.outputdir +'/','').replace('\\','/')
70+ exe_string = '%s --noout --path dtd --nonet --postvalid %s' % (self.args.xmllint,check_file)
71 exe_string1 = exe_string
72 exe_string += ' %s' % (redirx)
73 exe_string += ' %s more "%s/temp"' % (separ,html_output)