Closedown
This commit is contained in:
@@ -4,4 +4,41 @@
|
||||
|
||||
|
||||
#Uncomment this line to create the simulated devices needed to the tutorial scripts.
|
||||
#run("tutorial/devices")
|
||||
#run("tutorial/devices")
|
||||
|
||||
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'
|
||||
@@ -1,15 +1,15 @@
|
||||
#########################################
|
||||
###### DO NOT MODIFY THE CODE BELOW #####
|
||||
#########################################
|
||||
global print_log, sendFeedback, sys, inspect, os, traceback, testcommons
|
||||
import sys, inspect, os, traceback, testcommons
|
||||
global sendFeedback, sys, inspect, os, traceback
|
||||
import sys, inspect, os, traceback
|
||||
|
||||
def startTest(testName, DEVICE, params):
|
||||
#get the path of this script
|
||||
|
||||
import inspect
|
||||
testPath = inspect.getfile(inspect.currentframe())
|
||||
test = testcommons.TestingTool(testName, DEVICE, testPath)
|
||||
test = TestingTool(testName, DEVICE, testPath)
|
||||
test.print_pio()
|
||||
#by default, failed
|
||||
ret = 'Test failed'
|
||||
|
||||
Reference in New Issue
Block a user