aboutsummaryrefslogtreecommitdiff
path: root/binary_search_tool/test
diff options
context:
space:
mode:
authorLuis Lozano <llozano@chromium.org>2015-12-15 13:49:30 -0800
committerLuis Lozano <llozano@chromium.org>2015-12-16 17:36:06 +0000
commitf2a3ef46f75d2196a93d3ed27f4d1fcf22b54fbe (patch)
tree185d243c7eed7c7a0db6f0e640746cadc1479ea9 /binary_search_tool/test
parent2a66f70fef907c1cb15229cb58e5129cb620ac98 (diff)
downloadtoolchain-utils-f2a3ef46f75d2196a93d3ed27f4d1fcf22b54fbe.tar.gz
Run pyformat on all the toolchain-utils files.
This gets rid of a lot of lint issues. Ran by doing this: for f in *.py; do echo -n "$f " ; if [ -x $f ]; then pyformat -i --remove_trailing_comma --yapf --force_quote_type=double $f ; else pyformat -i --remove_shebang --remove_trailing_comma --yapf --force_quote_type=double $f ; fi ; done BUG=chromium:567921 TEST=Ran simple crosperf run. Change-Id: I59778835fdaa5f706d2e1765924389f9e97433d1 Reviewed-on: https://chrome-internal-review.googlesource.com/242031 Reviewed-by: Luis Lozano <llozano@chromium.org> Commit-Queue: Luis Lozano <llozano@chromium.org> Tested-by: Luis Lozano <llozano@chromium.org> Reviewed-by: Yunlian Jiang <yunlian@google.com>
Diffstat (limited to 'binary_search_tool/test')
-rwxr-xr-xbinary_search_tool/test/__init__.py1
-rwxr-xr-xbinary_search_tool/test/binary_search_tool_tester.py13
-rwxr-xr-xbinary_search_tool/test/common.py1
-rwxr-xr-xbinary_search_tool/test/gen_init_list.py4
-rwxr-xr-xbinary_search_tool/test/gen_obj.py11
-rwxr-xr-xbinary_search_tool/test/is_good.py1
6 files changed, 16 insertions, 15 deletions
diff --git a/binary_search_tool/test/__init__.py b/binary_search_tool/test/__init__.py
index e69de29b..8b137891 100755
--- a/binary_search_tool/test/__init__.py
+++ b/binary_search_tool/test/__init__.py
@@ -0,0 +1 @@
+
diff --git a/binary_search_tool/test/binary_search_tool_tester.py b/binary_search_tool/test/binary_search_tool_tester.py
index 91b5845d..3b8e44ce 100755
--- a/binary_search_tool/test/binary_search_tool_tester.py
+++ b/binary_search_tool/test/binary_search_tool_tester.py
@@ -1,7 +1,6 @@
#!/usr/bin/python
# Copyright 2012 Google Inc. All Rights Reserved.
-
"""Tests for bisecting tool."""
__author__ = 'shenhan@google.com (Han Shen)'
@@ -32,15 +31,13 @@ class BisectingUtilsTest(unittest.TestCase):
"""Cleanup temp files."""
os.remove(common.OBJECTS_FILE)
os.remove(common.WORKING_SET_FILE)
- print 'Deleted "{0}" and "{1}"'.format(
- common.OBJECTS_FILE, common.WORKING_SET_FILE)
+ print 'Deleted "{0}" and "{1}"'.format(common.OBJECTS_FILE,
+ common.WORKING_SET_FILE)
def runTest(self):
- args = ['--get_initial_items', './gen_init_list.py',
- '--switch_to_good', './switch_to_good.py',
- '--switch_to_bad', './switch_to_bad.py',
- '--test_script', './is_good.py',
- '--prune', '--file_args']
+ args = ['--get_initial_items', './gen_init_list.py', '--switch_to_good',
+ './switch_to_good.py', '--switch_to_bad', './switch_to_bad.py',
+ '--test_script', './is_good.py', '--prune', '--file_args']
binary_search_state.Main(args)
_, out, _ = command_executer.GetCommandExecuter().RunCommandWOutput(
diff --git a/binary_search_tool/test/common.py b/binary_search_tool/test/common.py
index c0e1a3b3..cc0a02e4 100755
--- a/binary_search_tool/test/common.py
+++ b/binary_search_tool/test/common.py
@@ -5,6 +5,7 @@ DEFAULT_BAD_OBJECT_NUMBER = 23
OBJECTS_FILE = 'objects.txt'
WORKING_SET_FILE = 'working_set.txt'
+
def ReadWorkingSet():
working_set = []
f = open(WORKING_SET_FILE, 'r')
diff --git a/binary_search_tool/test/gen_init_list.py b/binary_search_tool/test/gen_init_list.py
index 4ac5da83..02a111ab 100755
--- a/binary_search_tool/test/gen_init_list.py
+++ b/binary_search_tool/test/gen_init_list.py
@@ -9,8 +9,8 @@ import common
def Main():
ce = command_executer.GetCommandExecuter()
- _, l, _ = ce.RunCommandWOutput(
- 'cat {0} | wc -l'.format(common.OBJECTS_FILE), print_to_console=False)
+ _, l, _ = ce.RunCommandWOutput('cat {0} | wc -l'.format(common.OBJECTS_FILE),
+ print_to_console=False)
for i in range(0, int(l)):
print i
diff --git a/binary_search_tool/test/gen_obj.py b/binary_search_tool/test/gen_obj.py
index 3d1e32f9..f817049f 100755
--- a/binary_search_tool/test/gen_obj.py
+++ b/binary_search_tool/test/gen_obj.py
@@ -25,10 +25,14 @@ def Main(argv):
0 always.
"""
parser = optparse.OptionParser()
- parser.add_option('-n', '--obj_num', dest='obj_num',
+ parser.add_option('-n',
+ '--obj_num',
+ dest='obj_num',
default=common.DEFAULT_OBJECT_NUMBER,
help=('Number of total objects.'))
- parser.add_option('-b', '--bad_obj_num', dest='bad_obj_num',
+ parser.add_option('-b',
+ '--bad_obj_num',
+ dest='bad_obj_num',
default=common.DEFAULT_BAD_OBJECT_NUMBER,
help=('Number of bad objects. Must be great than or equal '
'to zero and less than total object number.'))
@@ -39,8 +43,7 @@ def Main(argv):
bad_to_gen = int(options.bad_obj_num)
obj_list = []
for i in range(obj_num):
- if (bad_to_gen > 0 and
- random.randint(1, obj_num) <= bad_obj_num):
+ if (bad_to_gen > 0 and random.randint(1, obj_num) <= bad_obj_num):
obj_list.append(1)
bad_to_gen -= 1
else:
diff --git a/binary_search_tool/test/is_good.py b/binary_search_tool/test/is_good.py
index 60b2b50d..a420aa59 100755
--- a/binary_search_tool/test/is_good.py
+++ b/binary_search_tool/test/is_good.py
@@ -17,4 +17,3 @@ def Main():
if __name__ == '__main__':
retval = Main()
sys.exit(retval)
-