]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/UPT/UnitTest/InfBinarySectionTest.py
BaseTools: Clean up source files
[mirror_edk2.git] / BaseTools / Source / Python / UPT / UnitTest / InfBinarySectionTest.py
index 626f17426de77f1a024347f8669a27b2d3f27baf..9a10ec15c47953f8202d25b4adf93f1604f0143a 100644 (file)
@@ -1,11 +1,11 @@
 ## @file\r
-# This file contain unit test for Test [Binary] section part of InfParser \r
+# This file contain unit test for Test [Binary] section part of InfParser\r
 #\r
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r
 #\r
-# This program and the accompanying materials are licensed and made available \r
-# under the terms and conditions of the BSD License which accompanies this \r
-# distribution. The full text of the license may be found at \r
+# This program and the accompanying materials are licensed and made available\r
+# under the terms and conditions of the BSD License which accompanies this\r
+# distribution. The full text of the license may be found at\r
 # http://opensource.org/licenses/bsd-license.php\r
 #\r
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
@@ -49,7 +49,7 @@ GUID | Test/Test.guid | DEBUG
 """\r
 \r
 #\r
-# Have 3 elements, Type | FileName | Target \r
+# Have 3 elements, Type | FileName | Target\r
 # Target with MACRO defined in [Define] section\r
 #\r
 SectionStringsCommonItem4 = \\r
@@ -58,7 +58,7 @@ GUID | Test/Test.guid | $(TARGET)
 """\r
 \r
 #\r
-# Have 3 elements, Type | FileName | Target \r
+# Have 3 elements, Type | FileName | Target\r
 # FileName with MACRO defined in [Binary] section\r
 #\r
 SectionStringsCommonItem5 = \\r
@@ -115,7 +115,7 @@ GUID | Test/Test.guid | DEBUG | MSFT | TEST | TRUE | OVERFLOW
 #-------------start of VER type binary item test input------------------------#\r
 \r
 #\r
-# Has 1 element, error format \r
+# Has 1 element, error format\r
 #\r
 SectionStringsVerItem1 = \\r
 """\r
@@ -199,7 +199,7 @@ UI | Test/Test2.ui | * | FALSE
 """\r
 \r
 #\r
-# Has 1 element, error format \r
+# Has 1 element, error format\r
 #\r
 SectionStringsUiItem4 = \\r
 """\r
@@ -253,7 +253,7 @@ def StringToSectionString(String):
             continue\r
         SectionString.append((Line, LineNo, ''))\r
         LineNo = LineNo + 1\r
-        \r
+\r
     return SectionString\r
 \r
 def PrepareTest(String):\r
@@ -269,7 +269,7 @@ def PrepareTest(String):
             #\r
             FileName = os.path.normpath(os.path.realpath(ValueList[1].strip()))\r
             try:\r
-                TempFile  = open (FileName, "w")    \r
+                TempFile  = open (FileName, "w")\r
                 TempFile.close()\r
             except:\r
                 print("File Create Error")\r
@@ -278,24 +278,24 @@ def PrepareTest(String):
         CurrentLine.SetLineString(Item[0])\r
         CurrentLine.SetLineNo(Item[1])\r
         InfLineCommentObject = InfLineCommentObject()\r
-        \r
+\r
         ItemList.append((ValueList, InfLineCommentObject, CurrentLine))\r
-                \r
+\r
     return ItemList\r
 \r
 if __name__ == '__main__':\r
     Logger.Initialize()\r
-    \r
+\r
     InfBinariesInstance = InfBinariesObject()\r
     ArchList = ['COMMON']\r
     Global.gINF_MODULE_DIR = os.getcwd()\r
-    \r
+\r
     AllPassedFlag = True\r
-    \r
+\r
     #\r
     # For All Ui test\r
     #\r
-    UiStringList = [ \r
+    UiStringList = [\r
                     SectionStringsUiItem1,\r
                     SectionStringsUiItem2,\r
                     SectionStringsUiItem3,\r
@@ -303,10 +303,10 @@ if __name__ == '__main__':
                     SectionStringsUiItem5,\r
                     SectionStringsUiItem6,\r
                     SectionStringsUiItem7,\r
-                    SectionStringsUiItem8 \r
+                    SectionStringsUiItem8\r
                     ]\r
-    \r
-    for Item in UiStringList:        \r
+\r
+    for Item in UiStringList:\r
         Ui = PrepareTest(Item)\r
         if Item == SectionStringsUiItem4 or Item == SectionStringsUiItem5:\r
             try:\r
@@ -314,11 +314,11 @@ if __name__ == '__main__':
             except Logger.FatalError:\r
                 pass\r
         else:\r
-            try:               \r
+            try:\r
                 InfBinariesInstance.SetBinary(Ui = Ui, ArchList = ArchList)\r
             except:\r
-                AllPassedFlag = False                                  \r
\r
+                AllPassedFlag = False\r
+\r
     #\r
     # For All Ver Test\r
     #\r
@@ -331,25 +331,25 @@ if __name__ == '__main__':
                      SectionStringsVerItem6,\r
                      SectionStringsVerItem7\r
                      ]\r
-    for Item in VerStringList:        \r
+    for Item in VerStringList:\r
         Ver = PrepareTest(Item)\r
         if Item == SectionStringsVerItem1 or \\r
            Item == SectionStringsVerItem2:\r
-            \r
+\r
             try:\r
                 InfBinariesInstance.SetBinary(Ver = Ver, ArchList = ArchList)\r
             except:\r
                 pass\r
-                    \r
+\r
         else:\r
             try:\r
                 InfBinariesInstance.SetBinary(Ver = Ver, ArchList = ArchList)\r
             except:\r
-                AllPassedFlag = False   \r
-    \r
+                AllPassedFlag = False\r
+\r
     #\r
     # For All Common Test\r
-    #    \r
+    #\r
     CommonStringList = [\r
                      SectionStringsCommonItem1,\r
                      SectionStringsCommonItem2,\r
@@ -363,23 +363,23 @@ if __name__ == '__main__':
                      SectionStringsCommonItem10\r
                      ]\r
 \r
-    for Item in CommonStringList:        \r
+    for Item in CommonStringList:\r
         CommonBin = PrepareTest(Item)\r
         if Item == SectionStringsCommonItem10 or \\r
            Item == SectionStringsCommonItem1:\r
-            \r
+\r
             try:\r
                 InfBinariesInstance.SetBinary(CommonBinary = CommonBin, ArchList = ArchList)\r
             except:\r
                 pass\r
-                    \r
+\r
         else:\r
             try:\r
                 InfBinariesInstance.SetBinary(Ver = Ver, ArchList = ArchList)\r
             except:\r
                 print("Test Failed!")\r
                 AllPassedFlag = False\r
-    \r
+\r
     if AllPassedFlag :\r
         print('All tests passed...')\r
     else:\r