113def Main():
114
115 parser = BuildOptions()
116 (options, args) = parser.parse_args()
117 if not ProcessOptions(options):
118 parser.print_help()
119 return 1
120
121 chosen_benchmarks = ReadBenchmarkList(options.mode, 'BENCHMARKS',
122 options.core)
123
124
125 if len(args) > 0:
126 filt = [re.compile(x.lower()) for x in args]
127 chosen_benchmarks = [b
for b
in chosen_benchmarks
if match(b[0], filt)]
128
129 for mode in options.mode:
130 for arch in options.arch:
131 if options.executable is None:
132
133 executable = GetDart(mode, arch)
134 else:
135 executable = [options.executable]
136 for benchmark, vmargs, progargs in chosen_benchmarks:
137 command = executable
138 command = command + [
139 GetBenchmarkFile([benchmark, 'dart', benchmark + '.dart']),
140 ]
141 if options.verbose:
142 print(
' '.join(command))
143 subprocess.call(command)
144 return 0
145
146
static bool match(const char *needle, const char *haystack)