LogAnalyzer: renamed PASS to GOOD in output (and enums)

as per Craig’s request to clarify test output
This commit is contained in:
Andrew Chapman 2014-06-15 23:35:14 +02:00 committed by Andrew Tridgell
parent a6eb5307b6
commit 4a5e0bbe06
17 changed files with 29 additions and 29 deletions

View File

@ -32,10 +32,10 @@ from xml.sax.saxutils import escape
class TestResult:
'''all tests pass back a standardized result'''
'''all tests return a standardized result type'''
class StatusType:
# NA means not applicable for this log (e.g. copter tests against a plane log), UNKNOWN means it is missing data required for the test
PASS, FAIL, WARN, UNKNOWN, NA = range(5)
GOOD, FAIL, WARN, UNKNOWN, NA = range(5)
status = None
statusMessage = "" # can be multi-line
@ -111,8 +111,8 @@ class TestSuite:
execTime = ""
if outputStats:
execTime = " (%6.2fms)" % (test.execTime)
if test.result.status == TestResult.StatusType.PASS:
print " %20s: PASS %-55s%s" % (test.name, statusMessageFirstLine, execTime)
if test.result.status == TestResult.StatusType.GOOD:
print " %20s: GOOD %-55s%s" % (test.name, statusMessageFirstLine, execTime)
elif test.result.status == TestResult.StatusType.FAIL:
print " %20s: FAIL %-55s%s [GRAPH]" % (test.name, statusMessageFirstLine, execTime)
elif test.result.status == TestResult.StatusType.WARN:
@ -172,9 +172,9 @@ class TestSuite:
if not test.enable:
continue
print >>xml, " <result>"
if test.result.status == TestResult.StatusType.PASS:
if test.result.status == TestResult.StatusType.GOOD:
print >>xml, " <name>" + escape(test.name) + "</name>"
print >>xml, " <status>PASS</status>"
print >>xml, " <status>GOOD</status>"
print >>xml, " <message>" + escape(test.result.statusMessage) + "</message>"
elif test.result.status == TestResult.StatusType.FAIL:
print >>xml, " <name>" + escape(test.name) + "</name>"

View File

@ -67,7 +67,7 @@ try:
# ...
print "All unit/regression tests passed\n"
print "All unit/regression tests GOOD\n"
except Exception as e:
print "Error found: " + traceback.format_exc()

View File

@ -290,23 +290,23 @@
<results>
<result>
<name>Brownout</name>
<status>PASS</status>
<status>GOOD</status>
<message></message>
</result>
<result>
<name>Compass</name>
<status>PASS</status>
<status>GOOD</status>
<message>No MAG data, unable to test mag_field interference
</message>
</result>
<result>
<name>Dupe Log Data</name>
<status>PASS</status>
<status>GOOD</status>
<message></message>
</result>
<result>
<name>Empty</name>
<status>PASS</status>
<status>GOOD</status>
<message></message>
</result>
<result>
@ -323,7 +323,7 @@
</result>
<result>
<name>Parameters</name>
<status>PASS</status>
<status>GOOD</status>
<message></message>
</result>
<result>
@ -334,17 +334,17 @@
</result>
<result>
<name>Pitch/Roll</name>
<status>PASS</status>
<status>GOOD</status>
<message></message>
</result>
<result>
<name>Underpowered</name>
<status>PASS</status>
<status>GOOD</status>
<message></message>
</result>
<result>
<name>VCC</name>
<status>PASS</status>
<status>GOOD</status>
<message></message>
</result>
<result>

View File

@ -11,7 +11,7 @@ class TestBalanceTwist(Test):
def run(self, logdata, verbose):
self.result = TestResult()
self.result.status = TestResult.StatusType.PASS
self.result.status = TestResult.StatusType.GOOD
if logdata.vehicleType != "ArduCopter":
self.result.status = TestResult.StatusType.NA

View File

@ -11,7 +11,7 @@ class TestBrownout(Test):
def run(self, logdata, verbose):
self.result = TestResult()
self.result.status = TestResult.StatusType.PASS
self.result.status = TestResult.StatusType.GOOD
if "EV" in logdata.channels:
# step through the arm/disarm events in order, to see if they're symmetrical

View File

