check_fuzzer_config.py 805 B

1234567891011121314151617181920212223242526
  1. #!/usr/bin/env python3
  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. # Script that prints out "option=value" from the config file. Used for testing.
  6. import os
  7. import sys
  8. if sys.version_info.major == 2:
  9. from ConfigParser import ConfigParser
  10. else:
  11. from configparser import ConfigParser
  12. OPTIONS_SECTION_LIBFUZZER = 'libfuzzer'
  13. config_path = os.path.join(os.path.dirname(sys.argv[0]), sys.argv[1])
  14. fuzzer_config = ConfigParser()
  15. fuzzer_config.read(config_path)
  16. if not fuzzer_config.has_section(OPTIONS_SECTION_LIBFUZZER):
  17. sys.exit(-1)
  18. for option_name, option_value in fuzzer_config.items(OPTIONS_SECTION_LIBFUZZER):
  19. sys.stdout.write('%s=%s\n' % (option_name, option_value))