diff options
author | Cassidy Burden <cburden@google.com> | 2016-08-11 15:05:38 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-08-16 10:33:25 -0700 |
commit | 4cc3dd8a3b2ab04cf861d7c71967de0298746cb9 (patch) | |
tree | b032d8da64ed4da9ebbd170598377272cb9ae1a2 /binary_search_tool/test | |
parent | b217c8a28be52f90572d26647d38dcfc9e08ce0b (diff) | |
download | toolchain-utils-4cc3dd8a3b2ab04cf861d7c71967de0298746cb9.tar.gz |
binary search tool: Run tc_pyformat on all python scripts
REFACTOR WARNING! Run tc_pyformat on all python scripts.
TEST=Run unit tests, Android bisection
Change-Id: I9624e7be2670bdb29bcdb59404bf9e8c2f7d81c5
Reviewed-on: https://chrome-internal-review.googlesource.com/274615
Commit-Ready: Caroline Tice <cmtice@google.com>
Tested-by: Caroline Tice <cmtice@google.com>
Reviewed-by: Caroline Tice <cmtice@google.com>
Diffstat (limited to 'binary_search_tool/test')
-rwxr-xr-x | binary_search_tool/test/binary_search_tool_tester.py | 22 | ||||
-rwxr-xr-x | binary_search_tool/test/gen_init_list.py | 4 | ||||
-rwxr-xr-x | binary_search_tool/test/gen_obj.py | 46 |
3 files changed, 35 insertions, 37 deletions
diff --git a/binary_search_tool/test/binary_search_tool_tester.py b/binary_search_tool/test/binary_search_tool_tester.py index ddf302b0..775c1715 100755 --- a/binary_search_tool/test/binary_search_tool_tester.py +++ b/binary_search_tool/test/binary_search_tool_tester.py @@ -127,10 +127,8 @@ class BisectingUtilsTest(unittest.TestCase): except OSError: pass - cleanup_list = ['./is_setup', - binary_search_state.STATE_FILE, - 'noinc_prune_bad', - 'noinc_prune_good'] + cleanup_list = ['./is_setup', binary_search_state.STATE_FILE, + 'noinc_prune_bad', 'noinc_prune_good'] for f in cleanup_list: if os.path.exists(f): os.remove(f) @@ -296,14 +294,13 @@ class BisectingUtilsTest(unittest.TestCase): self.assertEquals(bad_objs[found_obj], 1) def test_set_file(self): - binary_search_state.Run( - get_initial_items='./gen_init_list.py', - switch_to_good='./switch_to_good_set_file.py', - switch_to_bad='./switch_to_bad_set_file.py', - test_script='./is_good.py', - prune=True, - file_args=True, - verify=True) + binary_search_state.Run(get_initial_items='./gen_init_list.py', + switch_to_good='./switch_to_good_set_file.py', + switch_to_bad='./switch_to_bad_set_file.py', + test_script='./is_good.py', + prune=True, + file_args=True, + verify=True) self.check_output() def test_noincremental_prune(self): @@ -373,7 +370,6 @@ class BisectStressTest(unittest.TestCase): self.assertEquals(ret, 0) self.check_output() - def check_output(self): _, out, _ = command_executer.GetCommandExecuter().RunCommandWOutput( ('grep "Bad items are: " logs/binary_search_tool_tester.py.out | ' diff --git a/binary_search_tool/test/gen_init_list.py b/binary_search_tool/test/gen_init_list.py index 10db5240..4a79a1b1 100755 --- a/binary_search_tool/test/gen_init_list.py +++ b/binary_search_tool/test/gen_init_list.py @@ -11,8 +11,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 1c060e01..265729d2 100755 --- a/binary_search_tool/test/gen_obj.py +++ b/binary_search_tool/test/gen_obj.py @@ -28,25 +28,28 @@ def Main(argv): 0 always. """ parser = argparse.ArgumentParser() - parser.add_argument('-n', - '--obj_num', - dest='obj_num', - default=common.DEFAULT_OBJECT_NUMBER, - help=('Number of total objects.')) - parser.add_argument('-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.')) - parser.add_argument('-o', - '--obj_list', - dest='obj_list', - default='', - help=('List of comma seperated objects to generate. ' - 'A 0 means the object is good, a 1 means the ' - 'object is bad.')) + parser.add_argument( + '-n', + '--obj_num', + dest='obj_num', + default=common.DEFAULT_OBJECT_NUMBER, + help=('Number of total objects.')) + parser.add_argument( + '-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.')) + parser.add_argument( + '-o', + '--obj_list', + dest='obj_list', + default='', + help=('List of comma seperated objects to generate. ' + 'A 0 means the object is good, a 1 means the ' + 'object is bad.')) options = parser.parse_args(argv) obj_num = int(options.obj_num) @@ -83,9 +86,8 @@ def Main(argv): obj_num = len(obj_list) bad_obj_num = obj_list.count('1') - print('Generated {0} object files, with {1} bad ones.'.format( - obj_num, bad_obj_num)) - + print('Generated {0} object files, with {1} bad ones.'.format(obj_num, + bad_obj_num)) return 0 |