Revision: 17691
http://sourceforge.net/p/edk2/code/17691
Author: jljusten
Date: 2015-06-23 23:34:04 +0000 (Tue, 23 Jun 2015)
Log Message:
-----------
BaseTools/Tests: Always add BaseTools source to import path
This allows unit tests to easily include BaseTools python
modules. This is very useful for writing unit tests.
Actually, previously, we would do this when RunTests.py was executed,
so unit tests could easily import BaseTools modules, so long as they
were executed via RunTests.
This change allows running the unit test files individually which can
be faster for developing the new unit test cases.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Michael D Kinney <[email protected]>
Reviewed-by: Yingke Liu <[email protected]>
Modified Paths:
--------------
trunk/edk2/BaseTools/Tests/RunTests.py
trunk/edk2/BaseTools/Tests/TestTools.py
Modified: trunk/edk2/BaseTools/Tests/RunTests.py
===================================================================
--- trunk/edk2/BaseTools/Tests/RunTests.py 2015-06-23 20:47:27 UTC (rev
17690)
+++ trunk/edk2/BaseTools/Tests/RunTests.py 2015-06-23 23:34:04 UTC (rev
17691)
@@ -21,8 +21,6 @@
import TestTools
-sys.path.append(TestTools.PythonSourceDir)
-
def GetCTestSuite():
import CToolsTests
return CToolsTests.TheTestSuite()
Modified: trunk/edk2/BaseTools/Tests/TestTools.py
===================================================================
--- trunk/edk2/BaseTools/Tests/TestTools.py 2015-06-23 20:47:27 UTC (rev
17690)
+++ trunk/edk2/BaseTools/Tests/TestTools.py 2015-06-23 23:34:04 UTC (rev
17691)
@@ -1,7 +1,7 @@
## @file
# Utility functions and classes for BaseTools unit tests
#
-# Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2015, 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
@@ -31,6 +31,13 @@
PythonSourceDir = os.path.join(BaseToolsDir, 'Source', 'Python')
TestTempDir = os.path.join(TestsDir, 'TestTempDir')
+if PythonSourceDir not in sys.path:
+ #
+ # Allow unit tests to import BaseTools python modules. This is very useful
+ # for writing unit tests.
+ #
+ sys.path.append(PythonSourceDir)
+
def MakeTheTestSuite(localItems):
tests = []
for name, item in localItems.iteritems():
------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits