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/webrtc@4441 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/test/buildbot_tests.py b/test/buildbot_tests.py
index 9cd63c9..280bb53 100755
--- a/test/buildbot_tests.py
+++ b/test/buildbot_tests.py
@@ -64,8 +64,14 @@
     '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 <test> [-t <test> ...]\n'
@@ -108,6 +114,9 @@
   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 @@
 
     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)