aboutsummaryrefslogtreecommitdiff
path: root/crosperf/benchmark_run_unittest.py
blob: c4670c9cbd52cccd7152d67b2c624ba0e1f23741 (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
36
37
38
39
40
41
42
43
44
#!/usr/bin/python

# Copyright 2011 Google Inc. All Rights Reserved.

"""Testing of benchmark_run."""

import unittest

from utils import logger

from autotest_runner import MockAutotestRunner
from benchmark_run import MockBenchmarkRun
from label import MockLabel
from benchmark import Benchmark
from machine_manager import MockMachineManager
from results_cache import MockResultsCache


class BenchmarkRunTest(unittest.TestCase):
  def testDryRun(self):
    my_label = MockLabel("test1", "image1", "/tmp/test_benchmark_run",
                         "x86-alex", "chromeos-alex1", "")
    m = MockMachineManager("/tmp/chromeos_root")
    m.AddMachine("chromeos-alex1")
    bench = Benchmark("PageCyler",
                      "Pyautoperf",
                      "",
                      1,
                      0.2,
                      "")
    b = MockBenchmarkRun("test run",
                         bench,
                         my_label,
                         1,
                         [],
                         m,
                         logger.GetLogger())
    b.cache = MockResultsCache()
    b.autotest_runner = MockAutotestRunner()
    b.start()


if __name__ == "__main__":
  unittest.main()