Beispiel #1
0
	def analyze(self, test, execResult):
		target = execResult.target
		tl = self._tlocal
		tl.ttime += execResult.time
		if (self._timer != None):
			for line in execResult.stdout.split("\n"):
				line = line.strip()
				if (line.find("__TIMER__")==0):
					l = line.split(" ",2)
					if (l[2] == self._timer):
						tl.ttimeTmr += float(l[1])/1000
		tl.midx += 1
		if (tl.midx < self._measurements):
			return ExecResult.RETRY
		else:
			with (self._lock):
				if (tl.ttimeTmr != 0):
					tl.results.append((tl.ttime / self._measurements, tl.ttimeTmr / self._measurements))
				else:
					tl.results.append((tl.ttime / self._measurements,))
				tl.ttime = 0
				tl.ttimeTmr = 0
				if (len(tl.results) == len(self._targets)):
					self.write(testr.truncIfLonger(test.name(),70))
					for r in tl.results:
						if (len(r) == 1):
							self.write(" | {0:8f}         ".format(r[0]))
						else:
							self.write(" | {0:8f} {1:8f}".format(r[0],r[1]))
					self.writeln("")
					self.count += 1
					tl.reset(test)
Beispiel #2
0
	def initialize(self, targets):
		testr.writeln("  initializing module timer")
		if (not targets):
			testr.fatalError("module timer must have at least one target specified")
		self.count = 0
		self._targets = targets
		self._tlocal = Module.TL()
		self._longestTargetName = max([ len(i.name()) for i in targets])
		self.write(testr.truncIfLonger("test name",70))
		for t in targets:
			self.write(" | {0:17}".format(t.name()))
		self.writeln("")
		self.writeln("-" * (70 + len(targets) * 20))