diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-02 20:24:41 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-02 20:24:41 +0000 |
commit | 7745ba59712ae3f2b0078d79aceac9ddb65f9fd4 (patch) | |
tree | 8c94954d373433c31da693c838443ad269826f09 /tools/grit/PRESUBMIT.py | |
parent | b02721f082619c7ee307c347eac75dc746906cf6 (diff) | |
download | chromium_src-7745ba59712ae3f2b0078d79aceac9ddb65f9fd4.zip chromium_src-7745ba59712ae3f2b0078d79aceac9ddb65f9fd4.tar.gz chromium_src-7745ba59712ae3f2b0078d79aceac9ddb65f9fd4.tar.bz2 |
Add presubmit checks for grit. This runs the unittests.
Fix the grd_reader tests to pass if run from any directory (previously, it
had to be run from tools/grit).
Fix rc_unittest to pass on Linux (it was sensitive to line endings).
If the user doesn't have access to the internal repository, there will be
lots of failures :( Maybe there's a way to detect this case and skip the
tests?
Review URL: http://codereview.chromium.org/6349026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73498 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/grit/PRESUBMIT.py')
-rw-r--r-- | tools/grit/PRESUBMIT.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/grit/PRESUBMIT.py b/tools/grit/PRESUBMIT.py new file mode 100644 index 0000000..f1d58aa --- /dev/null +++ b/tools/grit/PRESUBMIT.py @@ -0,0 +1,21 @@ +# Copyright (c) 2011 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""grit unittests presubmit script. + +See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for +details on the presubmit API built into gcl. +""" + + +def RunUnittests(input_api, output_api): + return input_api.canned_checks.RunPythonUnitTests(input_api, output_api, + ['grit.test_suite_all']) + + +def CheckChangeOnUpload(input_api, output_api): + return RunUnittests(input_api, output_api) + +def CheckChangeOnCommit(input_api, output_api): + return RunUnittests(input_api, output_api) |