blob: 653b117301e466dda950a6aa03a366467917073e [file] [log] [blame]
Christophe Favergeon2942a332020-01-20 14:18:48 +01001import os
2import os.path
3import subprocess
4import colorama
5from colorama import init,Fore, Back, Style
6import argparse
7
8init()
9
10def msg(t):
11 print(Fore.CYAN + t + Style.RESET_ALL)
12
13def processTest(test):
14 subprocess.call(["python","processTests.py","-e",test])
15
16def build(build,fvp,test):
17 result = "results_%s.txt" % test
18 resultPath = os.path.join(build,result)
19
20 current=os.getcwd()
21 try:
22 msg("Build %s" % test)
23 os.chdir(build)
24 subprocess.call(["make"])
25 msg("Run %s" % test)
26 with open(result,"w") as results:
27 subprocess.call([fvp,"-a","Testing"],stdout=results)
28 finally:
29 os.chdir(current)
30
31 msg("Parse result for %s" % test)
32 subprocess.call(["python","processResult.py","-e","-r",resultPath])
33
34def processAndRun(buildfolder,fvp,test):
35 processTest(test)
36 build(buildfolder,fvp,test)
37
38parser = argparse.ArgumentParser(description='Parse test description')
39parser.add_argument('-f', nargs='?',type = str, default="build_m7", help="Build folder")
40parser.add_argument('-v', nargs='?',type = str, default="C:\\Program Files\\ARM\\Development Studio 2019.0\\sw\\models\\bin\\FVP_MPS2_Cortex-M7.exe", help="Fast Model")
41
42args = parser.parse_args()
43
44if args.f is not None:
45 BUILDFOLDER=args.f
46else:
47 BUILDFOLDER="build_m7"
48
49if args.v is not None:
50 FVP=args.v
51else:
52 FVP="C:\\Program Files\\ARM\\Development Studio 2019.0\\sw\\models\\bin\\FVP_MPS2_Cortex-M7.exe"
53
54msg("Process test description file")
55subprocess.call(["python", "preprocess.py","-f","desc.txt"])
56
57msg("Generate all missing C files")
58subprocess.call(["python","processTests.py", "-e"])
59
60msg("Statistics Tests")
61processAndRun(BUILDFOLDER,FVP,"StatsTests")
62
63msg("Support Tests")
64processAndRun(BUILDFOLDER,FVP,"SupportTests")
65
66msg("Support Bar Tests F32")
67processAndRun(BUILDFOLDER,FVP,"SupportBarTestsF32")
68
69msg("Basic Tests")
70processAndRun(BUILDFOLDER,FVP,"BasicTests")
71
72msg("Complex Tests")
73processAndRun(BUILDFOLDER,FVP,"ComplexTests")
74
75msg("Fast Maths Tests")
76processAndRun(BUILDFOLDER,FVP,"FastMath")
77
78msg("SVM Tests")
79processAndRun(BUILDFOLDER,FVP,"SVMTests")
80
81msg("Bayes Tests")
82processAndRun(BUILDFOLDER,FVP,"BayesTests")
83
84msg("Distance Tests")
85processAndRun(BUILDFOLDER,FVP,"DistanceTests")
86
87msg("Filtering Tests")
88processAndRun(BUILDFOLDER,FVP,"FilteringTests")
89
90msg("Matrix Tests")
91processAndRun(BUILDFOLDER,FVP,"MatrixTests")
92
93msg("Transform Tests")
94processAndRun(BUILDFOLDER,FVP,"TransformTests")
95
96