Author: gnichols
Date: 2011-01-31 21:15:11 +0000 (Mon, 31 Jan 2011)
New Revision: 761
Modified:
trunk/v7/test.py
Log:
589739 - CPUSCALING test includes unprocessed tags around displayed text
Modified: trunk/v7/test.py
===================================================================
--- trunk/v7/test.py 2011-01-31 21:14:18 UTC (rev 760)
+++ trunk/v7/test.py 2011-01-31 21:15:11 UTC (rev 761)
@@ -41,7 +41,7 @@
self.runOn = ""
self.requires = ""
self.priority = 999
- self.planUDI = ""
+ self.udi = ""
self.planDeviceLabel = ""
self.serverMode = False
self.deviceClass = None
@@ -50,10 +50,17 @@
self.source = None # either hal, kudzu, or manual
self.marking = False # is <output> sub-section currently active?
- self.parameters = TestParameters()
+
+ def setParameters(self, testParameters):
+ self.parameters = testParameters
self.__initTestParameters()
def __initTestParameters(self):
+
+ try:
+ self.debug = self.parameters.get(Constants.DEBUG)
+ except KeyError:
+ self.debug = Constants.off
try:
self.outputFile = self.parameters.get(Constants.OUTPUTFILE)
@@ -85,10 +92,7 @@
except KeyError:
self.incomplete = False
- try:
- self.debug = self.parameters.get(Constants.DEBUG)
- except KeyError:
- self.debug = Constants.off
+
def __cmp__(self, other):
if TestTag.interactive in self.tags() and not TestTag.interactive in
other.tags():
@@ -183,8 +187,10 @@
def getOutputFile(self):
return self.outputFile
+ def getOutputDirectory(self):
+ return os.path.dirname(self.getOutputFile())
+
def getUDI(self):
- if self.planUDI: return self.planUDI
if self.device: return self.device.getUDI()
if self.udi: return self.udi
# otherwise
@@ -525,16 +531,37 @@
class TestParameters:
- def __init__(self):
+ def __init__(self, testDocument, hardwareTest):
self.parameters = dict()
+ self.testDocument = testDocument
- # try and get them from the environment
+ # 1) try and get them from the environment
names = [Constants.OUTPUTFILE, Constants.UDI, Constants.RUNMODE,
Constants.TESTSERVER, Constants.DEVICE, Constants.INCOMPLETE]
for name in names:
try:
self.parameters[name] = os.environ[name]
except KeyError:
pass
+
+ # 2 get them from the harness/options
+ if hardwareTest.testServer:
+ self.parameters[Constants.TESTSERVER] = hardwareTest.testServer
+ elif hardwareTest.certification and hardwareTest.certification.getTestServer():
+ self.parameters[Constants.TESTSERVER] =
hardwareTest.certification.getTestServer()
+
+ self.parameters[Constants.DEBUG] = hardwareTest.options.debug
+ self.parameters[Constants.RUNMODE] = hardwareTest.options.mode
+
+ if hardwareTest.command == "continue":
+ self.parameters[Constants.INCOMPLETE] = "1"
+
+
+ # 2) try and get them from the testDocument
+ self.testDocument = testDocument
+ map = [(Constants.DEVICE, testDocument.getLogicalDeviceName)]
+ for (name, function) in map:
+ self.parameters[name] = function()
+
def __str__(self):
str = ""
for (key, value) in self.parameters.iteritems():
@@ -542,10 +569,15 @@
return str
def get(self, name):
- return self.parameters[name]
+ try:
+ return self.parameters[name]
+ except KeyError:
+ return None
def set(self, name, value):
self.parameters[name] = value
+
+
Show replies by date