diff options
Diffstat (limited to 'meta/lib/oeqa/core/utils/concurrencytest.py')
-rw-r--r-- | meta/lib/oeqa/core/utils/concurrencytest.py | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/meta/lib/oeqa/core/utils/concurrencytest.py b/meta/lib/oeqa/core/utils/concurrencytest.py index 0d9c01e6d4..fac59f765a 100644 --- a/meta/lib/oeqa/core/utils/concurrencytest.py +++ b/meta/lib/oeqa/core/utils/concurrencytest.py | |||
@@ -177,9 +177,10 @@ class dummybuf(object): | |||
177 | # | 177 | # |
178 | class ConcurrentTestSuite(unittest.TestSuite): | 178 | class ConcurrentTestSuite(unittest.TestSuite): |
179 | 179 | ||
180 | def __init__(self, suite, processes): | 180 | def __init__(self, suite, processes, setupfunc): |
181 | super(ConcurrentTestSuite, self).__init__([suite]) | 181 | super(ConcurrentTestSuite, self).__init__([suite]) |
182 | self.processes = processes | 182 | self.processes = processes |
183 | self.setupfunc = setupfunc | ||
183 | 184 | ||
184 | def run(self, result): | 185 | def run(self, result): |
185 | tests, totaltests = fork_for_tests(self.processes, self) | 186 | tests, totaltests = fork_for_tests(self.processes, self) |
@@ -272,37 +273,7 @@ def fork_for_tests(concurrency_num, suite): | |||
272 | stream = os.fdopen(c2pwrite, 'wb', 1) | 273 | stream = os.fdopen(c2pwrite, 'wb', 1) |
273 | os.close(c2pread) | 274 | os.close(c2pread) |
274 | 275 | ||
275 | # Create a new separate BUILDDIR for each group of tests | 276 | (builddir, newbuilddir) = suite.setupfunc("-st-" + str(ourpid), selftestdir, process_suite) |
276 | if 'BUILDDIR' in os.environ: | ||
277 | builddir = os.environ['BUILDDIR'] | ||
278 | newbuilddir = builddir + "-st-" + str(ourpid) | ||
279 | newselftestdir = newbuilddir + "/meta-selftest" | ||
280 | |||
281 | bb.utils.mkdirhier(newbuilddir) | ||
282 | oe.path.copytree(builddir + "/conf", newbuilddir + "/conf") | ||
283 | oe.path.copytree(builddir + "/cache", newbuilddir + "/cache") | ||
284 | oe.path.copytree(selftestdir, newselftestdir) | ||
285 | |||
286 | for e in os.environ: | ||
287 | if builddir in os.environ[e]: | ||
288 | os.environ[e] = os.environ[e].replace(builddir, newbuilddir) | ||
289 | |||
290 | subprocess.check_output("git init; git add *; git commit -a -m 'initial'", cwd=newselftestdir, shell=True) | ||
291 | |||
292 | # Tried to used bitbake-layers add/remove but it requires recipe parsing and hence is too slow | ||
293 | subprocess.check_output("sed %s/conf/bblayers.conf -i -e 's#%s#%s#g'" % (newbuilddir, selftestdir, newselftestdir), cwd=newbuilddir, shell=True) | ||
294 | |||
295 | os.chdir(newbuilddir) | ||
296 | |||
297 | for t in process_suite: | ||
298 | if not hasattr(t, "tc"): | ||
299 | continue | ||
300 | cp = t.tc.config_paths | ||
301 | for p in cp: | ||
302 | if selftestdir in cp[p] and newselftestdir not in cp[p]: | ||
303 | cp[p] = cp[p].replace(selftestdir, newselftestdir) | ||
304 | if builddir in cp[p] and newbuilddir not in cp[p]: | ||
305 | cp[p] = cp[p].replace(builddir, newbuilddir) | ||
306 | 277 | ||
307 | # Leave stderr and stdout open so we can see test noise | 278 | # Leave stderr and stdout open so we can see test noise |
308 | # Close stdin so that the child goes away if it decides to | 279 | # Close stdin so that the child goes away if it decides to |