diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-07-26 14:57:50 +1200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-01 11:47:10 +0100 |
commit | cc3c276852a0eda15367df7dcae8b1889c2dca8e (patch) | |
tree | 1d1187f60a24228eac8cc3c3a1b638c253804cfe /meta/lib/oeqa/selftest/recipetool.py | |
parent | 12fbed9e60c2d351f5fe5ca7b6c214cd19b11e31 (diff) | |
download | poky-cc3c276852a0eda15367df7dcae8b1889c2dca8e.tar.gz |
oe-selftest: recipetool: add tests for git URL mangling
Add three tests to verify that the git URL mangling is working the way
it's supposed to. This should prevent us regressing on this again in
future.
(From OE-Core rev: d8d01f462ddbb79cff23b544fcd0ce251f05f8ce)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/recipetool.py')
-rw-r--r-- | meta/lib/oeqa/selftest/recipetool.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/recipetool.py b/meta/lib/oeqa/selftest/recipetool.py index f8f6be32a4..db1f8deeb0 100644 --- a/meta/lib/oeqa/selftest/recipetool.py +++ b/meta/lib/oeqa/selftest/recipetool.py | |||
@@ -442,6 +442,49 @@ class RecipetoolTests(RecipetoolBase): | |||
442 | inherits = ['cmake', 'python-dir', 'gettext', 'pkgconfig'] | 442 | inherits = ['cmake', 'python-dir', 'gettext', 'pkgconfig'] |
443 | self._test_recipe_contents(recipefile, checkvars, inherits) | 443 | self._test_recipe_contents(recipefile, checkvars, inherits) |
444 | 444 | ||
445 | def test_recipetool_create_github(self): | ||
446 | # Basic test to see if github URL mangling works | ||
447 | temprecipe = os.path.join(self.tempdir, 'recipe') | ||
448 | os.makedirs(temprecipe) | ||
449 | recipefile = os.path.join(temprecipe, 'meson_git.bb') | ||
450 | srcuri = 'https://github.com/mesonbuild/meson' | ||
451 | result = runCmd('recipetool create -o %s %s' % (temprecipe, srcuri)) | ||
452 | self.assertTrue(os.path.isfile(recipefile)) | ||
453 | checkvars = {} | ||
454 | checkvars['LICENSE'] = set(['Apache-2.0']) | ||
455 | checkvars['SRC_URI'] = 'git://github.com/mesonbuild/meson;protocol=https' | ||
456 | inherits = ['setuptools'] | ||
457 | self._test_recipe_contents(recipefile, checkvars, inherits) | ||
458 | |||
459 | def test_recipetool_create_github_tarball(self): | ||
460 | # Basic test to ensure github URL mangling doesn't apply to release tarballs | ||
461 | temprecipe = os.path.join(self.tempdir, 'recipe') | ||
462 | os.makedirs(temprecipe) | ||
463 | pv = '0.32.0' | ||
464 | recipefile = os.path.join(temprecipe, 'meson_%s.bb' % pv) | ||
465 | srcuri = 'https://github.com/mesonbuild/meson/releases/download/%s/meson-%s.tar.gz' % (pv, pv) | ||
466 | result = runCmd('recipetool create -o %s %s' % (temprecipe, srcuri)) | ||
467 | self.assertTrue(os.path.isfile(recipefile)) | ||
468 | checkvars = {} | ||
469 | checkvars['LICENSE'] = set(['Apache-2.0']) | ||
470 | checkvars['SRC_URI'] = 'https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${PV}.tar.gz' | ||
471 | inherits = ['setuptools'] | ||
472 | self._test_recipe_contents(recipefile, checkvars, inherits) | ||
473 | |||
474 | def test_recipetool_create_git_http(self): | ||
475 | # Basic test to check http git URL mangling works | ||
476 | temprecipe = os.path.join(self.tempdir, 'recipe') | ||
477 | os.makedirs(temprecipe) | ||
478 | recipefile = os.path.join(temprecipe, 'matchbox-terminal_git.bb') | ||
479 | srcuri = 'http://git.yoctoproject.org/git/matchbox-terminal' | ||
480 | result = runCmd('recipetool create -o %s %s' % (temprecipe, srcuri)) | ||
481 | self.assertTrue(os.path.isfile(recipefile)) | ||
482 | checkvars = {} | ||
483 | checkvars['LICENSE'] = set(['GPLv2']) | ||
484 | checkvars['SRC_URI'] = 'git://git.yoctoproject.org/git/matchbox-terminal;protocol=http' | ||
485 | inherits = ['pkgconfig', 'autotools'] | ||
486 | self._test_recipe_contents(recipefile, checkvars, inherits) | ||
487 | |||
445 | class RecipetoolAppendsrcBase(RecipetoolBase): | 488 | class RecipetoolAppendsrcBase(RecipetoolBase): |
446 | def _try_recipetool_appendsrcfile(self, testrecipe, newfile, destfile, options, expectedlines, expectedfiles): | 489 | def _try_recipetool_appendsrcfile(self, testrecipe, newfile, destfile, options, expectedlines, expectedfiles): |
447 | cmd = 'recipetool appendsrcfile %s %s %s %s %s' % (options, self.templayerdir, testrecipe, newfile, destfile) | 490 | cmd = 'recipetool appendsrcfile %s %s %s %s %s' % (options, self.templayerdir, testrecipe, newfile, destfile) |