diff options
| author | Manuel Traut <manut@linutronix.de> | 2018-12-04 08:45:18 +0100 |
|---|---|---|
| committer | Manuel Traut <manut@linutronix.de> | 2018-12-04 10:39:00 +0100 |
| commit | 2fa977d473ebfb0c20d718eaa29489363fe68d7f (patch) | |
| tree | 6daf7eb28d4f47fcc088a2c0ce13886945df99cf | |
| parent | 3923fa6335dd8e1ee2dee3b8d64d3952103d1306 (diff) | |
optional return error-code
Add an option. If enabled pyjutest returns the returncode of the
command under test. If not, pyjutest stores the returnvalue of
the command under test just in the junit file.
This can be used to abort an underlaying test or testframework.
Signed-off-by: Manuel Traut <manut@linutronix.de>
Reviewed-by: Benedikt Spranger <b.spranger@linutronix.de>
| -rwxr-xr-x | pyjutest | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -24,6 +24,7 @@ oparser = OptionParser(usage="usage: %prog [options] \'mycmd param1 param2\'") oparser.add_option("--version", dest="version", action="store_true", default=False) oparser.add_option("--class", dest="uclass", default="sh") oparser.add_option("--name", dest="uname", default=None) +oparser.add_option("--return", dest="ret", action="store_true", default=False) (opt,args) = oparser.parse_args(sys.argv) @@ -93,3 +94,6 @@ with open('pyjutest.dat', 'wb') as dat: with open('pyjutest.xml', 'w') as xml: TestSuite.to_file(xml, tss, prettyprint=True) + +if opt.ret: + sys.exit(p.returncode) |
