| 12 | |
| 13 | |
| 14 | def _CheckLint(input_api, output_api): |
| 15 | root = pathlib.Path(input_api.PresubmitLocalPath()) |
| 16 | vpython_spec = root / '.lint-vpython3' |
| 17 | workdir = root / 'data' |
| 18 | lint_exe = workdir / 'tools' / 'lint' / 'lint.py' |
| 19 | test_path = workdir / '..' / 'local-tests' / 'test' |
| 20 | staging_path = (test_path / 'staging').relative_to(workdir) |
| 21 | lint_exceptions = root / 'lint.exceptions' |
| 22 | command = [ |
| 23 | 'vpython3', |
| 24 | '-vpython-spec', |
| 25 | vpython_spec, |
| 26 | lint_exe, |
| 27 | '--exceptions', |
| 28 | lint_exceptions, |
| 29 | '--features', |
| 30 | staging_path / 'features.txt', |
| 31 | staging_path, |
| 32 | ] |
| 33 | proc = Popen( |
| 34 | command, |
| 35 | cwd=workdir, |
| 36 | stderr=STDOUT, |
| 37 | stdout=PIPE, |
| 38 | shell=platform.system() == 'Windows') |
| 39 | output, exit_code = proc.communicate()[0], proc.returncode |
| 40 | if exit_code == 0: |
| 41 | return [] |
| 42 | return [ |
| 43 | output_api.PresubmitError( |
| 44 | "Test262 lint failed.", long_text=output.decode()) |
| 45 | ] |
| 46 | |
| 47 | |
| 48 | def _PyUnitTest(input_api, output_api): |