mirror of
https://git.yoctoproject.org/poky
synced 2026-09-19 18:49:32 +02:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
18a69b1cd2
commit
9800884deb
@@ -10,6 +10,7 @@ import glob
|
|||||||
import sys
|
import sys
|
||||||
import importlib
|
import importlib
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import unittest
|
||||||
from random import choice
|
from random import choice
|
||||||
|
|
||||||
import oeqa
|
import oeqa
|
||||||
@@ -60,9 +61,9 @@ class OESelftestTestContext(OETestContext):
|
|||||||
|
|
||||||
os.chdir(newbuilddir)
|
os.chdir(newbuilddir)
|
||||||
|
|
||||||
for t in suite:
|
def patch_test(t):
|
||||||
if not hasattr(t, "tc"):
|
if not hasattr(t, "tc"):
|
||||||
continue
|
return
|
||||||
cp = t.tc.config_paths
|
cp = t.tc.config_paths
|
||||||
for p in cp:
|
for p in cp:
|
||||||
if selftestdir in cp[p] and newselftestdir not in cp[p]:
|
if selftestdir in cp[p] and newselftestdir not in cp[p]:
|
||||||
@@ -70,6 +71,15 @@ class OESelftestTestContext(OETestContext):
|
|||||||
if builddir in cp[p] and newbuilddir not in cp[p]:
|
if builddir in cp[p] and newbuilddir not in cp[p]:
|
||||||
cp[p] = cp[p].replace(builddir, newbuilddir)
|
cp[p] = cp[p].replace(builddir, newbuilddir)
|
||||||
|
|
||||||
|
def patch_suite(s):
|
||||||
|
for x in s:
|
||||||
|
if isinstance(x, unittest.TestSuite):
|
||||||
|
patch_suite(x)
|
||||||
|
else:
|
||||||
|
patch_test(x)
|
||||||
|
|
||||||
|
patch_suite(suite)
|
||||||
|
|
||||||
return (builddir, newbuilddir)
|
return (builddir, newbuilddir)
|
||||||
|
|
||||||
def prepareSuite(self, suites, processes):
|
def prepareSuite(self, suites, processes):
|
||||||
|
|||||||
Reference in New Issue
Block a user