3 # Copyright (C) 2018, 2019, 2020 Free Software Foundation, Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 class DejaGnu(object):
32 def verbose_level(self
, level
=0):
33 self
.verbosity
= level
35 def verbose(self
, msg
="", level
=0):
36 if self
.verbosity
> level
:
39 def fails(self
, msg
=""):
43 def xfails(self
, msg
=""):
45 print("XFAIL: " + msg
)
47 def untested(self
, msg
=""):
49 print("UNTESTED: " + msg
)
51 def xpasses(self
, msg
=""):
53 print("XPASS: " + msg
)
55 def passes(self
, msg
=""):
59 def matches(self
, instr
, expected
, msg
="", yes
=True):
71 # print("\tGot \'" + instr + "\', expected \'" + expected + "\'")
78 print("Total passed: %r " % self
.passed
)
80 print("Total Xpassed: %r " % self
.xpassed
)
82 print("Total failed: %r " % self
.failed
)
84 print("Total Xfailed: %r " % self
.xfailed
)
86 print("Total untested: %r " % self
.untested
)
87 if self
.unresolved
> 0:
88 print("Total unresolved: %r " % self
.unresolved
)