1#!/usr/bin/env python3 2# Copyright 2015 The Chromium Authors 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 8import os 9import sys 10 11if sys.version_info.major == 2: 12 from ConfigParser import ConfigParser 13else: 14 from configparser import ConfigParser 15 16OPTIONS_SECTION_LIBFUZZER = 'libfuzzer' 17 18config_path = os.path.join(os.path.dirname(sys.argv[0]), sys.argv[1]) 19fuzzer_config = ConfigParser() 20fuzzer_config.read(config_path) 21 22if not fuzzer_config.has_section(OPTIONS_SECTION_LIBFUZZER): 23 sys.exit(-1) 24 25for option_name, option_value in fuzzer_config.items(OPTIONS_SECTION_LIBFUZZER): 26 sys.stdout.write('%s=%s\n' % (option_name, option_value)) 27