Support for being executed from runtests.py

This is also needed to make it possible to run unit tests easily using Chromium's buildbot source code.

BUG=None
TEST=tools/valgrind-webrtc/webrtc_tests.sh --test test_support_unittests --build_dir=out/Debug

Review URL: https://webrtc-codereview.appspot.com/784007

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2738 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
kjellander@webrtc.org 2012-09-11 11:22:45 +00:00
parent b764d78831
commit b43f85ffd3

View File

@ -121,6 +121,11 @@ def _main(_):
if len(options.test) != 1 and options.gtest_filter:
parser.error("--gtest_filter and multiple tests don't make sense together")
# If --build_dir is provided, prepend that path to the test name to make it a
# valid path when running on the build slaves using Chromium's runtest.py
if options.build_dir and 'cmdline' in options.test and len(args) == 1:
args[0] = os.path.join(options.build_dir, args[0])
# Performs the deferred-argument black magic described in the usage.
translated_args = map(lambda arg: arg.replace('+', '-'), args)