Files
ncs/script/testcommons.py
boccioli_m 27838eac59 Closedown
2015-09-02 11:08:42 +02:00

36 lines
1.2 KiB
Python

global print_log, sendFeedback, sys, inspect, os, traceback
import sys, inspect, os, traceback
class TestingTool:
pippo = 'pippo'
deviceName = ''
testName = ''
testPath = ''
def __init__(self, testName, testPath, deviceName):
self.deviceName = deviceName
self.testName = testName
self.testPath = testPath
def print_log(self, text):
import time
time.ctime()
now = time.strftime('%Y.%m.%d %H:%M:%S')
print now + ' ' + self.deviceName + ' - ' + self.testName + ': ' + str(text)
#prepare and send feedback to calling tool
def sendFeedback(self, returnString, testPassed):
self.print_log('End of test. Result:')
self.print_log('Device: ' + self.deviceName)
self.print_log('Test name: ' + self.testName)
self.print_log('Test path: ' + self.testPath)
self.print_log('Test passed: ' + str(testPassed))
self.print_log('Return string: ' + returnString)
ret = [self.testPath, self.deviceName, returnString, testPassed]
set_return( ret)
def print_pio(self):
print 'piopio'