diff options
author | Tiancong Wang <tcwang@google.com> | 2019-03-01 10:00:38 -0800 |
---|---|---|
committer | Tiancong Wang <tcwang@google.com> | 2019-03-14 17:04:46 +0000 |
commit | 6512f0baf7a540267b735accac77cf6903a63306 (patch) | |
tree | 2959258979880f39d7108d8bcbe9f31ce78bc2dd /crosperf/results_report_unittest.py | |
parent | ca7fa0584faba419510cc03c98aa598254b3fe73 (diff) | |
download | toolchain-utils-6512f0baf7a540267b735accac77cf6903a63306.tar.gz |
crosperf: Add unittest for disable ASLR CL
In crrev.com/c/1398522, we disabled ASLR in crosperf by default. In
that CL, there's no unittest support and other crosperf unittest
might fail because of the CL. This patch is to fix the errors in
unittest and also add unittests for the newly added functionalities.
BUG=chromium:930332
TEST=Unittests pass
Change-Id: I332604245ea2ee1100a498ce021530572e7609ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1497036
Reviewed-by: Caroline Tice <cmtice@chromium.org>
Tested-by: Tiancong Wang <tcwang@google.com>
Diffstat (limited to 'crosperf/results_report_unittest.py')
-rwxr-xr-x | crosperf/results_report_unittest.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crosperf/results_report_unittest.py b/crosperf/results_report_unittest.py index 2a23aa78..750dcdf4 100755 --- a/crosperf/results_report_unittest.py +++ b/crosperf/results_report_unittest.py @@ -1,4 +1,5 @@ #!/usr/bin/env python2 +# -*- coding: utf-8 -*- # # Copyright 2016 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be @@ -126,8 +127,8 @@ def _InjectSuccesses(experiment, how_many, keyvals, for_benchmark=0, machine_manager = MockMachineManager( FakePath('chromeos_root'), 0, log_level, locks_dir) machine_manager.AddMachine('testing_machine') - machine = next(m for m in machine_manager.GetMachines() - if m.name == 'testing_machine') + machine = next( + m for m in machine_manager.GetMachines() if m.name == 'testing_machine') for label in experiment.labels: def MakeSuccessfulRun(n): @@ -319,8 +320,11 @@ class JSONResultsReportTest(unittest.TestCase): def testFailedJSONReportOutputWithoutExperiment(self): labels = ['label1'] + # yapf:disable benchmark_names_and_iterations = [('bench1', 1), ('bench2', 2), ('bench3', 1), ('bench4', 0)] + # yapf:enable + benchmark_keyvals = { 'bench1': [[{ 'retval': 1, |