From 4a5e0bbe067d648697abdf6d7504bd43d79abee1 Mon Sep 17 00:00:00 2001 From: Andrew Chapman Date: Sun, 15 Jun 2014 23:35:14 +0200 Subject: [PATCH] LogAnalyzer: renamed PASS to GOOD in output (and enums) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit as per Craig’s request to clarify test output --- Tools/LogAnalyzer/LogAnalyzer.py | 12 ++++++------ Tools/LogAnalyzer/UnitTest.py | 2 +- Tools/LogAnalyzer/example_output.xml | 16 ++++++++-------- Tools/LogAnalyzer/tests/TestBalanceTwist.py | 2 +- Tools/LogAnalyzer/tests/TestBrownout.py | 2 +- Tools/LogAnalyzer/tests/TestCompass.py | 2 +- Tools/LogAnalyzer/tests/TestDualGyroDrift.py | 2 +- Tools/LogAnalyzer/tests/TestDupeLogData.py | 2 +- Tools/LogAnalyzer/tests/TestEmpty.py | 2 +- Tools/LogAnalyzer/tests/TestEvents.py | 2 +- Tools/LogAnalyzer/tests/TestGPSGlitch.py | 2 +- Tools/LogAnalyzer/tests/TestParams.py | 2 +- Tools/LogAnalyzer/tests/TestPerformance.py | 2 +- Tools/LogAnalyzer/tests/TestPitchRollCoupling.py | 2 +- Tools/LogAnalyzer/tests/TestUnderpowered.py | 2 +- Tools/LogAnalyzer/tests/TestVCC.py | 2 +- Tools/LogAnalyzer/tests/TestVibration.py | 2 +- 17 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Tools/LogAnalyzer/LogAnalyzer.py b/Tools/LogAnalyzer/LogAnalyzer.py index 50d26af967..83cb783f2b 100755 --- a/Tools/LogAnalyzer/LogAnalyzer.py +++ b/Tools/LogAnalyzer/LogAnalyzer.py @@ -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, " " - if test.result.status == TestResult.StatusType.PASS: + if test.result.status == TestResult.StatusType.GOOD: print >>xml, " " + escape(test.name) + "" - print >>xml, " PASS" + print >>xml, " GOOD" print >>xml, " " + escape(test.result.statusMessage) + "" elif test.result.status == TestResult.StatusType.FAIL: print >>xml, " " + escape(test.name) + "" diff --git a/Tools/LogAnalyzer/UnitTest.py b/Tools/LogAnalyzer/UnitTest.py index cd80fa82d5..ed97bc66db 100755 --- a/Tools/LogAnalyzer/UnitTest.py +++ b/Tools/LogAnalyzer/UnitTest.py @@ -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() diff --git a/Tools/LogAnalyzer/example_output.xml b/Tools/LogAnalyzer/example_output.xml index 75feb1ac09..3b71e40a64 100644 --- a/Tools/LogAnalyzer/example_output.xml +++ b/Tools/LogAnalyzer/example_output.xml @@ -290,23 +290,23 @@ Brownout - PASS + GOOD Compass - PASS + GOOD No MAG data, unable to test mag_field interference Dupe Log Data - PASS + GOOD Empty - PASS + GOOD @@ -323,7 +323,7 @@ Parameters - PASS + GOOD @@ -334,17 +334,17 @@ Pitch/Roll - PASS + GOOD Underpowered - PASS + GOOD VCC - PASS + GOOD diff --git a/Tools/LogAnalyzer/tests/TestBalanceTwist.py b/Tools/LogAnalyzer/tests/TestBalanceTwist.py index 8ade67a23f..376dd15dcf 100644 --- a/Tools/LogAnalyzer/tests/TestBalanceTwist.py +++ b/Tools/LogAnalyzer/tests/TestBalanceTwist.py @@ -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 diff --git a/Tools/LogAnalyzer/tests/TestBrownout.py b/Tools/LogAnalyzer/tests/TestBrownout.py index b2ac045083..4d883ea6ce 100644 --- a/Tools/LogAnalyzer/tests/TestBrownout.py +++ b/Tools/LogAnalyzer/tests/TestBrownout.py @@ -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 diff --git a/Tools/LogAnalyzer/tests/TestCompass.py b/Tools/LogAnalyzer/tests/TestCompass.py index 4ac090958e..4ba4baca94 100644 --- a/Tools/LogAnalyzer/tests/TestCompass.py +++ b/Tools/LogAnalyzer/tests/TestCompass.py @@ -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 diff --git a/Tools/LogAnalyzer/tests/TestDualGyroDrift.py b/Tools/LogAnalyzer/tests/TestDualGyroDrift.py index 184e47b5ca..23685691ea 100644 --- a/Tools/LogAnalyzer/tests/TestDualGyroDrift.py +++ b/Tools/LogAnalyzer/tests/TestDualGyroDrift.py @@ -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 diff --git a/Tools/LogAnalyzer/tests/TestDupeLogData.py b/Tools/LogAnalyzer/tests/TestDupeLogData.py index a9de27db33..763efe2299 100644 --- a/Tools/LogAnalyzer/tests/TestDupeLogData.py +++ b/Tools/LogAnalyzer/tests/TestDupeLogData.py @@ -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: diff --git a/Tools/LogAnalyzer/tests/TestEmpty.py b/Tools/LogAnalyzer/tests/TestEmpty.py index ea9252f9f4..35f840f07e 100644 --- a/Tools/LogAnalyzer/tests/TestEmpty.py +++ b/Tools/LogAnalyzer/tests/TestEmpty.py @@ -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) diff --git a/Tools/LogAnalyzer/tests/TestEvents.py b/Tools/LogAnalyzer/tests/TestEvents.py index 819c87a951..24165fe6e6 100644 --- a/Tools/LogAnalyzer/tests/TestEvents.py +++ b/Tools/LogAnalyzer/tests/TestEvents.py @@ -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() diff --git a/Tools/LogAnalyzer/tests/TestGPSGlitch.py b/Tools/LogAnalyzer/tests/TestGPSGlitch.py index 9f997e060d..e57877ba90 100644 --- a/Tools/LogAnalyzer/tests/TestGPSGlitch.py +++ b/Tools/LogAnalyzer/tests/TestGPSGlitch.py @@ -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 diff --git a/Tools/LogAnalyzer/tests/TestParams.py b/Tools/LogAnalyzer/tests/TestParams.py index fc248330cb..c726426bff 100644 --- a/Tools/LogAnalyzer/tests/TestParams.py +++ b/Tools/LogAnalyzer/tests/TestParams.py @@ -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(): diff --git a/Tools/LogAnalyzer/tests/TestPerformance.py b/Tools/LogAnalyzer/tests/TestPerformance.py index e5b36958f5..26dc29923f 100644 --- a/Tools/LogAnalyzer/tests/TestPerformance.py +++ b/Tools/LogAnalyzer/tests/TestPerformance.py @@ -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": diff --git a/Tools/LogAnalyzer/tests/TestPitchRollCoupling.py b/Tools/LogAnalyzer/tests/TestPitchRollCoupling.py index 08eb5b6c2d..9992fe896f 100644 --- a/Tools/LogAnalyzer/tests/TestPitchRollCoupling.py +++ b/Tools/LogAnalyzer/tests/TestPitchRollCoupling.py @@ -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 diff --git a/Tools/LogAnalyzer/tests/TestUnderpowered.py b/Tools/LogAnalyzer/tests/TestUnderpowered.py index 4cf0cb96bf..96cccf5c8c 100644 --- a/Tools/LogAnalyzer/tests/TestUnderpowered.py +++ b/Tools/LogAnalyzer/tests/TestUnderpowered.py @@ -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 diff --git a/Tools/LogAnalyzer/tests/TestVCC.py b/Tools/LogAnalyzer/tests/TestVCC.py index 969c46e1f3..21c015b263 100644 --- a/Tools/LogAnalyzer/tests/TestVCC.py +++ b/Tools/LogAnalyzer/tests/TestVCC.py @@ -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 diff --git a/Tools/LogAnalyzer/tests/TestVibration.py b/Tools/LogAnalyzer/tests/TestVibration.py index cbb6e9072e..ec4feaadf0 100644 --- a/Tools/LogAnalyzer/tests/TestVibration.py +++ b/Tools/LogAnalyzer/tests/TestVibration.py @@ -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)