aboutsummaryrefslogtreecommitdiff
path: root/bestflags/testing_batch.py
diff options
context:
space:
mode:
Diffstat (limited to 'bestflags/testing_batch.py')
-rw-r--r--bestflags/testing_batch.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/bestflags/testing_batch.py b/bestflags/testing_batch.py
index 7bfda09b..ffe19448 100644
--- a/bestflags/testing_batch.py
+++ b/bestflags/testing_batch.py
@@ -1,7 +1,6 @@
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-
"""Hill climbing unitest.
Part of the Chrome build flags optimization.
@@ -30,7 +29,6 @@ from task import BUILD_STAGE
from task import Task
from task import TEST_STAGE
-
# The number of flags be tested.
NUM_FLAGS = 5
@@ -296,9 +294,9 @@ def _TestAlgorithm(cost_func, specs, generations, best_result):
manager = multiprocessing.Manager()
input_queue = manager.Queue()
output_queue = manager.Queue()
- pp_steer = multiprocessing.Process(target=Steering,
- args=(set(), generations, output_queue,
- input_queue))
+ pp_steer = multiprocessing.Process(
+ target=Steering,
+ args=(set(), generations, output_queue, input_queue))
pp_steer.start()
# The best result of the algorithm so far.
@@ -401,8 +399,7 @@ class MockAlgorithmsTest(unittest.TestCase):
specs, MUTATION_RATE)
# Generate the initial generations.
- generation_tasks = GenerateRandomGATasks(specs, NUM_CHROMOSOMES,
- NUM_TRIALS)
+ generation_tasks = GenerateRandomGATasks(specs, NUM_CHROMOSOMES, NUM_TRIALS)
generations = [GAGeneration(generation_tasks, set([]), 0)]
# Test the algorithm.
@@ -448,5 +445,6 @@ class MockAlgorithmsTest(unittest.TestCase):
# be generated.
_TestAlgorithm(cost_function, specs, generations, cost)
+
if __name__ == '__main__':
unittest.main()