## @file
# This file contain unit test for Test [Binary] section part of InfParser
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
# distribution. The full text of the license may be found at
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
import os
#import Object.Parser.InfObject as InfObject
##
# Test Common binary item
#
#-------------start of common binary item test input--------------------------#
#
# Only has 1 element, binary item Type
#
"""
GUID
"""
#
# Have 2 elements, binary item Type and FileName
#
"""
"""
#
# Have 3 elements, Type | FileName | Target | Family | TagName | FeatureFlagExp
#
"""
"""
#
# Have 3 elements, Type | FileName | Target
# Target with MACRO defined in [Define] section
#
"""
"""
#
# Have 3 elements, Type | FileName | Target
# FileName with MACRO defined in [Binary] section
#
"""
DEFINE BINARY_FILE_PATH = Test
GUID | $(BINARY_FILE_PATH)/Test.guid | $(TARGET)
"""
#
# Have 4 elements, Type | FileName | Target | Family
#
"""
"""
#
# Have 4 elements, Type | FileName | Target | Family
#
"""
"""
#
# Have 5 elements, Type | FileName | Target | Family | TagName
#
"""
"""
#
# Have 6 elements, Type | FileName | Target | Family | TagName | FFE
#
"""
"""
#
# Have 7 elements, Type | FileName | Target | Family | TagName | FFE | Overflow
# Test wrong format
#
"""
"""
#-------------end of common binary item test input----------------------------#
#-------------start of VER type binary item test input------------------------#
#
# Has 1 element, error format
#
"""
VER
"""
#
# Have 5 elements, error format(Maximum elements amount is 4)
#
"""
"""
#
# Have 2 elements, Type | FileName
#
"""
"""
#
# Have 3 elements, Type | FileName | Target
#
"""
"""
#
# Have 4 elements, Type | FileName | Target | FeatureFlagExp
#
"""
"""
#
# Exist 2 VER items, both opened.
#
"""
"""
#
# Exist 2 VER items, only 1 opened.
#
"""
"""
#-------------end of VER type binary item test input--------------------------#
#-------------start of UI type binary item test input-------------------------#
#
# Test only one UI section can exist
#
"""
"""
"""
"""
"""
"""
#
# Has 1 element, error format
#
"""
UI
"""
#
# Have 5 elements, error format(Maximum elements amount is 4)
#
"""
"""
#
# Have 2 elements, Type | FileName
#
"""
"""
#
# Have 3 elements, Type | FileName | Target
#
"""
"""
#
# Have 4 elements, Type | FileName | Target | FeatureFlagExp
#
"""
"""
#---------------end of UI type binary item test input-------------------------#
##
# Construct SectionString for call section parser usage.
#
LineNo = 0
SectionString = []
continue
return SectionString
ItemList = []
for Item in SectionString:
#
# Create a temp file for test.
#
try:
except:
print "File Create Error"
return ItemList
if __name__ == '__main__':
#
# For All Ui test
#
UiStringList = [
]
for Item in UiStringList:
try:
except Logger.FatalError:
pass
else:
try:
except:
#
# For All Ver Test
#
VerStringList = [
]
for Item in VerStringList:
if Item == SectionStringsVerItem1 or \
try:
except:
pass
else:
try:
except:
#
# For All Common Test
#
CommonStringList = [
]
for Item in CommonStringList:
if Item == SectionStringsCommonItem10 or \
try:
except:
pass
else:
try:
except:
print "Test Failed!"
if AllPassedFlag :
print 'All tests passed...'
else:
print 'Some unit test failed!'