diff options
author | Luis Lozano <llozano@chromium.org> | 2015-12-10 10:47:01 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-12-15 01:21:49 +0000 |
commit | 036c9233742004aa773a374df381b1cf137484f5 (patch) | |
tree | b1566971ae12ed6ec13f086dd450eca741604f26 /binary_search_tool/test | |
parent | e627fd61c2edba668eb2af8221892286b13f05a3 (diff) | |
download | toolchain-utils-036c9233742004aa773a374df381b1cf137484f5.tar.gz |
crosperf: RunCommand should return one type of object.
Cleaned up the interfaces for the RunCommand routines.
These were returning different types (int or tuple) depending on
the value of the return_ouput parameter.
Returning different unrelated types from a routine is bad practice.
Linter complains about this with several warnings like this:
"Attempting to unpack a non-sequence defined at line XY of
utils.command_executer"
BUG=chromium:566256
TEST=ran crosperf with a example experiment file
Ran run_tests.
Change-Id: Ibb83ab9322c87558077fc4937ef5c0686bbe5417
Reviewed-on: https://chrome-internal-review.googlesource.com/241459
Commit-Ready: Luis Lozano <llozano@chromium.org>
Tested-by: Luis Lozano <llozano@chromium.org>
Reviewed-by: Han Shen <shenhan@google.com>
Diffstat (limited to 'binary_search_tool/test')
-rwxr-xr-x | binary_search_tool/test/binary_search_tool_tester.py | 4 | ||||
-rwxr-xr-x | binary_search_tool/test/gen_init_list.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/binary_search_tool/test/binary_search_tool_tester.py b/binary_search_tool/test/binary_search_tool_tester.py index 211c16f2..91b5845d 100755 --- a/binary_search_tool/test/binary_search_tool_tester.py +++ b/binary_search_tool/test/binary_search_tool_tester.py @@ -43,8 +43,8 @@ class BisectingUtilsTest(unittest.TestCase): '--prune', '--file_args'] binary_search_state.Main(args) - _, out, _ = command_executer.GetCommandExecuter().RunCommand( - 'tail -n 10 logs/binary_search_state.py.out', return_output=True) + _, out, _ = command_executer.GetCommandExecuter().RunCommandWOutput( + 'tail -n 10 logs/binary_search_state.py.out') ls = out.splitlines() for l in ls: t = l.find('Bad items are: ') diff --git a/binary_search_tool/test/gen_init_list.py b/binary_search_tool/test/gen_init_list.py index ce72d632..4ac5da83 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.RunCommand('cat {0} | wc -l'.format(common.OBJECTS_FILE), - return_output=True, 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 |