Closedown

This commit is contained in:
boccioli_m
2015-09-02 11:10:11 +02:00
parent a46914e6ac
commit 4d4d5522b2
2 changed files with 41 additions and 4 deletions

View File

@@ -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'

View File

@@ -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'