• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2013 The Chromium OS 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"""This contains some mock instances for testing."""
5
6from __future__ import print_function
7
8from benchmark import Benchmark
9from label import MockLabel
10
11perf_args = 'record -a -e cycles'
12label1 = MockLabel(
13    'test1',
14    'image1',
15    'autotest_dir',
16    '/tmp/test_benchmark_run',
17    'x86-alex',
18    'chromeos-alex1',
19    image_args='',
20    cache_dir='',
21    cache_only=False,
22    log_level='average',
23    compiler='gcc')
24
25label2 = MockLabel(
26    'test2',
27    'image2',
28    'autotest_dir',
29    '/tmp/test_benchmark_run_2',
30    'x86-alex',
31    'chromeos-alex2',
32    image_args='',
33    cache_dir='',
34    cache_only=False,
35    log_level='average',
36    compiler='gcc')
37
38benchmark1 = Benchmark('benchmark1', 'autotest_name_1', 'autotest_args', 2, '',
39                       perf_args, '', '')
40
41benchmark2 = Benchmark('benchmark2', 'autotest_name_2', 'autotest_args', 2, '',
42                       perf_args, '', '')
43
44keyval = {}
45keyval[0] = {
46    '': 'PASS',
47    'milliseconds_1': '1',
48    'milliseconds_2': '8',
49    'milliseconds_3': '9.2',
50    'test{1}': '2',
51    'test{2}': '4',
52    'ms_1': '2.1',
53    'total': '5',
54    'bool': 'True'
55}
56
57keyval[1] = {
58    '': 'PASS',
59    'milliseconds_1': '3',
60    'milliseconds_2': '5',
61    'ms_1': '2.2',
62    'total': '6',
63    'test{1}': '3',
64    'test{2}': '4',
65    'bool': 'FALSE'
66}
67
68keyval[2] = {
69    '': 'PASS',
70    'milliseconds_4': '30',
71    'milliseconds_5': '50',
72    'ms_1': '2.23',
73    'total': '6',
74    'test{1}': '5',
75    'test{2}': '4',
76    'bool': 'FALSE'
77}
78
79keyval[3] = {
80    '': 'PASS',
81    'milliseconds_1': '3',
82    'milliseconds_6': '7',
83    'ms_1': '2.3',
84    'total': '7',
85    'test{1}': '2',
86    'test{2}': '6',
87    'bool': 'FALSE'
88}
89
90keyval[4] = {
91    '': 'PASS',
92    'milliseconds_1': '3',
93    'milliseconds_8': '6',
94    'ms_1': '2.3',
95    'total': '7',
96    'test{1}': '2',
97    'test{2}': '6',
98    'bool': 'TRUE'
99}
100
101keyval[5] = {
102    '': 'PASS',
103    'milliseconds_1': '3',
104    'milliseconds_8': '6',
105    'ms_1': '2.2',
106    'total': '7',
107    'test{1}': '2',
108    'test{2}': '2',
109    'bool': 'TRUE'
110}
111
112keyval[6] = {
113    '': 'PASS',
114    'milliseconds_1': '3',
115    'milliseconds_8': '6',
116    'ms_1': '2',
117    'total': '7',
118    'test{1}': '2',
119    'test{2}': '4',
120    'bool': 'TRUE'
121}
122
123keyval[7] = {
124    '': 'PASS',
125    'milliseconds_1': '3',
126    'milliseconds_8': '6',
127    'ms_1': '1',
128    'total': '7',
129    'test{1}': '1',
130    'test{2}': '6',
131    'bool': 'TRUE'
132}
133
134keyval[8] = {
135    '': 'PASS',
136    'milliseconds_1': '3',
137    'milliseconds_8': '6',
138    'ms_1': '3.3',
139    'total': '7',
140    'test{1}': '2',
141    'test{2}': '8',
142    'bool': 'TRUE'
143}
144