diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-04-30 07:46:59 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-05-12 09:04:26 +0100 |
commit | 5a16dee75f4c73eef052464d588ead1c831672fe (patch) | |
tree | 5734d9a0d135a97ff720b3e6de6ab69636bd7c75 /meta/lib/oeqa/selftest/cases | |
parent | f3b8bea862a7701529899e868eed3c6d4fbc8ca6 (diff) | |
download | openembedded-core-contrib-5a16dee75f4c73eef052464d588ead1c831672fe.tar.gz |
oeqa/selftest: Automate manual pybootchart tests
Automate the current manual pybootchart tests. This includes a check
for the cairo dependency, skipping the test if appropriate.
Based on original patch from Armin Kuster <akuster808@gmail.com>
(From OE-Core rev: ff5370a381a4996b7da56aaaa7055f7a1786c823)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/oescripts.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/oescripts.py b/meta/lib/oeqa/selftest/cases/oescripts.py index 56b35b59eb..217afe3775 100644 --- a/meta/lib/oeqa/selftest/cases/oescripts.py +++ b/meta/lib/oeqa/selftest/cases/oescripts.py @@ -2,6 +2,7 @@ # SPDX-License-Identifier: MIT # +import os from oeqa.selftest.case import OESelftestTestCase from oeqa.selftest.cases.buildhistory import BuildhistoryBase from oeqa.utils.commands import Command, runCmd, bitbake, get_bb_var, get_test_layer @@ -28,3 +29,36 @@ class BuildhistoryDiffTests(BuildhistoryBase): self.fail('Unexpected line:\n%s\nExpected line endings:\n %s' % (line, '\n '.join(expected_endlines))) if expected_endlines: self.fail('Missing expected line endings:\n %s' % '\n '.join(expected_endlines)) + +class OEScriptTests(OESelftestTestCase): + + @classmethod + def setUpClass(cls): + super(OEScriptTests, cls).setUpClass() + try: + import cairo + except ImportError: + cls.skipTest('Python module cairo is not present') + bitbake("core-image-minimal -c rootfs -f") + cls.tmpdir = get_bb_var('TMPDIR') + cls.buildstats = cls.tmpdir + "/buildstats/" + sorted(os.listdir(cls.tmpdir + "/buildstats"))[-1] + + scripts_dir = os.path.join(get_bb_var('COREBASE'), 'scripts') + +class OEPybootchartguyTests(OEScriptTests): + + def test_pybootchartguy_help(self): + runCmd('%s/pybootchartgui/pybootchartgui.py --help' % self.scripts_dir) + + def test_pybootchartguy_to_generate_build_png_output(self): + runCmd('%s/pybootchartgui/pybootchartgui.py %s -o %s/charts -f png' % (self.scripts_dir, self.buildstats, self.tmpdir)) + self.assertTrue(os.path.exists(self.tmpdir + "/charts.png")) + + def test_pybootchartguy_to_generate_build_svg_output(self): + runCmd('%s/pybootchartgui/pybootchartgui.py %s -o %s/charts -f svg' % (self.scripts_dir, self.buildstats, self.tmpdir)) + self.assertTrue(os.path.exists(self.tmpdir + "/charts.svg")) + + def test_pybootchartguy_to_generate_build_pdf_output(self): + runCmd('%s/pybootchartgui/pybootchartgui.py %s -o %s/charts -f pdf' % (self.scripts_dir, self.buildstats, self.tmpdir)) + self.assertTrue(os.path.exists(self.tmpdir + "/charts.pdf")) + |