summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorTrevor Gamblin <tgamblin@baylibre.com>2024-09-24 07:55:02 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-09-30 17:00:50 +0100
commit1d813b0d53a71bd3e6e2e0a0c1e8c3729688526f (patch)
tree3c57bc8b8e443c793093fcc4fd51f02b52fef39a /scripts
parent4c378fc89566a329d0974bbcfefc7405779bc919 (diff)
downloadpoky-1d813b0d53a71bd3e6e2e0a0c1e8c3729688526f.tar.gz
scripts/patchtest: split out result messages
Add a minor refactor for the result output. (From OE-Core rev: 5553edc0f8d58dc6e3a4f703af9bdb04fda1e12f) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/patchtest23
1 files changed, 15 insertions, 8 deletions
diff --git a/scripts/patchtest b/scripts/patchtest
index 278fc4e6e0..9218db232a 100755
--- a/scripts/patchtest
+++ b/scripts/patchtest
@@ -165,16 +165,23 @@ def run(patch, logfile=None):
165 postmerge_resultklass = getResult(patch, True, logfile) 165 postmerge_resultklass = getResult(patch, True, logfile)
166 postmerge_result = _runner(postmerge_resultklass, 'test') 166 postmerge_result = _runner(postmerge_resultklass, 'test')
167 167
168 print('----------------------------------------------------------------------\n') 168 print_result_message(premerge_result, postmerge_result)
169 if premerge_result == 2 and postmerge_result == 2:
170 logger.error('patchtest: No test cases found - did you specify the correct suite directory?')
171 if premerge_result == 1 or postmerge_result == 1:
172 logger.error('WARNING: patchtest: At least one patchtest caused a failure or an error - please check https://wiki.yoctoproject.org/wiki/Patchtest for further guidance')
173 else:
174 logger.info('OK: patchtest: All patchtests passed')
175 print('----------------------------------------------------------------------\n')
176 return premerge_result or postmerge_result 169 return premerge_result or postmerge_result
177 170
171def print_result_message(preresult, postresult):
172 print("----------------------------------------------------------------------\n")
173 if preresult == 2 and postresult == 2:
174 logger.error(
175 "patchtest: No test cases found - did you specify the correct suite directory?"
176 )
177 if preresult == 1 or postresult == 1:
178 logger.error(
179 "WARNING: patchtest: At least one patchtest caused a failure or an error - please check https://wiki.yoctoproject.org/wiki/Patchtest for further guidance"
180 )
181 else:
182 logger.info("OK: patchtest: All patchtests passed")
183 print("----------------------------------------------------------------------\n")
184
178def main(): 185def main():
179 tmp_patch = False 186 tmp_patch = False
180 patch_path = PatchtestParser.patch_path 187 patch_path = PatchtestParser.patch_path