self.MetaDataFileCheckLibraryInstanceDependent()\r
self.MetaDataFileCheckLibraryInstanceOrder()\r
self.MetaDataFileCheckLibraryNoUse()\r
+ self.MetaDataFileCheckLibraryDefinedInDec()\r
self.MetaDataFileCheckBinaryInfInFdf()\r
self.MetaDataFileCheckPcdDuplicate()\r
self.MetaDataFileCheckPcdFlash()\r
for FilePath in FilePathList:\r
if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_LIBRARY_NAME_DUPLICATE, Record[1]):\r
EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_LIBRARY_NAME_DUPLICATE, OtherMsg="The Library Class [%s] is duplicated in '%s' line %s and line %s." % (Record[1], FilePath, Record[3], Record[4]), BelongsToTable='Dsc', BelongsToItem=Record[0])\r
- \r
+ \r
+ # Check the header file in Include\Library directory whether be defined in the package DEC file.\r
+ def MetaDataFileCheckLibraryDefinedInDec(self):\r
+ if EccGlobalData.gConfig.MetaDataFileCheckLibraryDefinedInDec == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
+ EdkLogger.quiet("Checking for library instance whether be defined in the package dec file ...")\r
+ SqlCommand = """\r
+ select A.Value1, A.StartLine, A.ID, B.Value1 from Inf as A left join Dec as B\r
+ on A.Model = B.Model and A.Value1 = B.Value1 where A.Model=%s\r
+ """ % MODEL_EFI_LIBRARY_CLASS\r
+ RecordSet = EccGlobalData.gDb.TblDsc.Exec(SqlCommand)\r
+ for Record in RecordSet:\r
+ LibraryInInf, Line, ID, LibraryDec = Record\r
+ if not LibraryDec:\r
+ if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_LIBRARY_NOT_DEFINED, LibraryInInf):\r
+ EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_LIBRARY_NOT_DEFINED, \\r
+ OtherMsg="The Library Class [%s] in %s line is not defined in the associated package file." % (LibraryInInf, Line), \r
+ BelongsToTable='Inf', BelongsToItem=ID)\r
+ \r
# Check whether an Inf file is specified in the FDF file, but not in the Dsc file, then the Inf file must be for a Binary module only\r
def MetaDataFileCheckBinaryInfInFdf(self):\r
if EccGlobalData.gConfig.MetaDataFileCheckBinaryInfInFdf == '1' or EccGlobalData.gConfig.MetaDataFileCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1':\r
""" % (Table.Table, Table.Table, Model, Model)\r
RecordSet = Table.Exec(SqlCommand)\r
for Record in RecordSet: \r
- if not EccGlobalData.gException.IsException(ErrorID, Record[1] + ':' + Record[2]):\r
+ if not EccGlobalData.gException.IsException(ErrorID, Record[2]):\r
EccGlobalData.gDb.TblReport.Insert(ErrorID, OtherMsg="The %s value [%s] is used more than one time" % (Name.upper(), Record[2]), BelongsToTable=Table.Table, BelongsToItem=Record[0])\r
\r
# Naming Convention Check\r
SqlCommand = """select ID, Name from %s where Model = %s""" % (FileTable, MODEL_IDENTIFIER_VARIABLE)\r
RecordSet = EccGlobalData.gDb.TblFile.Exec(SqlCommand)\r
for Record in RecordSet:\r
- if not Pattern.match(Record[1]):\r
+ Var = Record[1]\r
+ if Var.startswith('CONST'):\r
+ Var = Var[5:].lstrip()\r
+ if not Pattern.match(Var):\r
if not EccGlobalData.gException.IsException(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, Record[1]):\r
EccGlobalData.gDb.TblReport.Insert(ERROR_NAMING_CONVENTION_CHECK_VARIABLE_NAME, OtherMsg="The variable name [%s] does not follow the rules" % (Record[1]), BelongsToTable=FileTable, BelongsToItem=Record[0])\r
\r