Definition at line 8 of file runtests.py.
def runtests.Tester.__init__ |
( |
|
self, |
|
|
|
args, |
|
|
|
test |
|
) |
| |
Definition at line 9 of file runtests.py.
def __init__(self, args, test)
def runtests.Tester.compare_ok |
( |
|
self, |
|
|
|
got_file, |
|
|
|
expected_file, |
|
|
|
name |
|
) |
| |
Definition at line 22 of file runtests.py.
23 if not os.path.isfile(got_file):
24 return (
True,
'%s absent' % got_file)
25 elif not os.path.isfile(expected_file):
26 return (
True,
'%s absent' % expected_file)
28 diff = os.popen(
'diff -b -w -u %s %s' % (got_file,expected_file)).
read()
29 if diff
and not diff.startswith(
"No differences"):
30 return (
True,
'Difference between generated output and reference:\n%s' % diff)
int read(int, char *, size_t)
Read bytes from a file descriptor.
def compare_ok(self, got_file, expected_file, name)
def runtests.Tester.get_config |
( |
|
self | ) |
|
Definition at line 33 of file runtests.py.
35 with
open(self.args.inputdir+
'/'+self.
test,
'r') as f: 36 for line
in f.readlines():
37 m = config_reg.match(line)
40 value = m.group(
'value')
42 value = value.replace(
'$INPUTDIR',self.args.inputdir)
44 config.setdefault(key, []).append(value)
int open(const char *, int)
Opens a file descriptor.
def runtests.Tester.perform_test |
( |
|
self, |
|
|
|
testmgr |
|
) |
| |
Definition at line 100 of file runtests.py.
102 if 'check' in self.
config:
103 for check
in self.
config[
'check']:
104 check_file=
'%s/out/%s' % (self.
test_out,check)
106 if not os.path.isfile(check_file):
107 testmgr.ok(
False,self.
test_name,msg=
'Non-existing file %s after \'check:\' statement' % check_file)
110 data = os.popen(
'%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file)).
read()
113 data = re.sub(
r'xsd" version="[0-9.-]+"',
'xsd" version=""',data).rstrip(
'\n')
115 testmgr.ok(
False,self.
test_name,msg=
'Failed to run %s on the doxygen output file %s' % (self.args.xmllint,self.
test_out))
117 out_file=
'%s/%s' % (self.
test_out,check)
118 with
open(out_file,
'w')
as f:
120 ref_file=
'%s/%s/%s' % (self.args.inputdir,self.
test_id,check)
125 shutil.rmtree(self.
test_out,ignore_errors=
True)
int open(const char *, int)
Opens a file descriptor.
def perform_test(self, testmgr)
int read(int, char *, size_t)
Read bytes from a file descriptor.
def compare_ok(self, got_file, expected_file, name)
def runtests.Tester.prepare_test |
( |
|
self | ) |
|
Definition at line 47 of file runtests.py.
49 shutil.rmtree(self.
test_out,ignore_errors=
True)
51 shutil.copy(self.args.inputdir+
'/Doxyfile',self.
test_out)
53 print(
'INPUT=%s/%s' % (self.args.inputdir,self.
test), file=f)
54 print(
'STRIP_FROM_PATH=%s' % self.args.inputdir, file=f)
55 print(
'XML_OUTPUT=%s/out' % self.
test_out, file=f)
56 print(
'EXAMPLE_PATH=%s' % self.args.inputdir, file=f)
57 if 'config' in self.
config:
58 for option
in self.
config[
'config']:
61 if 'check' not in self.
config or not self.
config[
'check']:
62 print(
'Test doesn\'t specify any files to check')
66 if (sys.platform ==
'win32'):
70 if os.system(
'%s %s/Doxyfile %s' % (self.args.doxygen,self.
test_out, redir))!=0:
71 print(
'Error: failed to run %s on %s/Doxyfile' % (self.args.doxygen,self.
test_out));
int open(const char *, int)
Opens a file descriptor.
def runtests.Tester.run |
( |
|
self, |
|
|
|
testmgr |
|
) |
| |
Definition at line 128 of file runtests.py.
def perform_test(self, testmgr)
def update_test(self, testmgr)
def runtests.Tester.update_test |
( |
|
self, |
|
|
|
testmgr |
|
) |
| |
Definition at line 75 of file runtests.py.
76 print(
'Updating reference for %s' % self.
test_name)
79 for check
in self.
config[
'check']:
80 check_file=
'%s/out/%s' % (self.
test_out,check)
82 if not os.path.isfile(check_file):
83 print(
'Non-existing file %s after \'check:\' statement' % check_file)
86 data = os.popen(
'%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file)).
read()
89 data = re.sub(
r'xsd" version="[0-9.-]+"',
'xsd" version=""',data).rstrip(
'\n')
91 print(
'Failed to run %s on the doxygen output file %s' % (self.args.xmllint,self.
test_out))
93 out_file=
'%s/%s' % (self.
test_out,check)
94 with
open(out_file,
'w')
as f:
96 shutil.rmtree(self.
test_out+
'/out',ignore_errors=
True)
int open(const char *, int)
Opens a file descriptor.
int read(int, char *, size_t)
Read bytes from a file descriptor.
def update_test(self, testmgr)
runtests.Tester.test_name |
The documentation for this class was generated from the following file: