OLD | NEW |
---|---|
(Empty) | |
1 #!/usr/bin/env python | |
M-A Ruel
2014/05/05 16:54:51
Technically, this file is not executable, so pleas
Olle Liljenzin
2014/05/05 17:32:05
Done.
| |
2 # Copyright 2014 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 | |
6 | |
7 """Chromium presubmit script for src/net/tools/tld_cleanup.""" | |
8 | |
9 | |
10 def _RunMakeDafsaTests(input_api, output_api): | |
11 """Runs unittest for make_dafsa if any related file has been modified.""" | |
12 files = ('net/tools/tld_cleanup/make_dafsa.py', | |
13 'net/tools/tld_cleanup/make_dafsa_unittest.py') | |
14 if not any(f in input_api.LocalPaths() for f in files): | |
15 return | |
16 test_path = input_api.os_path.join(input_api.PresubmitLocalPath(), | |
17 'make_dafsa_unittest.py') | |
18 cmd_name = 'make_dafsa_unittest' | |
19 if input_api.platform == 'win32': | |
20 # Windows needs some help. | |
21 cmd = [input_api.python_executable, test_path] | |
M-A Ruel
2014/05/05 16:54:51
Do it on all platform for consistency.
Olle Liljenzin
2014/05/05 17:32:05
Note that I just copied the code from the document
| |
22 else: | |
23 cmd = [test_path] | |
24 test_cmd = input_api.Command( | |
25 name=cmd_name, | |
26 cmd=cmd, | |
27 kwargs={}, | |
28 message=output_api.PresubmitPromptWarning) | |
29 return input_api.RunTests([test_cmd]) | |
30 | |
31 | |
32 def CheckChangeOnUpload(input_api, output_api): | |
33 return _RunMakeDafsaTests(input_api, output_api) | |
34 | |
35 | |
36 def CheckChangeOnCommit(input_api, output_api): | |
37 return _RunMakeDafsaTests(input_api, output_api) | |
OLD | NEW |