[OE-core] [PATCH] oe-selftest: meta_ide: add test for meta-ide-support

Yeoh Ee Peng ee.peng.yeoh at intel.com
Wed Jan 24 18:49:38 UTC 2018


QA team were testing meta-ide-support manually. Add automated
tests to test that bibtake meta-ide-support will create the
toolchain and environment setup script. Also test that after
using environment setup script, one can compile c program.

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh at intel.com>
---
 meta/lib/oeqa/selftest/cases/meta_ide.py | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 meta/lib/oeqa/selftest/cases/meta_ide.py

diff --git a/meta/lib/oeqa/selftest/cases/meta_ide.py b/meta/lib/oeqa/selftest/cases/meta_ide.py
new file mode 100644
index 0000000..1c1c5ab
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/meta_ide.py
@@ -0,0 +1,31 @@
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import bitbake, get_bb_vars, runCmd
+import tempfile
+import shutil
+
+class MetaIDE(OESelftestTestCase):
+
+    @classmethod
+    def setUpClass(cls):
+        super(MetaIDE, cls).setUpClass()
+        bitbake('meta-ide-support')
+        bb_vars = get_bb_vars(['MULTIMACH_TARGET_SYS', 'TMPDIR', 'COREBASE'])
+        cls.environment_script = 'environment-setup-%s' % bb_vars['MULTIMACH_TARGET_SYS']
+        cls.tmpdir = bb_vars['TMPDIR']
+        cls.environment_script_path = '%s/%s' % (cls.tmpdir, cls.environment_script)
+        cls.corebasedir = bb_vars['COREBASE']
+        cls.tmpdir_metaideQA = tempfile.mkdtemp(prefix='metaide')
+
+    @classmethod
+    def tearDownClass(cls):
+        shutil.rmtree(cls.tmpdir_metaideQA, ignore_errors=True)
+        super(MetaIDE, cls).tearDownClass()
+
+    def test_meta_ide_had_installed_meta_ide_support(self):
+        self.assertExists(self.environment_script_path)
+
+    def test_meta_ide_can_compiled_cprogram(self):
+        runCmd('cp %s/test.c %s' % (self.tc.files_dir, self.tmpdir_metaideQA))
+        runCmd("cd %s; . %s; $CC test.c -lm" % (self.tmpdir_metaideQA, self.environment_script_path))
+        compiled_file = '%s/a.out' % self.tmpdir_metaideQA
+        self.assertExists(compiled_file)
-- 
2.7.4




More information about the Openembedded-core mailing list