diff options
author | Paul Barker <pbarker@konsulko.com> | 2020-06-03 21:07:38 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-06-04 13:27:32 +0100 |
commit | 9800884deb81f01429d86014e0e6fadd2d659faa (patch) | |
tree | 02c8fa6500ae7a997dd1e470777bf5328597d94f /meta | |
parent | 18a69b1cd26112a78db9b062348a98ceeabe377b (diff) | |
download | poky-9800884deb81f01429d86014e0e6fadd2d659faa.tar.gz |
oe-selftest: Recursively patch test case paths
This ensures that builddir is updated correctly to point to the new
selftest build directory when we're given a list of test suites instead
of a list of test cases.
(From OE-Core rev: 56e211d0f3c6cb84f5982e5de00faeeed69c1912)
Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oeqa/selftest/context.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/meta/lib/oeqa/selftest/context.py b/meta/lib/oeqa/selftest/context.py index 7589ca3c1f..494e9dbd1e 100644 --- a/meta/lib/oeqa/selftest/context.py +++ b/meta/lib/oeqa/selftest/context.py | |||
@@ -10,6 +10,7 @@ import glob | |||
10 | import sys | 10 | import sys |
11 | import importlib | 11 | import importlib |
12 | import subprocess | 12 | import subprocess |
13 | import unittest | ||
13 | from random import choice | 14 | from random import choice |
14 | 15 | ||
15 | import oeqa | 16 | import oeqa |
@@ -60,9 +61,9 @@ class OESelftestTestContext(OETestContext): | |||
60 | 61 | ||
61 | os.chdir(newbuilddir) | 62 | os.chdir(newbuilddir) |
62 | 63 | ||
63 | for t in suite: | 64 | def patch_test(t): |
64 | if not hasattr(t, "tc"): | 65 | if not hasattr(t, "tc"): |
65 | continue | 66 | return |
66 | cp = t.tc.config_paths | 67 | cp = t.tc.config_paths |
67 | for p in cp: | 68 | for p in cp: |
68 | if selftestdir in cp[p] and newselftestdir not in cp[p]: | 69 | if selftestdir in cp[p] and newselftestdir not in cp[p]: |
@@ -70,6 +71,15 @@ class OESelftestTestContext(OETestContext): | |||
70 | if builddir in cp[p] and newbuilddir not in cp[p]: | 71 | if builddir in cp[p] and newbuilddir not in cp[p]: |
71 | cp[p] = cp[p].replace(builddir, newbuilddir) | 72 | cp[p] = cp[p].replace(builddir, newbuilddir) |
72 | 73 | ||
74 | def patch_suite(s): | ||
75 | for x in s: | ||
76 | if isinstance(x, unittest.TestSuite): | ||
77 | patch_suite(x) | ||
78 | else: | ||
79 | patch_test(x) | ||
80 | |||
81 | patch_suite(suite) | ||
82 | |||
73 | return (builddir, newbuilddir) | 83 | return (builddir, newbuilddir) |
74 | 84 | ||
75 | def prepareSuite(self, suites, processes): | 85 | def prepareSuite(self, suites, processes): |