aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2017-11-24 10:08:05 +0200
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2018-04-16 09:54:20 +0300
commitc0f00df45b6e0f607553d3cbea36aa813a204a34 (patch)
tree0e08937ab2f025e7c41ba3ce7e2f8c99c080f9cc
parentccf3de8c733d9241ffa83095bd7cab28d0244bfd (diff)
downloadopenembedded-core-contrib-marquiz/fixes-9338.tar.gz
oeqa: add selftest for python pgomarquiz/fixes-9338
Check that we're able to run python profile task on qemu and that python builds when pgo is enabled. [YOCTO #9338] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rw-r--r--meta/lib/oeqa/selftest/cases/python.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/python.py b/meta/lib/oeqa/selftest/cases/python.py
new file mode 100644
index 0000000000..9379c428f5
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/python.py
@@ -0,0 +1,29 @@
+import os
+import shutil
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import bitbake, get_bb_vars, runCmd
+
+
+class PythonTests(OESelftestTestCase):
+
+ def test_python_pgo(self):
+ bbvars = get_bb_vars(['TMPDIR', 'MACHINE'])
+ profile_dir = os.path.join(bbvars['TMPDIR'], 'oeqa', bbvars['MACHINE'], 'python3-pgo-data')
+
+ self.write_config("""
+PYTHON3_PROFILE_OPT = "1"
+PYTHON3_PROFILE_TASK = "-m test.regrtest test_abc"
+PYTHON3_PROFILE_DIR = "{}"
+""".format(profile_dir))
+
+ profile_file = os.path.join(profile_dir, 'Objects', 'object.gcda')
+
+ bitbake('python-pgo-image -ccleansstate')
+ bitbake('python-pgo-image -cprofile')
+
+ # Check that profile task generated a file
+ self.assertTrue(os.path.isfile(profile_file))
+
+ # Check that python builds with pgo enabled
+ bitbake('python3')