Files
poky/meta/lib/oeqa/selftest/bblayers.py
Corneliu Stoicescu 1611b474b6 lib/oeqa/selftest: add test modules for expected bitbake output and bitbake-layers
Tests for bitbake-layers and expected output for some bitbake options.

(From OE-Core rev: 8408a7700cd9cab4559ddae0bbe57f0d7fae5c37)

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-03 17:45:51 +00:00

38 lines
1.6 KiB
Python

import unittest
import os
import logging
import re
import shutil
import oeqa.utils.ftools as ftools
from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import runCmd
class BitbakeLayers(oeSelfTest):
def test_bitbakelayers_showcrossdepends(self):
result = runCmd('bitbake-layers show-cross-depends')
self.assertTrue('aspell' in result.output)
def test_bitbakelayers_showlayers(self):
result = runCmd('bitbake-layers show_layers')
self.assertTrue('meta-selftest' in result.output)
def test_bitbakelayers_showappends(self):
result = runCmd('bitbake-layers show_appends')
self.assertTrue('xcursor-transparent-theme_0.1.1.bbappend' in result.output, msg='xcursor-transparent-theme_0.1.1.bbappend file was not recognised')
def test_bitbakelayers_showoverlayed(self):
result = runCmd('bitbake-layers show_overlayed')
self.assertTrue('aspell' in result.output, msg='xcursor-transparent-theme_0.1.1.bbappend file was not recognised')
def test_bitbakelayers_flatten(self):
self.assertFalse(os.path.isdir(os.path.join(self.builddir, 'test')))
result = runCmd('bitbake-layers flatten test')
bb_file = os.path.join(self.builddir, 'test/recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme_0.1.1.bb')
self.assertTrue(os.path.isfile(bb_file))
contents = ftools.read_file(bb_file)
find_in_contents = re.search("##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents)
shutil.rmtree(os.path.join(self.builddir, 'test'))
self.assertTrue(find_in_contents)