1# Copyright 2017 The Chromium Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5from __future__ import print_function 6 7import os 8 9from benchmarks import blink_perf 10 11 12# pylint: disable=protected-access 13class BlinkPerfAll(blink_perf._BlinkPerfBenchmark): 14 15 @classmethod 16 def Name(cls): 17 return 'blink_perf' 18 19 @classmethod 20 def AddBenchmarkCommandLineArgs(cls, parser): 21 parser.add_option('--test-path', type='string', 22 default=blink_perf.BLINK_PERF_BASE_DIR, 23 help=('Path to blink perf tests. Could be an absolute ' 24 'path, a relative path with respect to your ' 25 'current directory or a relative path with ' 26 'respect to third_party/blink/perf_tests)')) 27 28 def CreateStorySet(self, options): 29 if os.path.exists(options.test_path): 30 path = os.path.abspath(options.test_path) 31 else: 32 path = os.path.join(blink_perf.BLINK_PERF_BASE_DIR, options.test_path) 33 print() 34 print('Running all tests in %s' % path) 35 return blink_perf.CreateStorySetFromPath(path, blink_perf.SKIPPED_FILE) 36