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