mirror of
https://git.yoctoproject.org/poky
synced 2026-09-16 18:49:34 +02:00
selftest/recipetool: Split tests into separate test classes
Split tests into separate test classes to speed up individual test runs by reducing the test setup to a minimum. The pkgdata generation is only needed for the append tests and slow down the other tests. (From OE-Core rev: 2aef869bcca3e0de4afb9ef00492de3ee72b035c) Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
db210eef9a
commit
d5a8ab8b56
@@ -68,7 +68,7 @@ class RecipetoolBase(devtool.DevtoolBase):
|
|||||||
return bbappendfile, result.output
|
return bbappendfile, result.output
|
||||||
|
|
||||||
|
|
||||||
class RecipetoolTests(RecipetoolBase):
|
class RecipetoolAppendTests(RecipetoolBase):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
@@ -76,9 +76,8 @@ class RecipetoolTests(RecipetoolBase):
|
|||||||
# Ensure we have the right data in shlibs/pkgdata
|
# Ensure we have the right data in shlibs/pkgdata
|
||||||
cls.logger.info('Running bitbake to generate pkgdata')
|
cls.logger.info('Running bitbake to generate pkgdata')
|
||||||
bitbake('-c packagedata base-files coreutils busybox selftest-recipetool-appendfile')
|
bitbake('-c packagedata base-files coreutils busybox selftest-recipetool-appendfile')
|
||||||
bb_vars = get_bb_vars(['COREBASE', 'BBPATH'])
|
bb_vars = get_bb_vars(['COREBASE'])
|
||||||
cls.corebase = bb_vars['COREBASE']
|
cls.corebase = bb_vars['COREBASE']
|
||||||
cls.bbpath = bb_vars['BBPATH']
|
|
||||||
|
|
||||||
def _try_recipetool_appendfile(self, testrecipe, destfile, newfile, options, expectedlines, expectedfiles):
|
def _try_recipetool_appendfile(self, testrecipe, destfile, newfile, options, expectedlines, expectedfiles):
|
||||||
cmd = 'recipetool appendfile %s %s %s %s' % (self.templayerdir, destfile, newfile, options)
|
cmd = 'recipetool appendfile %s %s %s %s' % (self.templayerdir, destfile, newfile, options)
|
||||||
@@ -332,6 +331,9 @@ class RecipetoolTests(RecipetoolBase):
|
|||||||
filename = try_appendfile_wc('-w')
|
filename = try_appendfile_wc('-w')
|
||||||
self.assertEqual(filename, recipefn.split('_')[0] + '_%.bbappend')
|
self.assertEqual(filename, recipefn.split('_')[0] + '_%.bbappend')
|
||||||
|
|
||||||
|
|
||||||
|
class RecipetoolCreateTests(RecipetoolBase):
|
||||||
|
|
||||||
def test_recipetool_create(self):
|
def test_recipetool_create(self):
|
||||||
# Try adding a recipe
|
# Try adding a recipe
|
||||||
tempsrc = os.path.join(self.tempdir, 'srctree')
|
tempsrc = os.path.join(self.tempdir, 'srctree')
|
||||||
@@ -518,6 +520,15 @@ class RecipetoolTests(RecipetoolBase):
|
|||||||
inherits = ['pkgconfig', 'autotools']
|
inherits = ['pkgconfig', 'autotools']
|
||||||
self._test_recipe_contents(recipefile, checkvars, inherits)
|
self._test_recipe_contents(recipefile, checkvars, inherits)
|
||||||
|
|
||||||
|
|
||||||
|
class RecipetoolTests(RecipetoolBase):
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def setUpClass(cls):
|
||||||
|
super(RecipetoolTests, cls).setUpClass()
|
||||||
|
bb_vars = get_bb_vars(['BBPATH'])
|
||||||
|
cls.bbpath = bb_vars['BBPATH']
|
||||||
|
|
||||||
def _copy_file_with_cleanup(self, srcfile, basedstdir, *paths):
|
def _copy_file_with_cleanup(self, srcfile, basedstdir, *paths):
|
||||||
dstdir = basedstdir
|
dstdir = basedstdir
|
||||||
self.assertTrue(os.path.exists(dstdir))
|
self.assertTrue(os.path.exists(dstdir))
|
||||||
|
|||||||
Reference in New Issue
Block a user