diff options
author | Ross Burton <ross.burton@intel.com> | 2018-12-11 23:26:33 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-12-13 16:32:21 +0000 |
commit | 5e15b242a49ded354d23cff616365209d3f8588b (patch) | |
tree | c4da839539b2b99280a4b82e2ec300ba2f87dc80 /meta/lib/oeqa/sdk/cases/perl.py | |
parent | 778f3ce1e66ebc517a36d8567b5debbf317be343 (diff) | |
download | poky-5e15b242a49ded354d23cff616365209d3f8588b.tar.gz |
oeqa/sdk: show output if run() fails
Use oeqa.utils.subprocesstweak to monkey-patch the subprocess exception so that
any output is shown, and remove any explicit try/catch handling that would have
hidden this.
(From OE-Core rev: 55964b33b561397287779ee474170790dfd03e85)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/sdk/cases/perl.py')
-rw-r--r-- | meta/lib/oeqa/sdk/cases/perl.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/meta/lib/oeqa/sdk/cases/perl.py b/meta/lib/oeqa/sdk/cases/perl.py index e1d2bc159a..b8adc5ac72 100644 --- a/meta/lib/oeqa/sdk/cases/perl.py +++ b/meta/lib/oeqa/sdk/cases/perl.py | |||
@@ -1,6 +1,9 @@ | |||
1 | import unittest | 1 | import unittest |
2 | from oeqa.sdk.case import OESDKTestCase | 2 | from oeqa.sdk.case import OESDKTestCase |
3 | 3 | ||
4 | from oeqa.utils.subprocesstweak import errors_have_output | ||
5 | errors_have_output() | ||
6 | |||
4 | class PerlTest(OESDKTestCase): | 7 | class PerlTest(OESDKTestCase): |
5 | def setUp(self): | 8 | def setUp(self): |
6 | if not (self.tc.hasHostPackage("nativesdk-perl") or | 9 | if not (self.tc.hasHostPackage("nativesdk-perl") or |
@@ -8,9 +11,6 @@ class PerlTest(OESDKTestCase): | |||
8 | raise unittest.SkipTest("No perl package in the SDK") | 11 | raise unittest.SkipTest("No perl package in the SDK") |
9 | 12 | ||
10 | def test_perl(self): | 13 | def test_perl(self): |
11 | try: | 14 | cmd = "perl -e '$_=\"Uryyb, jbeyq\"; tr/a-zA-Z/n-za-mN-ZA-M/;print'" |
12 | cmd = "perl -e '$_=\"Uryyb, jbeyq\"; tr/a-zA-Z/n-za-mN-ZA-M/;print'" | 15 | output = self._run(cmd) |
13 | output = self._run(cmd) | 16 | self.assertEqual(output, "Hello, world") |
14 | self.assertEqual(output, "Hello, world") | ||
15 | except subprocess.CalledProcessError as e: | ||
16 | self.fail("Unexpected exit %d (output %s)" % (e.returncode, e.output)) | ||