def __init__(self): HashFileParser.__init__(self, 'ModuleFdfParser') self.Lines = [] self.Parsed = False self.Dict = {} # defines dictionary self.FVs = {} self.FDs = {} self.CurrentSection = [] self.Path = ""
def test_strip_comment(self): parser = HashFileParser("") lines = ["Test", "MagicLib|Include/Magic", ""] comments = ["\t#this shouldn't show up", " # test", ""] for line in lines: for comment in comments: test_line = line + comment result = parser.StripComment(test_line) self.assertEqual(result, line)
def __init__(self): HashFileParser.__init__(self, 'DecParser') self.Lines = [] self.Parsed = False self.Dict = {} self.LibrariesUsed = [] self.PPIsUsed = [] self.ProtocolsUsed = [] self.GuidsUsed = [] self.PcdsUsed = [] self.IncludesUsed = [] self.Path = ""
def __init__(self): HashFileParser.__init__(self, 'DecParser') self.Lines = [] self.Parsed = False self.Dict = {} self.LibraryClasses = [] self.PPIs = [] self.Protocols = [] self.Guids = [] self.Pcds = [] self.IncludePaths = [] self.Path = "" self.PackageName = None
def test_parse_new_section(self): parser = HashFileParser("") section1 = "[Defines]" res, sect = parser.ParseNewSection(section1) self.assertTrue(res) self.assertEqual(sect, "Defines") # invalid section section2 = "[Defines" res, sect = parser.ParseNewSection(section2) self.assertFalse(res) # multiple parts with multiple definitions section3 = "[Components.X64, Components.IA32]" res, sect = parser.ParseNewSection(section3) self.assertTrue(res) self.assertEqual(sect, "Components") # try multiple parts on a single section4 = "[ Defines.Common.Section ]" res, sect = parser.ParseNewSection(section4) self.assertTrue(res) self.assertEqual(sect, "Defines")
def __init__(self): HashFileParser.__init__(self, 'TargetTxtParser') self.Lines = [] self.Parsed = False self.Dict = {} self.Path = ""