Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/usr/bin/python2 | |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | |
| 3 # Use of this source code is governed by a BSD-style license that can be | |
| 4 # found in the LICENSE file. | |
| 5 | |
| 6 # Script that prints out "option=value" from the config file. Used for testing. | |
| 7 | |
| 8 import ConfigParser | |
| 9 import os | |
| 10 import sys | |
| 11 | |
| 12 OPTIONS_SECTION_LIBFUZZER = 'libfuzzer' | |
| 13 | |
| 14 config_path = os.path.join(os.path.dirname(sys.argv[0]), sys.argv[1]) | |
| 15 fuzzer_config = ConfigParser.ConfigParser() | |
| 16 fuzzer_config.read(config_path) | |
| 17 | |
| 18 if not fuzzer_config.has_section(OPTIONS_SECTION_LIBFUZZER): | |
| 19 sys.exit(-1) | |
| 20 | |
| 21 for option_name in fuzzer_config.options(OPTIONS_SECTION_LIBFUZZER): | |
|
Oliver Chang
2016/02/29 18:53:50
nit: can you use .items() here?
mmoroz
2016/03/01 12:35:20
Yes, it would be better, thanks!
Done.
| |
| 22 option_value = fuzzer_config.get(OPTIONS_SECTION_LIBFUZZER, option_name) | |
| 23 sys.stdout.write('%s=%s\n\r' % (option_name, option_value)) | |
|
Oliver Chang
2016/02/29 18:53:50
Why do you need the \r here?
mmoroz
2016/03/01 12:35:20
I saw that existing test from Mike uses '\n\r' to
| |
| OLD | NEW |