# Copyright (C) 2017 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
import unittest
from checklayer import LayerType
from checklayer.case import OECheckLayerTestCase
class DistroCheckLayer(OECheckLayerTestCase):
@classmethod
def setUpClass(self):
if self.tc.layer['type'] != LayerType.DISTRO:
raise unittest.SkipTest("DistroCheckLayer: Layer %s isn't Distro one." %\
self.tc.layer['name'])
def test_distro_defines_distros(self):
self.assertTrue(self.tc.layer['conf']['distros'],
"Layer is BSP but doesn't defines machines.")
def test_distro_no_set_distros(self):
from oeqa.utils.commands import get_bb_var
distro = get_bb_var('DISTRO')
self.assertEqual(self.td['bbvars']['DISTRO'], distro,
msg="Layer %s modified distro %s -> %s" % \
(self.tc.layer['name'], self.td['bbvars']['DISTRO'], distro))
temd-bootconf \
systemd->systemd-conf \
weston->weston-conf \
weston-init->weston \
weston-init->kbd \
"
# Avoid adding bison-native to the sysroot without a specific
# dependency in the recipe. This means indirect dependencies
# (e.g. X -> Y -> binutils-cross -> bison-native) no longer meet the
# dependency incidentally. This improves determinism and avoids build
# failures when people switch to external toolchains.
SSTATE_EXCLUDEDEPS_SYSROOT += ".*->bison-native"
# Nothing needs to depend on libc-initial/gcc-cross-initial
# base-passwd/shadow-sysroot don't need their dependencies
SSTATE_EXCLUDEDEPS_SYSROOT += "\
.*->.*-initial.* \
.*(base-passwd|shadow-sysroot)->.* \
"
# Avoid adding autoconf-archive-native to sysroot without a specific
# dependency in the recipe.
SSTATE_EXCLUDEDEPS_SYSROOT += ".*->autoconf-archive-native"
# We need to keep bitbake tools in PATH
PATH := "${@os.path.dirname(bb.utils.which(d.getVar('PATH'),'bitbake'))}:${HOSTTOOLS_DIR}"