summaryrefslogtreecommitdiff
path: root/scripts/PYTHON_SOFTWARE/test_main.py
diff options
context:
space:
mode:
authorManel Caro <mcaro@iseebcn.com>2019-03-09 21:29:27 +0100
committerManel Caro <mcaro@iseebcn.com>2019-03-09 21:29:27 +0100
commite4366bb1f2dc3a43a1289f6f76967f1005278954 (patch)
tree4f07744ecfb6c6a60e29e35ca17d93b52f8b5d45 /scripts/PYTHON_SOFTWARE/test_main.py
parent9332c933fc05f42882640c9a4e35fab09854af84 (diff)
downloadboard-e4366bb1f2dc3a43a1289f6f76967f1005278954.zip
board-e4366bb1f2dc3a43a1289f6f76967f1005278954.tar.gz
board-e4366bb1f2dc3a43a1289f6f76967f1005278954.tar.bz2
Remove incorrect copy PYTHON_SOFTWARE folder inside scripts directory
Diffstat (limited to 'scripts/PYTHON_SOFTWARE/test_main.py')
-rw-r--r--scripts/PYTHON_SOFTWARE/test_main.py101
1 files changed, 0 insertions, 101 deletions
diff --git a/scripts/PYTHON_SOFTWARE/test_main.py b/scripts/PYTHON_SOFTWARE/test_main.py
deleted file mode 100644
index 6a8ed7e..0000000
--- a/scripts/PYTHON_SOFTWARE/test_main.py
+++ /dev/null
@@ -1,101 +0,0 @@
-from test.helpers.get_dieid import genDieid
-from subprocess import call
-import xml.etree.ElementTree as XMLParser
-import errno
-import sys
-import os
-import unittest
-from test.helpers.testsrv_db import TestSrv_Database
-from test.runners.simple import SimpleTestRunner
-from test.tests.qbutton import Qbutton
-from test.helpers.syscmd import TestSysCommand
-from test.helpers.syscmd import SysCommand
-from test.tests.qiperf import QIperf
-from test.tests.qethernet import Qethernet
-from test.tests.qaudio import Qaudio
-from test.tests.qram import Qram
-from test.tests.qusb import Qusb
-from test.tests.qi2c import Qi2c
-from test.tests.qeeprom import Qeeprom
-from test.tests.qserial import Qserial
-from test.tests.qscreen import Qscreen
-from test.tests.qwifi import Qwifi
-from test.tests.qrtc import Qrtc
-from test.tests.qduplex_ser import Qduplex
-from test.tests.qamp import Qamp
-from test.tests.qflash import Qflasher
-from test.helpers.globalVariables import globalVar
-
-# define clear function
-def clear():
- # check and make call for specific operating system
- _ = call('clear' if os.name =='posix' else 'cls')
-
-
-def create_board():
- psdb = TestSrv_Database()
- psdb.open("setup.xml")
- tree = XMLParser.parse('setup.xml')
- root = tree.getroot()
- suite = unittest.TestSuite()
- for element in root.iter('board'):
- # print(str(element.tag) + str(element.attrib))
- model_id = element.attrib['model']
- variant = element.attrib['variant']
- nstation = element.attrib['station']
- globalVar.g_mid=model_id + "-" + variant
- globalVar.station=nstation
- processor_id=genDieid(globalVar.g_mid)
- print(globalVar.g_mid)
- print(processor_id)
- globalVar.g_uuid = psdb.create_board(processor_id, model_id, variant, bmac = None)
-
-def testsuite():
- psdb=TestSrv_Database()
- psdb.open("setup.xml")
- suite = unittest.TestSuite()
- tests=psdb.getboard_comp_test_list(globalVar.g_uuid)
- for i in range(len(tests)):
- #newstr = oldstr.replace("M", "")
- variables=str(tests[i][0]).split(",")
- testname=variables[0].replace('(', '')
- testdes=variables[1]
- testfunc=variables[2]
- if len(tests)>2:
- testparam=variables[3].replace(')', '')
- testparam = testparam.replace('"', '')
- testparam = testparam.replace(';', "','")
- if testparam == "":
- command = "suite.addTest({}('{}','execute'))".format(testfunc, testname)
- else:
- command="suite.addTest({}('{}','execute','{}'))".format(testfunc,testname,testparam)
- else:
- print(testname)
- command = "suite.addTest({}('{}','execute'))".format(testfunc, testname)
- exec(command)
- globalVar.testid_ctl=psdb.open_testbatch(globalVar.g_uuid)
- return suite
-
-
-def finish_test():
- psdb = TestSrv_Database()
- psdb.open("setup.xml")
- psdb.close_testbatch(globalVar.g_uuid, globalVar.testid_ctl)
-
-def main():
- #addtesttomodel()
- #addtestdef()
- create_board()
- #globalVar.g_uuid = "1f59c654-0cc6-11e8-8d51-e644f56b8edd"
- try:
- os.remove("test_results.dat")
- except:
- pass
- runner = SimpleTestRunner()
- runner.run(testsuite())
- finish_test()
-
-
-if __name__ == "__main__":
- clear()
- main()