aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/lintool/lintool/test.py')
-rw-r--r--src/lintool/lintool/test.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/lintool/lintool/test.py b/src/lintool/lintool/test.py
new file mode 100644
index 0000000..0cc56ff
--- /dev/null
+++ b/src/lintool/lintool/test.py
@@ -0,0 +1,30 @@
+# Copyright 2002 Gentoo Technologies, Inc
+# Distributed under the terms of the GNU General Public License v2.0
+# Author Karl Trygve Kalleberg <karltk@gentoo.org>
+
+class Test:
+ def __init__(self, formatter,options=None):
+ self.formatter = formatter
+ self.errors = []
+ self.warnings = []
+ def reset(self):
+ self.errors = []
+ self.warnings = []
+ def hasWarnings(self):
+ return len(self.warnings)
+ def hasErrors(self):
+ return len(self.errors)
+ def getDesc(self):
+ return self.desc
+ def getStatus(self):
+ if self.hasErrors():
+ return "failed"
+ else:
+ return "passed"
+
+class Regex:
+ PN = "[a-zA-Z_.-]+"
+ PV = "[a-z0-9A-Z_.-]+"
+ P = PN + "-" + PV + "(-r[0-9]+)?"
+ category = "[a-z0-9]+-[a-z0-9]+"
+ full = category + "/" + P