示例#1
0
    def testFirmwareBuildCombinations(self):
        """Test generating a dict of firmware build combinations."""
        config = CrosConfig(self.filepath)
        expected = OrderedDict([('another', ['another', 'another']),
                                ('some', ['some', 'some'])])
        result = config.GetFirmwareBuildCombinations(
            ['coreboot', 'depthcharge'])
        self.assertEqual(result, expected)

        # Should not explode when devices do not specify requested target.
        expected = OrderedDict([('another', ['another_base']), ('some', [])])
        result = config.GetFirmwareBuildCombinations(['base'])
        self.assertEqual(result, expected)

        os.environ['FW_NAME'] = 'another'
        expected = OrderedDict([('another', ['another', 'another'])])
        result = config.GetFirmwareBuildCombinations(
            ['coreboot', 'depthcharge'])
        self.assertEqual(result, expected)
        del os.environ['FW_NAME']
  def testFirmwareBuildCombinations(self):
    """Test generating a dict of firmware build combinations."""
    config = CrosConfig(self.filepath)
    expected = OrderedDict(
        [('another', ['another', 'another']),
         ('some', ['some', 'some']),
         ('some2', [None, None])])
    result = config.GetFirmwareBuildCombinations(['coreboot', 'depthcharge'])
    self.assertEqual(result, expected)

    # Unspecified targets should be represented as None.
    expected = OrderedDict(
        [('another', [None]),
         ('some', [None]),
         ('some2', ['experimental/some2'])])
    result = config.GetFirmwareBuildCombinations(['zephyr-ec'])
    self.assertEqual(result, expected)

    os.environ['FW_NAME'] = 'another'
    expected = OrderedDict([('another', ['another', 'another'])])
    result = config.GetFirmwareBuildCombinations(['coreboot', 'depthcharge'])
    self.assertEqual(result, expected)
    del os.environ['FW_NAME']