summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2022-03-31 19:29:10 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-01 23:11:37 +0100
commit679917f98f081672bb3331aeafab507f1fac6f17 (patch)
treec4bf3adfb9cc3b2aa5406127e6e9b67d383c7b39
parentfcc9c0ab37d1280538490a8069baf94984b38853 (diff)
downloadpoky-679917f98f081672bb3331aeafab507f1fac6f17.tar.gz
oeqa/selftest/oescripts: refactor skipping logic
OEScriptTests currently skips if cairo isn't present, and does a build of core-image-minimal. This is only required for the OEPybootchartguyTests tests, so move that logic there so that the OEListPackageconfigTests run even if cairo isn't available. This leaves OEScriptTests as a simple class containing the scripts_dir assignment, which can then be reused by other tests to avoid code duplication. (From OE-Core rev: fe3ee517772ad8396fcac21ae7eb8d1c8b68fbdb) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/selftest/cases/oescripts.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/meta/lib/oeqa/selftest/cases/oescripts.py b/meta/lib/oeqa/selftest/cases/oescripts.py
index b3261e512f..cd687816c8 100644
--- a/meta/lib/oeqa/selftest/cases/oescripts.py
+++ b/meta/lib/oeqa/selftest/cases/oescripts.py
@@ -34,21 +34,19 @@ class BuildhistoryDiffTests(BuildhistoryBase):
34 if expected_endlines: 34 if expected_endlines:
35 self.fail('Missing expected line endings:\n %s' % '\n '.join(expected_endlines)) 35 self.fail('Missing expected line endings:\n %s' % '\n '.join(expected_endlines))
36 36
37@unittest.skipUnless(importlib.util.find_spec("cairo"), "Python cairo module is not present")
38class OEScriptTests(OESelftestTestCase): 37class OEScriptTests(OESelftestTestCase):
38 scripts_dir = os.path.join(get_bb_var('COREBASE'), 'scripts')
39
40@unittest.skipUnless(importlib.util.find_spec("cairo"), "Python cairo module is not present")
41class OEPybootchartguyTests(OEScriptTests):
39 42
40 @classmethod 43 @classmethod
41 def setUpClass(cls): 44 def setUpClass(cls):
42 super(OEScriptTests, cls).setUpClass() 45 super(OEScriptTests, cls).setUpClass()
43 import cairo
44 bitbake("core-image-minimal -c rootfs -f") 46 bitbake("core-image-minimal -c rootfs -f")
45 cls.tmpdir = get_bb_var('TMPDIR') 47 cls.tmpdir = get_bb_var('TMPDIR')
46 cls.buildstats = cls.tmpdir + "/buildstats/" + sorted(os.listdir(cls.tmpdir + "/buildstats"))[-1] 48 cls.buildstats = cls.tmpdir + "/buildstats/" + sorted(os.listdir(cls.tmpdir + "/buildstats"))[-1]
47 49
48 scripts_dir = os.path.join(get_bb_var('COREBASE'), 'scripts')
49
50class OEPybootchartguyTests(OEScriptTests):
51
52 def test_pybootchartguy_help(self): 50 def test_pybootchartguy_help(self):
53 runCmd('%s/pybootchartgui/pybootchartgui.py --help' % self.scripts_dir) 51 runCmd('%s/pybootchartgui/pybootchartgui.py --help' % self.scripts_dir)
54 52
@@ -65,9 +63,7 @@ class OEPybootchartguyTests(OEScriptTests):
65 self.assertTrue(os.path.exists(self.tmpdir + "/charts.pdf")) 63 self.assertTrue(os.path.exists(self.tmpdir + "/charts.pdf"))
66 64
67 65
68class OEGitproxyTests(OESelftestTestCase): 66class OEGitproxyTests(OEScriptTests):
69
70 scripts_dir = os.path.join(get_bb_var('COREBASE'), 'scripts')
71 67
72 def test_oegitproxy_help(self): 68 def test_oegitproxy_help(self):
73 try: 69 try: