blob: 99a042891664c690d1e158462c65140daf4cd3aa [file] [log] [blame]
#!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import json
import sys
from core import path_util
from core import benchmark_finders
def main():
parser = argparse.ArgumentParser(
description=('List all benchmarks defined in a benchmark file as a json '
'string.'))
parser.add_argument('benchmark_file_paths', type=str, nargs='+')
args = parser.parse_args()
benchmark_names = set()
for path in args.benchmark_file_paths:
assert os.path.isfile(path), '%s does not exist' % path
benchmark_names.update(benchmark_finders.GetBenchmarkNamesForFile(
path_util.GetPerfDir(), os.path.abspath(path)))
print json.dumps(list(benchmark_names))
if __name__ == '__main__':
sys.exit(main())