summaryrefslogtreecommitdiff
path: root/test-cli/test/tests/qrtc.py
diff options
context:
space:
mode:
Diffstat (limited to 'test-cli/test/tests/qrtc.py')
-rw-r--r--test-cli/test/tests/qrtc.py38
1 files changed, 34 insertions, 4 deletions
diff --git a/test-cli/test/tests/qrtc.py b/test-cli/test/tests/qrtc.py
index 715bcb7..6d4ecf6 100644
--- a/test-cli/test/tests/qrtc.py
+++ b/test-cli/test/tests/qrtc.py
@@ -7,6 +7,7 @@ import re
class Qrtc(unittest.TestCase):
params = None
__rtc = None
+ __resultlist = None # resultlist is a python list of python dictionaries
def __init__(self, testname, testfunc, varlist):
self.params = varlist
@@ -16,6 +17,7 @@ class Qrtc(unittest.TestCase):
else:
raise Exception('rtc param inside Qrtc must be defined')
self._testMethodDoc = testname
+ self.__resultlist = []
def execute(self):
# get time from RTC peripheral
@@ -31,13 +33,41 @@ class Qrtc(unittest.TestCase):
p.stdout.decode('ascii'))
# check if the seconds of both times are different
if time1 == time2:
+ self.__resultlist.append(
+ {
+ "desc": "Test result",
+ "data": "FAILED: RTC is not running",
+ "type": "string"
+ }
+ )
self.fail("failed: RTC is not running")
else:
- self.fail("failed: couldn't execute hwclock command 2nd time")
+ self.__resultlist.append(
+ {
+ "desc": "Test result",
+ "data": "FAILED: couldn't execute hwclock command for the second time",
+ "type": "string"
+ }
+ )
+ self.fail("failed: couldn't execute hwclock command for the second time")
else:
+ self.__resultlist.append(
+ {
+ "desc": "Test result",
+ "data": "FAILED: couldn't execute hwclock command",
+ "type": "string"
+ }
+ )
self.fail("failed: couldn't execute hwclock command")
+ # Test successful
+ self.__resultlist.append(
+ {
+ "desc": "Test result",
+ "data": "OK",
+ "type": "string"
+ }
+ )
+
def getresults(self):
- # resultlist is a python list of python dictionaries
- resultlist = []
- return resultlist
+ return self.__resultlist