@ -12,7 +12,7 @@ class TestCompass(Test):
def run(self, logdata, verbose):
self.result = TestResult()
self.result.status = TestResult.StatusType.PASS
self.result.status = TestResult.StatusType.GOOD
# test that compass offset parameters are within recommended range (+/- 150)
maxOffset = 150

View File

@ -15,7 +15,7 @@ class TestDualGyroDrift(Test):
def run(self, logdata, verbose):
self.result = TestResult()
self.result.status = TestResult.StatusType.PASS
self.result.status = TestResult.StatusType.GOOD
# if "IMU" not in logdata.channels or "IMU2" not in logdata.channels:
# self.result.status = TestResult.StatusType.NA

View File

@ -36,7 +36,7 @@ class TestDupeLogData(Test):
def run(self, logdata, verbose):
self.result = TestResult()
self.result.status = TestResult.StatusType.PASS
self.result.status = TestResult.StatusType.GOOD
# this could be made more flexible by not hard-coding to use ATT data, could make it dynamic based on whatever is available as long as it is highly variable
if "ATT" not in logdata.channels:

View File

@ -10,7 +10,7 @@ class TestEmpty(Test):
def run(self, logdata, verbose):
self.result = TestResult()
self.result.status = TestResult.StatusType.PASS
self.result.status = TestResult.StatusType.GOOD
# all the logic for this test is in the helper function, as it can also be called up front as an early exit
emptyErr = DataflashLog.DataflashLogHelper.isLogEmpty(logdata)

View File

@ -11,7 +11,7 @@ class TestEvents(Test):
def run(self, logdata, verbose):
self.result = TestResult()
self.result.status = TestResult.StatusType.PASS
self.result.status = TestResult.StatusType.GOOD
errors = set()

View File

@ -10,7 +10,7 @@ class TestGPSGlitch(Test):
def run(self, logdata, verbose):
self.result = TestResult()
self.result.status = TestResult.StatusType.PASS
self.result.status = TestResult.StatusType.GOOD
if "GPS" not in logdata.channels:
self.result.status = TestResult.StatusType.UNKNOWN

View File

@ -31,7 +31,7 @@ class TestParams(Test):
def run(self, logdata, verbose):
self.result = TestResult()
self.result.status = TestResult.StatusType.PASS # PASS by default, tests below will override it if they fail
self.result.status = TestResult.StatusType.GOOD # GOOD by default, tests below will override it if they fail
# check all params for NaN
for name,value in logdata.parameters.iteritems():

View File

@ -10,7 +10,7 @@ class TestPerformance(Test):
def run(self, logdata, verbose):
self.result = TestResult()
self.result.status = TestResult.StatusType.PASS
self.result.status = TestResult.StatusType.GOOD
# this test should be valid for all vehicle types, just need to figure out why PM logging data is different in each
if logdata.vehicleType != "ArduCopter":

View File

@ -14,7 +14,7 @@ class TestPitchRollCoupling(Test):
def run(self, logdata, verbose):
self.result = TestResult()
self.result.status = TestResult.StatusType.PASS
self.result.status = TestResult.StatusType.GOOD
if logdata.vehicleType != "ArduCopter":
self.result.status = TestResult.StatusType.NA

View File

@ -10,7 +10,7 @@ class TestUnderpowered(Test):
def run(self, logdata, verbose):
self.result = TestResult()
self.result.status = TestResult.StatusType.PASS
self.result.status = TestResult.StatusType.GOOD
if logdata.vehicleType != "ArduCopter":
self.result.status = TestResult.StatusType.NA

View File

@ -12,7 +12,7 @@ class TestVCC(Test):
def run(self, logdata, verbose):
self.result = TestResult()
self.result.status = TestResult.StatusType.PASS
self.result.status = TestResult.StatusType.GOOD
if not "CURR" in logdata.channels:
self.result.status = TestResult.StatusType.UNKNOWN

View File

@ -60,7 +60,7 @@ class TestVibration(Test):
self.result.status = TestResult.StatusType.WARN
self.result.statusMessage = "Vibration slightly high (X:%.2fg, Y:%.2fg, Z:%.2fg)" % (stdDevX,stdDevY,stdDevZ)
else:
self.result.status = TestResult.StatusType.PASS
self.result.status = TestResult.StatusType.GOOD
self.result.statusMessage = "Good vibration values (X:%.2fg, Y:%.2fg, Z:%.2fg)" % (stdDevX,stdDevY,stdDevZ)