oeqa: sdk: Capture stderr output
PATCH 1/1 oeqa: sdk: Capture stderr output
Redirect stderr to stdout when running subcommands while doing the SDK tests. The tests will show stdout when CalledProcessError is raised, but any output to stderr was lost.
Signed-off-by Joshua Watt <[email protected]>
--- meta/lib/oeqa/sdk/case.py | 2 +- meta/lib/oeqa/sdk/cases/assimp.py | 2 +- meta/lib/oeqa/sdk/cases/buildcpio.py | 2 +- meta/lib/oeqa/sdk/cases/buildepoxy.py | 2 +- meta/lib/oeqa/sdk/cases/buildgalculator.py | 2 +- meta/lib/oeqa/sdk/cases/buildlzip.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-)
meta/lib/oeqa/sdk/case.py +1 -1
@@ -26,7 +26,7 @@ class OESDKTestCase(OETestCase): return tarball tarball = os.path.join(workdir, archive) - subprocess.check_output(["wget", "-O", tarball, url]) + subprocess.check_output(["wget", "-O", tarball, url], stderr=subprocess.STDOUT) return tarball def check_elf(self, path, target_os=None, target_arch=None):
meta/lib/oeqa/sdk/cases/assimp.py +1 -1
@@ -30,7 +30,7 @@ class BuildAssimp(OESDKTestCase): dirs["build"] = os.path.join(testdir, "build") dirs["install"] = os.path.join(testdir, "install") - subprocess.check_output(["tar", "xf", tarball, "-C", testdir]) + subprocess.check_output(["tar", "xf", tarball, "-C", testdir], stderr=subprocess.STDOUT) self.assertTrue(os.path.isdir(dirs["source"])) os.makedirs(dirs["build"])
meta/lib/oeqa/sdk/cases/buildcpio.py +1 -1
@@ -24,7 +24,7 @@ class BuildCpioTest(OESDKTestCase): dirs["build"] = os.path.join(testdir, "build") dirs["install"] = os.path.join(testdir, "install") - subprocess.check_output(["tar", "xf", tarball, "-C", testdir]) + subprocess.check_output(["tar", "xf", tarball, "-C", testdir], stderr=subprocess.STDOUT) self.assertTrue(os.path.isdir(dirs["source"])) os.makedirs(dirs["build"])
meta/lib/oeqa/sdk/cases/buildepoxy.py +1 -1
@@ -28,7 +28,7 @@ class EpoxyTest(OESDKTestCase): dirs["build"] = os.path.join(testdir, "build") dirs["install"] = os.path.join(testdir, "install") - subprocess.check_output(["tar", "xf", tarball, "-C", testdir]) + subprocess.check_output(["tar", "xf", tarball, "-C", testdir], stderr=subprocess.STDOUT) self.assertTrue(os.path.isdir(dirs["source"])) os.makedirs(dirs["build"])
meta/lib/oeqa/sdk/cases/buildgalculator.py +1 -1
@@ -31,7 +31,7 @@ class GalculatorTest(OESDKTestCase): dirs["build"] = os.path.join(testdir, "build") dirs["install"] = os.path.join(testdir, "install") - subprocess.check_output(["tar", "xf", tarball, "-C", testdir]) + subprocess.check_output(["tar", "xf", tarball, "-C", testdir], stderr=subprocess.STDOUT) self.assertTrue(os.path.isdir(dirs["source"])) os.makedirs(dirs["build"])
meta/lib/oeqa/sdk/cases/buildlzip.py +1 -1
@@ -20,7 +20,7 @@ class BuildLzipTest(OESDKTestCase): dirs["build"] = os.path.join(testdir, "build") dirs["install"] = os.path.join(testdir, "install") - subprocess.check_output(["tar", "xf", tarball, "-C", testdir]) + subprocess.check_output(["tar", "xf", tarball, "-C", testdir], stderr=subprocess.STDOUT) self.assertTrue(os.path.isdir(dirs["source"])) os.makedirs(dirs["build"])
Signature · 1 line
2.28.0
Quoted 6 lines · Joshua Watt
Redirect stderr to stdout when running subcommands while doing the SDK
tests. The tests will show stdout when CalledProcessError is raised, but any output to stderr was lost.Signed-off-by Joshua Watt <[email protected]>
Quoted 8 lines
--- meta/lib/oeqa/sdk/case.py | 2 +- meta/lib/oeqa/sdk/cases/assimp.py | 2 +- meta/lib/oeqa/sdk/cases/buildcpio.py | 2 +- meta/lib/oeqa/sdk/cases/buildepoxy.py | 2 +- meta/lib/oeqa/sdk/cases/buildgalculator.py | 2 +- meta/lib/oeqa/sdk/cases/buildlzip.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-)
Thanks, I ran into this the other day and have a note left on my desktop to remind me to try and figure out what was happening!
Cheers,
Richard