4 from argparse import ArgumentParser
5 from datetime import datetime
7 sys.path.append('../../../Utilities/buildutils')
9 from fvpcmd import FvpCmd
10 from testresult import TestResult
12 DEVICE_A5 = 'Cortex-A5'
13 DEVICE_A7 = 'Cortex-A7'
14 DEVICE_A9 = 'Cortex-A9'
22 DEVICES = [ DEVICE_A5, DEVICE_A7, DEVICE_A9 ]
23 COMPILERS = [ CC_AC5, CC_AC6, CC_GCC ]
24 TARGETS = [ TARGET_FVP ]
42 DEVICE_A5 : { 'cmd': "fvp_ve_cortex-a5x1.exe", 'args': { 'limit': "5000000" } },
43 DEVICE_A7 : { 'cmd': "fvp_ve_cortex-a7x1.exe", 'args': { 'limit': "5000000" } },
44 DEVICE_A9 : { 'cmd': "fvp_ve_cortex-a9x1.exe", 'args': { 'limit': "5000000" } }
47 def isSkipped(dev, cc, target):
49 skipDev = (skip[0] == None or skip[0] == dev)
50 skipCc = (skip[1] == None or skip[1] == cc)
51 skipTarget = (skip[2] == None or skip[2] == target)
52 if skipDev and skipCc and skipTarget:
56 def prepare(steps, args):
57 for dev in args.devices:
58 for cc in args.compilers:
59 for target in args.targets:
60 if not isSkipped(dev, cc, target):
61 config = "{dev} ({cc}, {target})".format(dev = dev, cc = cc, target = target)
62 prefix = "{dev}_{cc}_{target}".format(dev = dev, cc = cc, target = target)
64 binary = "{dev}/{cc}/Debug/CMSIS_CV_{abrev}_{cc}.{format}".format(dev = dev, abrev = DEVICE_ABREV[dev], cc = cc, format = APP_FORMAT[cc])
65 test = FvpCmd(FVP_MODELS[dev]['cmd'], binary, **FVP_MODELS[dev]['args'])
66 steps += [ { 'name': config, 'prefix': prefix, 'build': build, 'test': test } ]
74 print "Skipping build"
76 if (not step['build']) or step['build'].isSuccess():
78 step['result'] = TestResult(step['test'].getOutput())
79 step['result'].saveXml("result_{0}_{1}.xml".format(step['prefix'], datetime.now().strftime("%Y%m%d%H%M%S")))
83 def printSummary(steps):
88 print "Test run Total Exec Pass Fail "
89 print "-------------------------------------------------------"
92 print "{0:30} {1:>4} {2:>4} {3:>4} {4:>4}".format(step['name'], *step['result'].getSummary())
94 print "{0:30} ------ NO RESULTS ------".format(step['name'])
97 parser = ArgumentParser()
98 parser.add_argument('-d', '--devices', nargs='*', choices=DEVICES, default=DEVICES, help = 'Devices to be considered.')
99 parser.add_argument('-c', '--compilers', nargs='*', choices=COMPILERS, default=COMPILERS, help = 'Compilers to be considered.')
100 parser.add_argument('-t', '--targets', nargs='*', choices=TARGETS, default=TARGETS, help = 'Targets to be considered.')
101 args = parser.parse_args()
111 if __name__ == "__main__":