1# -*- coding: utf-8 -*- 2# Copyright 2013 The ChromiumOS Authors 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5 6"""This contains some mock instances for testing.""" 7 8 9from benchmark import Benchmark 10from label import MockLabel 11 12 13perf_args = "record -a -e cycles" 14label1 = MockLabel( 15 "test1", 16 "build1", 17 "image1", 18 "autotest_dir", 19 "debug_dir", 20 "/tmp/test_benchmark_run", 21 "x86-alex", 22 "chromeos-alex1", 23 image_args="", 24 cache_dir="", 25 cache_only=False, 26 log_level="average", 27 compiler="gcc", 28 crosfleet=False, 29 chrome_src=None, 30) 31 32label2 = MockLabel( 33 "test2", 34 "build2", 35 "image2", 36 "autotest_dir", 37 "debug_dir", 38 "/tmp/test_benchmark_run_2", 39 "x86-alex", 40 "chromeos-alex2", 41 image_args="", 42 cache_dir="", 43 cache_only=False, 44 log_level="average", 45 compiler="gcc", 46 crosfleet=False, 47 chrome_src=None, 48) 49 50benchmark1 = Benchmark( 51 "benchmark1", 52 "autotest_name_1", 53 "autotest_args", 54 2, 55 "", 56 perf_args, 57 "telemetry_Crosperf", 58 "", 59) 60 61benchmark2 = Benchmark( 62 "benchmark2", 63 "autotest_name_2", 64 "autotest_args", 65 2, 66 "", 67 perf_args, 68 "telemetry_Crosperf", 69 "", 70) 71 72keyval = {} 73keyval[0] = { 74 "": "PASS", 75 "milliseconds_1": "1", 76 "milliseconds_2": "8", 77 "milliseconds_3": "9.2", 78 "test{1}": "2", 79 "test{2}": "4", 80 "ms_1": "2.1", 81 "total": "5", 82 "bool": "True", 83} 84 85keyval[1] = { 86 "": "PASS", 87 "milliseconds_1": "3", 88 "milliseconds_2": "5", 89 "ms_1": "2.2", 90 "total": "6", 91 "test{1}": "3", 92 "test{2}": "4", 93 "bool": "FALSE", 94} 95 96keyval[2] = { 97 "": "PASS", 98 "milliseconds_4": "30", 99 "milliseconds_5": "50", 100 "ms_1": "2.23", 101 "total": "6", 102 "test{1}": "5", 103 "test{2}": "4", 104 "bool": "FALSE", 105} 106 107keyval[3] = { 108 "": "PASS", 109 "milliseconds_1": "3", 110 "milliseconds_6": "7", 111 "ms_1": "2.3", 112 "total": "7", 113 "test{1}": "2", 114 "test{2}": "6", 115 "bool": "FALSE", 116} 117 118keyval[4] = { 119 "": "PASS", 120 "milliseconds_1": "3", 121 "milliseconds_8": "6", 122 "ms_1": "2.3", 123 "total": "7", 124 "test{1}": "2", 125 "test{2}": "6", 126 "bool": "TRUE", 127} 128 129keyval[5] = { 130 "": "PASS", 131 "milliseconds_1": "3", 132 "milliseconds_8": "6", 133 "ms_1": "2.2", 134 "total": "7", 135 "test{1}": "2", 136 "test{2}": "2", 137 "bool": "TRUE", 138} 139 140keyval[6] = { 141 "": "PASS", 142 "milliseconds_1": "3", 143 "milliseconds_8": "6", 144 "ms_1": "2", 145 "total": "7", 146 "test{1}": "2", 147 "test{2}": "4", 148 "bool": "TRUE", 149} 150 151keyval[7] = { 152 "": "PASS", 153 "milliseconds_1": "3", 154 "milliseconds_8": "6", 155 "ms_1": "1", 156 "total": "7", 157 "test{1}": "1", 158 "test{2}": "6", 159 "bool": "TRUE", 160} 161 162keyval[8] = { 163 "": "PASS", 164 "milliseconds_1": "3", 165 "milliseconds_8": "6", 166 "ms_1": "3.3", 167 "total": "7", 168 "test{1}": "2", 169 "test{2}": "8", 170 "bool": "TRUE", 171} 172