1 #!/usr/bin/env python 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 # Use of this source code is governed by a BSD-style license that can be 4 # found in the LICENSE file. 5 import os 6 import sys 7 8 from telemetry_lib import telemetry 9 from telemetry.test import gtest_testrunner 10 from telemetry.test import run_tests 11 12 if __name__ == '__main__': 13 top_level_dir = os.path.abspath(os.path.dirname(__file__)) 14 runner = gtest_testrunner.GTestTestRunner(print_result_after_run=False) 15 ret = run_tests.Main(sys.argv[1:], '.', top_level_dir, runner) 16 17 if runner.result: 18 runner.result.PrintSummary() 19 sys.exit(min(ret + runner.result.num_errors, 255)) 20 else: 21 sys.exit(ret) 22