From 3d34bd6f71ea0aea6ce62355ce63895c61d40dbe Mon Sep 17 00:00:00 2001 From: "kjellander@google.com" Date: Tue, 19 Nov 2013 10:56:35 +0000 Subject: [PATCH] Fix libyuv_tests.py to handle recent Chromium changes. This CL contains the same changes as in WebRTC revision 4957 and r4959. This will make the tests run properly on the memcheck and tsan bots again. TEST=compiled and successfully ran from the parent dir of trunk: trunk/tools/valgrind-libyuv/libyuv_tests.sh --test libyuv_unittest --tool memcheck --target Release --build-dir trunk/out TBR=fbarchard@google.com Review URL: https://webrtc-codereview.appspot.com/4049004 git-svn-id: http://libyuv.googlecode.com/svn/trunk@860 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- tools/valgrind-libyuv/libyuv_tests.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/valgrind-libyuv/libyuv_tests.py b/tools/valgrind-libyuv/libyuv_tests.py index f93e97bb7..1b912b8ba 100755 --- a/tools/valgrind-libyuv/libyuv_tests.py +++ b/tools/valgrind-libyuv/libyuv_tests.py @@ -73,9 +73,10 @@ class LibyuvTest(chrome_tests.ChromeTests): def main(_): parser = optparse.OptionParser('usage: %prog -b -t ') parser.disable_interspersed_args() - parser.add_option('-b', '--build_dir', + parser.add_option('-b', '--build-dir', help=('Location of the compiler output. Can only be used ' 'when the test argument does not contain this path.')) + parser.add_option("--target", help="Debug or Release") parser.add_option('-t', '--test', help='Test to run.') parser.add_option('', '--baseline', action='store_true', default=False, help='Generate baseline data instead of validating') @@ -104,6 +105,11 @@ def main(_): if not options.test: parser.error('--test not specified') + # Support build dir both with and without the target. + if (options.target and options.build_dir and + not options.build_dir.endswith(options.target)): + options.build_dir = os.path.join(options.build_dir, options.target) + # If --build_dir is provided, prepend it to the test executable if needed. test_executable = options.test if options.build_dir and not test_executable.startswith(options.build_dir):