Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Side by Side Diff: testing/libfuzzer/tests/check_fuzzer_config.py

Issue 1703523002: [libfuzzer] support of custom libfuzzer options via .options file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: replace .sh-wrapper script with .options config file. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « testing/libfuzzer/tests/BUILD.gn ('k') | testing/libfuzzer/tests/dicts_subdir/test_subdir.dict » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « testing/libfuzzer/tests/BUILD.gn ('k') | testing/libfuzzer/tests/dicts_subdir/test_subdir.dict » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698