Bug 11482 - yocto-compat-layer.py: return non-zero exit codes
Summary: yocto-compat-layer.py: return non-zero exit codes
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: Scripts and Tools (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ enhancement
Target Milestone: 2.4 M1
Assignee: Aníbal Limón
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-05-08 15:08 UTC by Patrick Ohly
Modified: 2017-06-09 16:45 UTC (History)
1 user (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Ohly 2017-05-08 15:08:22 UTC
In the summary after a test, yocto-compat-layer.py explains which tests failed, but then doesn't actually indicate that to the caller in the return code:

$ oe-selftest ... 
INFO: ----------------------------------------------------------------------
INFO: Ran 4 tests in 2.756s
INFO: 
INFO: FAILED (errors=1, skipped=3)
INFO: 
INFO: Summary of results:
INFO: 
INFO: meta-refkit-gateway ... FAIL
# echo $?
0

That's because main() in yocto-compat-layer.py always returns 0. It would be better if it returned 1 if any test failed and 2 if none were run.

The a script can test for success (== 0) and distinguish between different kinds of failures (error or no tests) if desired.