OLD | NEW |
---|---|
(Empty) | |
1 #!/usr/bin/env python | |
2 | |
M-A Ruel
2014/05/02 16:53:02
I meant to remove the empty line, it's not needed,
Olle Liljenzin
2014/05/05 08:41:40
Done.
| |
3 # Copyright 2014 The Chromium Authors. All rights reserved. | |
4 # Use of this source code is governed by a BSD-style license that can be | |
5 # found in the LICENSE file. | |
6 | |
7 | |
8 """Chromium presubmit script for src/net/tools/tld_cleanup.""" | |
9 | |
10 | |
11 def _RunMakeDafsaTests(input_api, output_api): | |
12 """Runs unittest for make_dafsa if any related file has been modified.""" | |
13 files = ('net/tools/tld_cleanup/make_dafsa.py', | |
14 'net/tools/tld_cleanup/make_dafsa_unittest.py') | |
15 if not any(f in input_api.LocalPaths() for f in files): | |
16 return | |
17 test_path = input_api.os_path.join(input_api.PresubmitLocalPath(), | |
18 'make_dafsa_unittest.py') | |
19 cmd_name = 'make_dafsa_unittest' | |
20 if input_api.platform == 'win32': | |
21 # Windows needs some help. | |
22 cmd = [input_api.python_executable, test_path] | |
23 else: | |
24 cmd = [test_path] | |
25 test_cmd = input_api.Command( | |
26 name=cmd_name, | |
27 cmd=cmd, | |
28 kwargs={}, | |
29 message=output_api.PresubmitPromptWarning) | |
30 if input_api.verbose: | |
31 print('Running ' + cmd_name) | |
M-A Ruel
2014/05/02 16:53:02
The output is already printed when in verbose mode
Olle Liljenzin
2014/05/05 08:41:40
Done.
| |
32 return input_api.RunTests([test_cmd]) | |
33 | |
34 | |
35 def CheckChangeOnUpload(input_api, output_api): | |
36 return _RunMakeDafsaTests(input_api, output_api) | |
37 | |
38 | |
39 def CheckChangeOnCommit(input_api, output_api): | |
40 return _RunMakeDafsaTests(input_api, output_api) | |
OLD | NEW |