diff options
| author | Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> | 2021-12-08 11:18:37 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-12-09 10:33:25 +0000 |
| commit | d5a8ab8b56c9d506d49c382a46a3d41c6c4a6dcd (patch) | |
| tree | 56a24b311594a9fa643e864e31d5d8416af4bd49 | |
| parent | db210eef9ad4bcc626f7afc7c81277c7ec5a9a83 (diff) | |
| download | poky-d5a8ab8b56c9d506d49c382a46a3d41c6c4a6dcd.tar.gz | |
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>
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/recipetool.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py index 8dc00ac10e..1aedc02b99 100644 --- a/meta/lib/oeqa/selftest/cases/recipetool.py +++ b/meta/lib/oeqa/selftest/cases/recipetool.py | |||
| @@ -68,7 +68,7 @@ class RecipetoolBase(devtool.DevtoolBase): | |||
| 68 | return bbappendfile, result.output | 68 | return bbappendfile, result.output |
| 69 | 69 | ||
| 70 | 70 | ||
| 71 | class RecipetoolTests(RecipetoolBase): | 71 | class RecipetoolAppendTests(RecipetoolBase): |
| 72 | 72 | ||
| 73 | @classmethod | 73 | @classmethod |
| 74 | def setUpClass(cls): | 74 | def setUpClass(cls): |
| @@ -76,9 +76,8 @@ class RecipetoolTests(RecipetoolBase): | |||
| 76 | # Ensure we have the right data in shlibs/pkgdata | 76 | # Ensure we have the right data in shlibs/pkgdata |
| 77 | cls.logger.info('Running bitbake to generate pkgdata') | 77 | cls.logger.info('Running bitbake to generate pkgdata') |
| 78 | bitbake('-c packagedata base-files coreutils busybox selftest-recipetool-appendfile') | 78 | bitbake('-c packagedata base-files coreutils busybox selftest-recipetool-appendfile') |
| 79 | bb_vars = get_bb_vars(['COREBASE', 'BBPATH']) | 79 | bb_vars = get_bb_vars(['COREBASE']) |
| 80 | cls.corebase = bb_vars['COREBASE'] | 80 | cls.corebase = bb_vars['COREBASE'] |
| 81 | cls.bbpath = bb_vars['BBPATH'] | ||
| 82 | 81 | ||
| 83 | def _try_recipetool_appendfile(self, testrecipe, destfile, newfile, options, expectedlines, expectedfiles): | 82 | def _try_recipetool_appendfile(self, testrecipe, destfile, newfile, options, expectedlines, expectedfiles): |
| 84 | cmd = 'recipetool appendfile %s %s %s %s' % (self.templayerdir, destfile, newfile, options) | 83 | cmd = 'recipetool appendfile %s %s %s %s' % (self.templayerdir, destfile, newfile, options) |
| @@ -332,6 +331,9 @@ class RecipetoolTests(RecipetoolBase): | |||
| 332 | filename = try_appendfile_wc('-w') | 331 | filename = try_appendfile_wc('-w') |
| 333 | self.assertEqual(filename, recipefn.split('_')[0] + '_%.bbappend') | 332 | self.assertEqual(filename, recipefn.split('_')[0] + '_%.bbappend') |
| 334 | 333 | ||
| 334 | |||
| 335 | class RecipetoolCreateTests(RecipetoolBase): | ||
| 336 | |||
| 335 | def test_recipetool_create(self): | 337 | def test_recipetool_create(self): |
| 336 | # Try adding a recipe | 338 | # Try adding a recipe |
| 337 | tempsrc = os.path.join(self.tempdir, 'srctree') | 339 | tempsrc = os.path.join(self.tempdir, 'srctree') |
| @@ -518,6 +520,15 @@ class RecipetoolTests(RecipetoolBase): | |||
| 518 | inherits = ['pkgconfig', 'autotools'] | 520 | inherits = ['pkgconfig', 'autotools'] |
| 519 | self._test_recipe_contents(recipefile, checkvars, inherits) | 521 | self._test_recipe_contents(recipefile, checkvars, inherits) |
| 520 | 522 | ||
| 523 | |||
| 524 | class RecipetoolTests(RecipetoolBase): | ||
| 525 | |||
| 526 | @classmethod | ||
| 527 | def setUpClass(cls): | ||
| 528 | super(RecipetoolTests, cls).setUpClass() | ||
| 529 | bb_vars = get_bb_vars(['BBPATH']) | ||
| 530 | cls.bbpath = bb_vars['BBPATH'] | ||
| 531 | |||
| 521 | def _copy_file_with_cleanup(self, srcfile, basedstdir, *paths): | 532 | def _copy_file_with_cleanup(self, srcfile, basedstdir, *paths): |
| 522 | dstdir = basedstdir | 533 | dstdir = basedstdir |
| 523 | self.assertTrue(os.path.exists(dstdir)) | 534 | self.assertTrue(os.path.exists(dstdir)) |
