diff options
author | jln@chromium.org <jln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-27 21:35:50 +0000 |
---|---|---|
committer | jln@chromium.org <jln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-27 21:35:50 +0000 |
commit | cdbdced47ca4a9845e3e7f7e193e93876457f795 (patch) | |
tree | c7ef2669c82211bb8ea9435146378ec680187362 /PRESUBMIT.py | |
parent | 2557cb6f980404bee4408a087c008e99ad28ced2 (diff) | |
download | chromium_src-cdbdced47ca4a9845e3e7f7e193e93876457f795.zip chromium_src-cdbdced47ca4a9845e3e7f7e193e93876457f795.tar.gz chromium_src-cdbdced47ca4a9845e3e7f7e193e93876457f795.tar.bz2 |
Exclude sandbox/linux from SpamLogging check and restrict printf check.
1. Restrict the printf check to stdout / stderr
2. sandbox/linux uses printf and fprintf for good reason in a few places.
None of these would ever spam Chrome's stderr.
- Tests inside sandbox/linux have to run within their own small test
framework (so that they can run each in their own process). In this
framework, fprintf(stderr, XX) can be used to fail a test.
- The setuid sandbox is its own command line executable. It uses fprintf.
- A small number of tests (2), use fprintf to report kernel status while
running the test. It's extremely useful.
- The code generator in the BPF compiler was developped without base/
originally. It uses fprintf in a debug mode to print the assembled
program. This will only trigger on the equivalent of "compilation errors".
R=maruel@chromium.org, thakis@chromium.org
Review URL: https://codereview.chromium.org/89073002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237624 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT.py')
-rw-r--r-- | PRESUBMIT.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 370c057..0a9dae0 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -835,7 +835,8 @@ def _CheckSpamLogging(input_api, output_api): _TEST_CODE_EXCLUDED_PATHS + input_api.DEFAULT_BLACK_LIST + (r"^base[\\\/]logging\.h$", - r"^remoting[\\\/]base[\\\/]logging\.h$",)) + r"^remoting[\\\/]base[\\\/]logging\.h$", + r"^sandbox[\\\/]linux[\\\/].*",)) source_file_filter = lambda x: input_api.FilterSourceFile( x, white_list=(file_inclusion_pattern,), black_list=black_list) @@ -846,7 +847,7 @@ def _CheckSpamLogging(input_api, output_api): contents = input_api.ReadFile(f, 'rb') if re.search(r"\bD?LOG\s*\(\s*INFO\s*\)", contents): log_info.append(f.LocalPath()) - if re.search(r"\bf?printf\(", contents): + if re.search(r"\bf?printf\((stdout|stderr)", contents): printf.append(f.LocalPath()) if log_info: |