Chromium Code Reviews| Index: presubmit_canned_checks.py |
| diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py |
| index 10a8d273d6d9f50f17446914be1076c29f5fd98b..b7143d4537ee2f293519e6e95fb8bd283b278980 100644 |
| --- a/presubmit_canned_checks.py |
| +++ b/presubmit_canned_checks.py |
| @@ -496,7 +496,7 @@ def CheckTreeIsOpen(input_api, output_api, |
| return [] |
| def GetUnitTestsInDirectory( |
| - input_api, output_api, directory, whitelist=None, blacklist=None): |
| + input_api, output_api, directory, whitelist=None, blacklist=None, env=None): |
| """Lists all files in a directory and runs them. Doesn't recurse. |
| It's mainly a wrapper for RunUnitTests. Use whitelist and blacklist to filter |
| @@ -528,10 +528,10 @@ def GetUnitTestsInDirectory( |
| 'Out of %d files, found none that matched w=%r, b=%r in directory %s' |
| % (found, whitelist, blacklist, directory)) |
| ] |
| - return GetUnitTests(input_api, output_api, unit_tests) |
| + return GetUnitTests(input_api, output_api, unit_tests, env) |
| -def GetUnitTests(input_api, output_api, unit_tests): |
| +def GetUnitTests(input_api, output_api, unit_tests, env=None): |
| """Runs all unit tests in a directory. |
| On Windows, sys.executable is used for unit tests ending with ".py". |
| @@ -554,7 +554,7 @@ def GetUnitTests(input_api, output_api, unit_tests): |
| results.append(input_api.Command( |
| name=unit_test, |
| cmd=cmd, |
| - kwargs={'cwd': input_api.PresubmitLocalPath()}, |
| + kwargs={'cwd': input_api.PresubmitLocalPath(), 'env': env}, |
|
ghost stip (do not use)
2014/04/24 20:49:03
what is env if you don't pass it in as a kwarg? do
smut
2014/04/24 20:55:40
I don't want to pass os.environ.copy() by default
|
| message=message_type)) |
| return results |