diff options
author | Dylan Baker <baker.dylan.c@gmail.com> | 2013-04-20 20:24:46 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2013-05-13 13:51:01 -0700 |
commit | b9c4f96774bd27f09a1ab7bb8cecd0d125f90171 (patch) | |
tree | b9ff3d5da00424c57eba6a18352d8c43fc0fab25 /piglit-print-commands.py | |
parent | 80071932c6777f3b31a55a616682cdbf2998aca4 (diff) |
python: Convert tabs to spaces
PEP 8 specifies that all indents should be either 4 spaces or an
equivalent tab indent, but without mixing tabs and spaces, with a
preference for spaces over tabs because they are absolute. Tabs and
spaces should not be mixed because they lead to expected indent level
errors.
Currently piglit uses a mixture of spaces and tabs, this patch uses the
python tools reindent.py to convert the tabs to spaces.
Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>
v2: Rebase against master, fix apparent unintentional unindentation of
help text in piglit-summary.py (changes by anholt)
Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'piglit-print-commands.py')
-rwxr-xr-x | piglit-print-commands.py | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/piglit-print-commands.py b/piglit-print-commands.py index 228ac84b5..74cc70cd1 100755 --- a/piglit-print-commands.py +++ b/piglit-print-commands.py @@ -39,62 +39,62 @@ from framework.gleantest import GleanTest ############################################################################# def main(): - parser = argparse.ArgumentParser(sys.argv) + parser = argparse.ArgumentParser(sys.argv) - parser.add_argument("-t", "--include-tests", - default = [], - action = "append", - metavar = "<regex>", - help = "Run only matching tests (can be used more than once)") - parser.add_argument("--tests", - default = [], - action = "append", - metavar = "<regex>", - help = "Run only matching tests (can be used more than once)" \ - "Deprecated") - parser.add_argument("-x", "--exclude-tests", - default = [], - action = "append", - metavar = "<regex>", - help = "Exclude matching tests (can be used more than once)") - parser.add_argument("testProfile", - metavar = "<Path to testfile>", - help = "Path to results folder") + parser.add_argument("-t", "--include-tests", + default = [], + action = "append", + metavar = "<regex>", + help = "Run only matching tests (can be used more than once)") + parser.add_argument("--tests", + default = [], + action = "append", + metavar = "<regex>", + help = "Run only matching tests (can be used more than once)" \ + "Deprecated") + parser.add_argument("-x", "--exclude-tests", + default = [], + action = "append", + metavar = "<regex>", + help = "Exclude matching tests (can be used more than once)") + parser.add_argument("testProfile", + metavar = "<Path to testfile>", + help = "Path to results folder") - args = parser.parse_args() + args = parser.parse_args() - # Deprecated - # --include-tests is the standard going forward, but for backwards - # compatability merge args.tests into args.include_tests and drop - # duplicates - if args.tests != []: - print "Warnings: Option --tests is deprecated, use --include-tests" - args.include_tests = list(set(args.include_tests + args.tests)) - - # Set the environment, pass in the included and excluded tests - env = core.Environment( - exclude_filter=args.exclude_tests, - include_filter=args.include_tests, - ) + # Deprecated + # --include-tests is the standard going forward, but for backwards + # compatability merge args.tests into args.include_tests and drop + # duplicates + if args.tests != []: + print "Warnings: Option --tests is deprecated, use --include-tests" + args.include_tests = list(set(args.include_tests + args.tests)) - # Change to the piglit's path - piglit_dir = path.dirname(path.realpath(sys.argv[0])) - os.chdir(piglit_dir) + # Set the environment, pass in the included and excluded tests + env = core.Environment( + exclude_filter=args.exclude_tests, + include_filter=args.include_tests, + ) - profile = core.loadTestProfile(args.testProfile) + # Change to the piglit's path + piglit_dir = path.dirname(path.realpath(sys.argv[0])) + os.chdir(piglit_dir) - def getCommand(test): - command = '' - if isinstance(test, GleanTest): - for var, val in test.env.items(): - command += var + "='" + val + "' " - command += ' '.join(test.command) - return command + profile = core.loadTestProfile(args.testProfile) - profile.prepare_test_list(env) - for name, test in profile.test_list.items(): - assert(isinstance(test, ExecTest)) - print name, ':::', getCommand(test) + def getCommand(test): + command = '' + if isinstance(test, GleanTest): + for var, val in test.env.items(): + command += var + "='" + val + "' " + command += ' '.join(test.command) + return command + + profile.prepare_test_list(env) + for name, test in profile.test_list.items(): + assert(isinstance(test, ExecTest)) + print name, ':::', getCommand(test) if __name__ == "__main__": - main() + main() |