@@ -30,6 +30,7 @@ class OESelftestTestCase(OETestCase):
cls.localconf_path = cls.tc.config_paths['localconf']
cls.local_bblayers_path = cls.tc.config_paths['bblayers']
+ cls.toolcfgconf_path = cls.tc.config_paths['toolcfgconf']
cls.testinc_path = os.path.join(cls.tc.config_paths['builddir'],
"conf/selftest.inc")
@@ -161,7 +162,7 @@ class OESelftestTestCase(OETestCase):
self.logger.debug("Adding path '%s' to be cleaned up when test is over" % path)
self._track_for_cleanup.append(path)
- def write_config(self, data, multiconfig=None):
+ def write_config(self, data, multiconfig=None, fragments=None):
"""Write to config file"""
if multiconfig:
multiconfigdir = "%s/conf/multiconfig" % self.builddir
@@ -174,6 +175,12 @@ class OESelftestTestCase(OETestCase):
self.logger.debug("Writing to: %s\n%s\n" % (dest_path, data))
ftools.write_file(dest_path, data)
+ if fragments:
+ toolscfg_str = '# Added by oe-selftest' + os.linesep + \
+ 'OE_FRAGMENTS += "' + ' '.join(fragments) + '"' + os.linesep
+ self.logger.debug("Over writing fragments: %s\n%s" % (self.toolcfgconf_path, toolscfg_str))
+ ftools.write_file(self.toolcfgconf_path, toolscfg_str)
+
def append_config(self, data):
"""Append to <builddir>/conf/selftest.inc"""
self.logger.debug("Appending to: %s\n%s\n" % (self.testinc_path, data))
@@ -278,6 +278,7 @@ class OESelftestTestContextExecutor(OETestContextExecutor):
self.tc_kwargs['init']['config_paths']['builddir'] = builddir
self.tc_kwargs['init']['config_paths']['localconf'] = os.path.join(builddir, "conf/local.conf")
self.tc_kwargs['init']['config_paths']['bblayers'] = os.path.join(builddir, "conf/bblayers.conf")
+ self.tc_kwargs['init']['config_paths']['toolcfgconf'] = os.path.join(builddir, "conf/toolcfg.conf")
self.tc_kwargs['init']['newbuilddir'] = args.newbuilddir
self.tc_kwargs['init']['keep_builddir'] = args.keep_builddir