From a96d8771f24a0e6725129154892d1dc112742dad Mon Sep 17 00:00:00 2001 From: "phoglund@webrtc.org" Date: Wed, 31 Jul 2013 10:50:30 +0000 Subject: [PATCH] Added libjingle_peerconnection_java_unittest to buildbot_tests.py The test apparently needs a custom LD_PRELOAD, so I made the script capable of handling custom environments. TBR=kjellander@webrtc.org BUG=1796 Review URL: https://webrtc-codereview.appspot.com/1916004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4441 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/test/buildbot_tests.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/webrtc/test/buildbot_tests.py b/webrtc/test/buildbot_tests.py index 9cd63c9567..280bb533c9 100755 --- a/webrtc/test/buildbot_tests.py +++ b/webrtc/test/buildbot_tests.py @@ -64,8 +64,14 @@ _LINUX_TESTS = { 'isac_fixed_perf': ['iSACFixtest', '32000', '../../resources/speech_and_misc_wb.pcm', 'isac_speech_and_misc_wb.pcm'], + 'libjingle_peerconnection_java_unittest': [ + 'libjingle_peerconnection_java_unittest'], } +_CUSTOM_ENV = { + 'libjingle_peerconnection_java_unittest': + {'LD_PRELOAD': '/usr/lib/x86_64-linux-gnu/libpulse.so.0'}, +} def main(): parser = optparse.OptionParser('usage: %prog -t [-t ...]\n' @@ -108,6 +114,9 @@ def main(): print 'Running WebRTC Buildbot tests: %s' % options.test for test in options.test: cmd_line = test_dict[test] + env = os.environ.copy() + if test in _CUSTOM_ENV: + env.update(_CUSTOM_ENV[test]) # Create absolute paths to test executables for non-Python tests. if cmd_line[0] != 'python': @@ -115,7 +124,7 @@ def main(): print 'Running: %s' % ' '.join(cmd_line) try: - subprocess.check_call(cmd_line) + subprocess.check_call(cmd_line, env=env) except subprocess.CalledProcessError as e: print >> sys.stderr, ('An error occurred during test execution: return ' 'code: %d' % e.returncode)