[tests] Allow tests to be skipped for unsupported features

This commit is contained in:
Dan Smith 2011-08-02 15:40:15 -07:00
parent e5b7620e06
commit da28359345

View File

@ -56,6 +56,9 @@ class TestFailedError(TestError):
def get_detail(self):
return self._detail
class TestSkippedError(TestError):
pass
def get_tb():
return traceback.format_exc()
@ -435,6 +438,8 @@ class TestOutputANSI(TestOutput):
msg = "\033[1;41m%s\033[0m" % msg
elif msg == "CRASHED":
msg = "\033[1;45m%s\033[0m" % msg
elif msg == "SKIPPED":
msg = "\033[1;32m%s\033[0m" % msg
TestOutput.report(self, rclass, tc, msg, e)
@ -473,6 +478,9 @@ td.FAILED {
td.CRASHED {
background-color: purple;
}
td.SKIPPED {
background-color: green;
}
</style>
</head>
<body>
@ -562,6 +570,10 @@ class TestRunner:
self.report(rclass, tc, "CRASHED", e)
self.log(rclass, tc, e)
nfailed += 1
except TestSkippedError, e:
self.report(rclass, tc, "SKIPPED", e)
self.log(rclass, tc, e)
nfailed += 1
tc.cleanup()