OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 """Chromium presubmit script for src/net/tools/tld_cleanup.""" | 6 """Chromium presubmit script for src/net/tools/dafsa.""" |
7 | 7 |
8 | 8 |
9 def _RunMakeDafsaTests(input_api, output_api): | 9 def _RunMakeDafsaTests(input_api, output_api): |
10 """Runs unittest for make_dafsa if any related file has been modified.""" | 10 """Runs unittest for make_dafsa if any related file has been modified.""" |
11 files = ('net/tools/tld_cleanup/make_dafsa.py', | 11 files = ('net/tools/dafsa/make_dafsa.py', |
12 'net/tools/tld_cleanup/make_dafsa_unittest.py') | 12 'net/tools/dafsa/make_dafsa_unittest.py') |
13 if not any(f in input_api.LocalPaths() for f in files): | 13 if not any(f in input_api.LocalPaths() for f in files): |
14 return [] | 14 return [] |
15 test_path = input_api.os_path.join(input_api.PresubmitLocalPath(), | 15 test_path = input_api.os_path.join(input_api.PresubmitLocalPath(), |
16 'make_dafsa_unittest.py') | 16 'make_dafsa_unittest.py') |
17 cmd_name = 'make_dafsa_unittest' | 17 cmd_name = 'make_dafsa_unittest' |
18 cmd = [input_api.python_executable, test_path] | 18 cmd = [input_api.python_executable, test_path] |
19 test_cmd = input_api.Command( | 19 test_cmd = input_api.Command( |
20 name=cmd_name, | 20 name=cmd_name, |
21 cmd=cmd, | 21 cmd=cmd, |
22 kwargs={}, | 22 kwargs={}, |
23 message=output_api.PresubmitPromptWarning) | 23 message=output_api.PresubmitPromptWarning) |
24 return input_api.RunTests([test_cmd]) | 24 return input_api.RunTests([test_cmd]) |
25 | 25 |
26 | 26 |
27 def CheckChangeOnUpload(input_api, output_api): | 27 def CheckChangeOnUpload(input_api, output_api): |
28 return _RunMakeDafsaTests(input_api, output_api) | 28 return _RunMakeDafsaTests(input_api, output_api) |
29 | 29 |
30 | 30 |
31 def CheckChangeOnCommit(input_api, output_api): | 31 def CheckChangeOnCommit(input_api, output_api): |
32 return _RunMakeDafsaTests(input_api, output_api) | 32 return _RunMakeDafsaTests(input_api, output_api) |
OLD | NEW |