summaryrefslogtreecommitdiffstats
path: root/tools/perf/run_tests
blob: 24370d7967ab1fcb3ef0f50b8c31ae4c77f634cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/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.
"""This script runs unit tests of the code in the perf directory.

This script DOES NOT run benchmarks. run_benchmarks and run_measurement do that.
"""

import os
import sys

import measurements
import perf_tools
from telemetry.unittest import gtest_testrunner
from telemetry.unittest import run_tests

if __name__ == '__main__':
  top_level_dir = os.path.abspath(os.path.dirname(__file__))
  runner = gtest_testrunner.GTestTestRunner(print_result_after_run=False)

  start_dir = os.path.join(top_level_dir, 'measurements')
  ret = run_tests.Main(sys.argv[1:], start_dir, top_level_dir, runner)

  start_dir = os.path.join(top_level_dir, 'perf_tools')
  ret += run_tests.Main(sys.argv[1:], start_dir, top_level_dir, runner)

  start_dir = os.path.join(top_level_dir, 'metrics')
  ret += run_tests.Main(sys.argv[1:], start_dir, top_level_dir, runner)

  if runner.result:
    runner.result.PrintSummary()
    sys.exit(min(ret + runner.result.num_errors, 255))
  else:
    sys.exit(ret)