aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/tc-testing/plugin-lib/valgrindPlugin.py
diff options
context:
space:
mode:
authorLucas Bates <lucasb@mojatatu.com>2019-02-28 17:38:40 -0500
committerDavid S. Miller <davem@davemloft.net>2019-03-02 02:05:06 -0500
commit255c1c7279abf991113e7c9c29f91e9f1a5776a9 (patch)
tree4f6240e2b26aebed6b08666983290e33b345761c /tools/testing/selftests/tc-testing/plugin-lib/valgrindPlugin.py
parent745732c8ecf89ad60f7e393094d4993284bd1869 (diff)
tc-testing: Allow test cases to be skipped
By adding a check for an optional key/value pair to the test case data, individual test cases may be skipped to prevent tdc from aborting a test run due to setup or teardown failure. If a test case is skipped, it will still appear in the results output to allow for a consistent number of executed tests in each run. However, the test will be marked as skipped. This support for skipping extends to any plugins that may generate additional results for each executed test. Signed-off-by: Lucas Bates <lucasb@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests/tc-testing/plugin-lib/valgrindPlugin.py')
-rw-r--r--tools/testing/selftests/tc-testing/plugin-lib/valgrindPlugin.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/testing/selftests/tc-testing/plugin-lib/valgrindPlugin.py b/tools/testing/selftests/tc-testing/plugin-lib/valgrindPlugin.py
index e00c798de0bb..4bb866575ea1 100644
--- a/tools/testing/selftests/tc-testing/plugin-lib/valgrindPlugin.py
+++ b/tools/testing/selftests/tc-testing/plugin-lib/valgrindPlugin.py
@@ -102,6 +102,14 @@ class SubPlugin(TdcPlugin):
102 if not self.args.valgrind: 102 if not self.args.valgrind:
103 return 103 return
104 104
105 res = TestResult('{}-mem'.format(self.args.testid),
106 '{} memory leak check'.format(self.args.test_name))
107 if self.args.test_skip:
108 res.set_result(ResultState.skip)
109 res.set_errormsg('Test case designated as skipped.')
110 self._add_results(res)
111 return
112
105 self.definitely_lost_re = re.compile( 113 self.definitely_lost_re = re.compile(
106 r'definitely lost:\s+([,0-9]+)\s+bytes in\s+([,0-9]+)\sblocks', re.MULTILINE | re.DOTALL) 114 r'definitely lost:\s+([,0-9]+)\s+bytes in\s+([,0-9]+)\sblocks', re.MULTILINE | re.DOTALL)
107 self.indirectly_lost_re = re.compile( 115 self.indirectly_lost_re = re.compile(
@@ -134,8 +142,6 @@ class SubPlugin(TdcPlugin):
134 nle_num = int(nle_mo.group(1)) 142 nle_num = int(nle_mo.group(1))
135 143
136 mem_results = '' 144 mem_results = ''
137 res = TestResult('{}-mem'.format(self.args.testid),
138 '{} memory leak check'.format(self.args.test_name))
139 if (def_num > 0) or (ind_num > 0) or (pos_num > 0) or (nle_num > 0): 145 if (def_num > 0) or (ind_num > 0) or (pos_num > 0) or (nle_num > 0):
140 mem_results += 'not ' 146 mem_results += 'not '
141 res.set_result(ResultState.fail) 147 res.set_result(ResultState.fail)
@@ -146,12 +152,6 @@ class SubPlugin(TdcPlugin):
146 152
147 self._add_results(res) 153 self._add_results(res)
148 154
149 mem_results += 'ok {} - {}-mem # {}\n'.format(
150 self.args.test_ordinal, self.args.testid, 'memory leak check')
151 self._add_to_tap(mem_results)
152 if mem_results.startswith('not '):
153 print('{}'.format(content))
154 self._add_to_tap(content)
155 155
156 def _add_results(self, res): 156 def _add_results(self, res):
157 self._tsr.add_resultdata(res) 157 self._tsr.add_resultdata(res)