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. 5import os 6import sys 7 8from telemetry_lib import telemetry 9from telemetry.unittest import gtest_testrunner 10from telemetry.unittest import run_tests 11 12if __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