blink_lint_expectations.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/usr/bin/env vpython3
  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. import json
  6. import os
  7. import sys
  8. # Add src/testing/ into sys.path for importing common without pylint errors.
  9. sys.path.append(
  10. os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))
  11. from scripts import common
  12. def main_run(args):
  13. with common.temporary_file() as tempfile_path:
  14. rc = common.run_command([
  15. sys.executable,
  16. os.path.join(common.SRC_DIR, 'third_party', 'blink',
  17. 'tools', 'lint_test_expectations.py'),
  18. '--json', tempfile_path
  19. ])
  20. with open(tempfile_path) as f:
  21. failures = json.load(f)
  22. common.record_local_script_results(
  23. 'blink_lint_expectations', args.output, failures, True)
  24. return rc
  25. def main_compile_targets(args):
  26. json.dump([], args.output)
  27. if __name__ == '__main__':
  28. funcs = {
  29. 'run': main_run,
  30. 'compile_targets': main_compile_targets,
  31. }
  32. sys.exit(common.run_script(sys.argv[1:], funcs))