]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Tests/TestTools.py
MdeModulePkg NvmExpressDxe: Fix VS2010 build error
[mirror_edk2.git] / BaseTools / Tests / TestTools.py
index ac009db1fa66414e67f6dec18b84698e3c4cff9f..27afd79f2094dd742c72a2b13525bb685bc9f3b9 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Utility functions and classes for BaseTools unit tests\r
 #\r
-#  Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -31,6 +31,13 @@ CSourceDir = os.path.join(BaseToolsDir, 'Source', 'C')
 PythonSourceDir = os.path.join(BaseToolsDir, 'Source', 'Python')\r
 TestTempDir = os.path.join(TestsDir, 'TestTempDir')\r
 \r
+if PythonSourceDir not in sys.path:\r
+    #\r
+    # Allow unit tests to import BaseTools python modules. This is very useful\r
+    # for writing unit tests.\r
+    #\r
+    sys.path.append(PythonSourceDir)\r
+\r
 def MakeTheTestSuite(localItems):\r
     tests = []\r
     for name, item in localItems.iteritems():\r