- Moved methods where they should be.
- Removed unnecessary arguments. - Added comments. BUG= TEST= Review URL: https://webrtc-codereview.appspot.com/389008 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1693 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -29,20 +29,20 @@ c = BuildmasterConfig = {}
|
||||
|
||||
from buildbot.buildslave import BuildSlave
|
||||
|
||||
c['slaves'] = [BuildSlave("android", "pass", max_builds=1),
|
||||
BuildSlave("chromeos", "pass", max_builds=1),
|
||||
BuildSlave("linux-clang", "pass", max_builds=1),
|
||||
BuildSlave("linux-slave-1", "pass", max_builds=1),
|
||||
BuildSlave("linux-slave-2", "pass", max_builds=1),
|
||||
BuildSlave("linux-slave-4", "pass", max_builds=1),
|
||||
BuildSlave("linux-slave-5", "pass", max_builds=1),
|
||||
BuildSlave("linux-slave-gcc-4.6", "pass", max_builds=1),
|
||||
BuildSlave("linux-valgrind", "pass", max_builds=1),
|
||||
BuildSlave("linux_video", "pass", max_builds=1),
|
||||
BuildSlave("mac-slave-3", "pass", max_builds=1),
|
||||
BuildSlave("mac-slave-2", "pass", max_builds=1),
|
||||
BuildSlave("win-slave", "pass", max_builds=1),
|
||||
BuildSlave("win-slave32", "pass", max_builds=1)]
|
||||
c['slaves'] = [BuildSlave('android', 'pass', max_builds=1),
|
||||
BuildSlave('chromeos', 'pass', max_builds=1),
|
||||
BuildSlave('linux-clang', 'pass', max_builds=1),
|
||||
BuildSlave('linux-slave-1', 'pass', max_builds=1),
|
||||
BuildSlave('linux-slave-2', 'pass', max_builds=1),
|
||||
BuildSlave('linux-slave-4', 'pass', max_builds=1),
|
||||
BuildSlave('linux-slave-5', 'pass', max_builds=1),
|
||||
BuildSlave('linux-slave-gcc-4.6', 'pass', max_builds=1),
|
||||
BuildSlave('linux-valgrind', 'pass', max_builds=1),
|
||||
BuildSlave('linux_video', 'pass', max_builds=1),
|
||||
BuildSlave('mac-slave-3', 'pass', max_builds=1),
|
||||
BuildSlave('mac-slave-2', 'pass', max_builds=1),
|
||||
BuildSlave('win-slave', 'pass', max_builds=1),
|
||||
BuildSlave('win-slave32', 'pass', max_builds=1)]
|
||||
|
||||
# 'slavePortnum' defines the TCP port to listen on. This must match the value
|
||||
# configured into the buildslaves (with their --master option)
|
||||
@@ -68,21 +68,21 @@ c['change_source'] = svn_poller
|
||||
## configure the Schedulers
|
||||
|
||||
from buildbot.scheduler import Scheduler
|
||||
webrtc_scheduler = Scheduler(name="all", branch=None, treeStableTimer=5*60,
|
||||
builderNames=["Win32Debug",
|
||||
"Win32Release",
|
||||
"MacOS32DBG",
|
||||
"MacOS32Release",
|
||||
"Linux32DBG",
|
||||
"Linux32Release",
|
||||
"Linux64DBG",
|
||||
"Linux64Release",
|
||||
"LinuxClang",
|
||||
"LinuxValgrind",
|
||||
"Linux64DBG-GCC4.6",
|
||||
"LinuxVideoTest",
|
||||
"Android",
|
||||
"ChromeOS"
|
||||
webrtc_scheduler = Scheduler(name='all', branch=None, treeStableTimer=5*60,
|
||||
builderNames=['Win32Debug',
|
||||
'Win32Release',
|
||||
'MacOS32DBG',
|
||||
'MacOS32Release',
|
||||
'Linux32DBG',
|
||||
'Linux32Release',
|
||||
'Linux64DBG',
|
||||
'Linux64Release',
|
||||
'LinuxClang',
|
||||
'LinuxValgrind',
|
||||
'Linux64DBG-GCC4.6',
|
||||
'LinuxVideoTest',
|
||||
'Android',
|
||||
'ChromeOS'
|
||||
])
|
||||
c['schedulers'] = [webrtc_scheduler]
|
||||
|
||||
@@ -116,60 +116,60 @@ from webrtc_buildbot import utils
|
||||
# enabled on Linux, Mac and/or Windows (in that order; defined in utils.py).
|
||||
NORMAL_TESTS = {
|
||||
# Test name Linux Mac Windows
|
||||
"audio_coding_module_test": (True, True, True),
|
||||
"audio_coding_unittests": (True, True, True),
|
||||
"audio_conference_mixer_unittests":(True, True, True),
|
||||
"audio_device_test_api": (True, False, False), # Issue 257
|
||||
"audioproc_unittest": (True, True, True),
|
||||
"cng_unittests": (True, True, True),
|
||||
"g711_unittests": (True, True, True),
|
||||
"g722_unittests": (True, True, True),
|
||||
"libyuv_unittests": (True, True, True),
|
||||
"jpeg_unittests": (True, True, True),
|
||||
"media_file_unittests": (True, True, True),
|
||||
"neteq_unittests": (True, True, True),
|
||||
"pcm16b_unittests": (True, True, True),
|
||||
"resampler_unittests": (True, True, True),
|
||||
"rtp_rtcp_unittests": (True, True, True),
|
||||
"signal_processing_unittests": (True, True, True),
|
||||
"system_wrappers_unittests": (True, True, True),
|
||||
"test_bwe": (True, True, True),
|
||||
"test_fec": (True, True, True),
|
||||
"test_support_unittests": (True, True, True),
|
||||
"udp_transport_unittests": (True, True, True),
|
||||
"vad_unittests": (True, True, True),
|
||||
"video_codecs_test_framework_integrationtests": (True, True, True),
|
||||
"video_codecs_test_framework_unittests": (True, True, True),
|
||||
"video_coding_unittests": (True, True, True),
|
||||
"video_engine_core_unittests": (True, True, True),
|
||||
"video_processing_unittests": (True, True, True),
|
||||
"voice_engine_unittests": (True, True, True),
|
||||
"vp8_unittests": (True, False, True), # Issue 273.
|
||||
"webrtc_utility_unittests": (True, True, False),
|
||||
'audio_coding_module_test': (True, True, True),
|
||||
'audio_coding_unittests': (True, True, True),
|
||||
'audio_conference_mixer_unittests':(True, True, True),
|
||||
'audio_device_test_api': (True, False, False), # Issue 257
|
||||
'audioproc_unittest': (True, True, True),
|
||||
'cng_unittests': (True, True, True),
|
||||
'g711_unittests': (True, True, True),
|
||||
'g722_unittests': (True, True, True),
|
||||
'libyuv_unittests': (True, True, True),
|
||||
'jpeg_unittests': (True, True, True),
|
||||
'media_file_unittests': (True, True, True),
|
||||
'neteq_unittests': (True, True, True),
|
||||
'pcm16b_unittests': (True, True, True),
|
||||
'resampler_unittests': (True, True, True),
|
||||
'rtp_rtcp_unittests': (True, True, True),
|
||||
'signal_processing_unittests': (True, True, True),
|
||||
'system_wrappers_unittests': (True, True, True),
|
||||
'test_bwe': (True, True, True),
|
||||
'test_fec': (True, True, True),
|
||||
'test_support_unittests': (True, True, True),
|
||||
'udp_transport_unittests': (True, True, True),
|
||||
'vad_unittests': (True, True, True),
|
||||
'video_codecs_test_framework_integrationtests': (True, True, True),
|
||||
'video_codecs_test_framework_unittests': (True, True, True),
|
||||
'video_coding_unittests': (True, True, True),
|
||||
'video_engine_core_unittests': (True, True, True),
|
||||
'video_processing_unittests': (True, True, True),
|
||||
'voice_engine_unittests': (True, True, True),
|
||||
'vp8_unittests': (True, False, True), # Issue 273.
|
||||
'webrtc_utility_unittests': (True, True, False),
|
||||
}
|
||||
|
||||
PHYSICAL_MACHINE_TESTS = {
|
||||
# Test name Linux Mac Windows
|
||||
"video_render_module_test": (True, False, False),
|
||||
"vie_auto_test": (True, False, False),
|
||||
"voe_auto_test": (True, False, False),
|
||||
'video_render_module_test': (True, False, False),
|
||||
'vie_auto_test': (True, False, False),
|
||||
'voe_auto_test': (True, False, False),
|
||||
}
|
||||
|
||||
VALGRIND_DISABLED_TESTS = [
|
||||
"audio_coding_module_test", # Issue 270
|
||||
"test_fec", # Too slow for Valgrind
|
||||
'audio_coding_module_test', # Issue 270
|
||||
'test_fec', # Too slow for Valgrind
|
||||
]
|
||||
|
||||
linux_normal_tests = utils.GetEnabledTests(NORMAL_TESTS, "Linux")
|
||||
mac_normal_tests = utils.GetEnabledTests(NORMAL_TESTS, "Mac")
|
||||
windows_normal_tests = utils.GetEnabledTests(NORMAL_TESTS, "Windows")
|
||||
linux_normal_tests = utils.GetEnabledTests(NORMAL_TESTS, 'Linux')
|
||||
mac_normal_tests = utils.GetEnabledTests(NORMAL_TESTS, 'Mac')
|
||||
windows_normal_tests = utils.GetEnabledTests(NORMAL_TESTS, 'Windows')
|
||||
|
||||
linux_physical_machine_tests = utils.GetEnabledTests(PHYSICAL_MACHINE_TESTS,
|
||||
"Linux")
|
||||
'Linux')
|
||||
mac_physical_machine_tests = utils.GetEnabledTests(PHYSICAL_MACHINE_TESTS,
|
||||
"Mac")
|
||||
'Mac')
|
||||
windows_physical_machine_tests = utils.GetEnabledTests(PHYSICAL_MACHINE_TESTS,
|
||||
"Windows")
|
||||
'Windows')
|
||||
|
||||
############# Linux Builders #######################################
|
||||
linux_factory_64_dbg = utils.WebRTCLinuxFactory()
|
||||
@@ -188,15 +188,15 @@ linux_factory_64_release = utils.WebRTCLinuxFactory()
|
||||
linux_factory_64_release.EnableBuild(release=True)
|
||||
linux_factory_64_release.EnableTests(linux_normal_tests)
|
||||
|
||||
linux_factory_32_dbg = utils.WebRTCLinuxFactory(
|
||||
enable_coverage=True,
|
||||
coverage_url="http://webrtc-cb-linux-slave-4.cbf.corp.google.com/")
|
||||
linux_factory_32_dbg = utils.WebRTCLinuxFactory()
|
||||
linux_factory_32_dbg.EnableCoverage(
|
||||
coverage_url='http://webrtc-cb-linux-slave-4.cbf.corp.google.com/')
|
||||
linux_factory_32_dbg.EnableBuild(build32=True)
|
||||
linux_factory_32_dbg.EnableTests(linux_normal_tests)
|
||||
|
||||
linux_factory_video = utils.WebRTCLinuxFactory(
|
||||
enable_coverage=True,
|
||||
coverage_url="http://webrtc-build-bot-se.lul/")
|
||||
linux_factory_video = utils.WebRTCLinuxFactory()
|
||||
linux_factory_video.EnableCoverage(
|
||||
coverage_url='http://webrtc-build-bot-se.lul/')
|
||||
linux_factory_video.EnableBuild()
|
||||
linux_factory_video.EnableTests(linux_physical_machine_tests)
|
||||
|
||||
@@ -208,7 +208,7 @@ linux_clang = utils.WebRTCLinuxFactory()
|
||||
linux_clang.EnableBuild(clang=True)
|
||||
linux_clang.EnableTests(linux_normal_tests)
|
||||
|
||||
linux_valgrind = utils.WebRTCLinuxFactory(enable_valgrind=True)
|
||||
linux_valgrind = utils.WebRTCLinuxFactory(valgrind_enabled=True)
|
||||
linux_valgrind.EnableBuild(release=True)
|
||||
# Filter out disabled Valgrind tests:
|
||||
valgrind_tests = filter(lambda test: test not in VALGRIND_DISABLED_TESTS,
|
||||
@@ -217,107 +217,107 @@ linux_valgrind.EnableTests(valgrind_tests)
|
||||
|
||||
############## Mac Builders #######################################
|
||||
mac_factory_32_dbg = utils.WebRTCMacFactory()
|
||||
mac_factory_32_dbg.EnableBuild(build_type="both")
|
||||
mac_factory_32_dbg.EnableBuild(build_type='both')
|
||||
mac_factory_32_dbg.EnableTests(mac_normal_tests)
|
||||
|
||||
mac_factory_32_release = utils.WebRTCMacFactory()
|
||||
mac_factory_32_release.EnableBuild(build_type="both", release=True)
|
||||
mac_factory_32_release.EnableBuild(build_type='both', release=True)
|
||||
mac_factory_32_release.EnableTests(mac_normal_tests)
|
||||
|
||||
############# Windows Builders #######################################
|
||||
win_factory_32_Debug = utils.WebRTCWinFactory()
|
||||
win_factory_32_Debug.EnableBuild(configuration="Debug")
|
||||
win_factory_32_Debug.EnableBuild(configuration='Debug')
|
||||
win_factory_32_Debug.EnableTests(windows_normal_tests)
|
||||
|
||||
win_factory_32_Release = utils.WebRTCWinFactory()
|
||||
win_factory_32_Release.EnableBuild(configuration="Release")
|
||||
win_factory_32_Release.EnableBuild(configuration='Release')
|
||||
win_factory_32_Release.EnableTests(windows_normal_tests)
|
||||
|
||||
android_factory = utils.WebRTCAndroidFactory()
|
||||
android_factory.EnableBuild(product="toro")
|
||||
android_factory.EnableBuild(product='toro')
|
||||
|
||||
linux_builder_64_debug = {
|
||||
'name': "Linux64DBG",
|
||||
'slavename': "linux-slave-1",
|
||||
'builddir': "linux-slave-1",
|
||||
'name': 'Linux64DBG',
|
||||
'slavename': 'linux-slave-1',
|
||||
'builddir': 'linux-slave-1',
|
||||
'factory': linux_factory_64_dbg,
|
||||
}
|
||||
linux_builder_32_release = {
|
||||
'name': "Linux32Release",
|
||||
'slavename': "linux-slave-2",
|
||||
'builddir': "linux-slave-2",
|
||||
'name': 'Linux32Release',
|
||||
'slavename': 'linux-slave-2',
|
||||
'builddir': 'linux-slave-2',
|
||||
'factory': linux_factory_32_release,
|
||||
}
|
||||
linux_builder_64_release = {
|
||||
'name': "Linux64Release",
|
||||
'slavename': "linux-slave-5",
|
||||
'builddir': "linux-slave-5",
|
||||
'name': 'Linux64Release',
|
||||
'slavename': 'linux-slave-5',
|
||||
'builddir': 'linux-slave-5',
|
||||
'factory': linux_factory_64_release,
|
||||
}
|
||||
linux_builder_32_debug = {
|
||||
'name': "Linux32DBG",
|
||||
'slavename': "linux-slave-4",
|
||||
'builddir': "linux-slave-4",
|
||||
'name': 'Linux32DBG',
|
||||
'slavename': 'linux-slave-4',
|
||||
'builddir': 'linux-slave-4',
|
||||
'factory': linux_factory_32_dbg,
|
||||
}
|
||||
mac_builder_32_debug = {
|
||||
'name': "MacOS32DBG",
|
||||
'slavename': "mac-slave-3",
|
||||
'builddir': "mac-slave-3",
|
||||
'name': 'MacOS32DBG',
|
||||
'slavename': 'mac-slave-3',
|
||||
'builddir': 'mac-slave-3',
|
||||
'factory': mac_factory_32_dbg,
|
||||
}
|
||||
mac_builder_32_release = {
|
||||
'name': "MacOS32Release",
|
||||
'slavename': "mac-slave-2",
|
||||
'builddir': "mac-slave-2",
|
||||
'name': 'MacOS32Release',
|
||||
'slavename': 'mac-slave-2',
|
||||
'builddir': 'mac-slave-2',
|
||||
'factory': mac_factory_32_release,
|
||||
}
|
||||
chromeos_builder = {
|
||||
'name': "ChromeOS",
|
||||
'slavename': "chromeos",
|
||||
'builddir': "chromeos",
|
||||
'name': 'ChromeOS',
|
||||
'slavename': 'chromeos',
|
||||
'builddir': 'chromeos',
|
||||
'factory': chromeos_factory,
|
||||
}
|
||||
win_builder_32_debug = {
|
||||
'name': "Win32Debug",
|
||||
'slavename': "win-slave",
|
||||
'builddir': "win-32-dbg",
|
||||
'name': 'Win32Debug',
|
||||
'slavename': 'win-slave',
|
||||
'builddir': 'win-32-dbg',
|
||||
'factory': win_factory_32_Debug,
|
||||
}
|
||||
win_builder_32_release = {
|
||||
'name': "Win32Release",
|
||||
'slavename': "win-slave32",
|
||||
'builddir': "win-32-release",
|
||||
'name': 'Win32Release',
|
||||
'slavename': 'win-slave32',
|
||||
'builddir': 'win-32-release',
|
||||
'factory': win_factory_32_Release,
|
||||
}
|
||||
linux_builder_video = {
|
||||
'name': "LinuxVideoTest",
|
||||
'slavename': "linux_video",
|
||||
'builddir': "video",
|
||||
'name': 'LinuxVideoTest',
|
||||
'slavename': 'linux_video',
|
||||
'builddir': 'video',
|
||||
'factory': linux_factory_video,
|
||||
}
|
||||
linux_builder_clang = {
|
||||
'name': "LinuxClang",
|
||||
'slavename': "linux-clang",
|
||||
'builddir': "linux-clang",
|
||||
'name': 'LinuxClang',
|
||||
'slavename': 'linux-clang',
|
||||
'builddir': 'linux-clang',
|
||||
'factory': linux_clang,
|
||||
}
|
||||
linux_builder_valgrind = {
|
||||
'name': "LinuxValgrind",
|
||||
'slavename': "linux-valgrind",
|
||||
'builddir': "linux-valgrind",
|
||||
'name': 'LinuxValgrind',
|
||||
'slavename': 'linux-valgrind',
|
||||
'builddir': 'linux-valgrind',
|
||||
'factory': linux_valgrind,
|
||||
}
|
||||
android_builder_1 = {
|
||||
'name': "Android",
|
||||
'slavename': "android",
|
||||
'builddir': "android",
|
||||
'name': 'Android',
|
||||
'slavename': 'android',
|
||||
'builddir': 'android',
|
||||
'factory': android_factory,
|
||||
}
|
||||
linux_builder_gcc_4_6 = {
|
||||
'name': "Linux64DBG-GCC4.6",
|
||||
'slavename': "linux-slave-gcc-4.6",
|
||||
'builddir': "linux-slave-gcc-4.6",
|
||||
'name': 'Linux64DBG-GCC4.6',
|
||||
'slavename': 'linux-slave-gcc-4.6',
|
||||
'builddir': 'linux-slave-gcc-4.6',
|
||||
'factory': linux_factory_64_dbg_no_coverage,
|
||||
}
|
||||
c['builders'] = [
|
||||
@@ -348,8 +348,8 @@ from buildbot.status import mail
|
||||
|
||||
web_page = html.WebStatus(http_port=8010, allowForce=True)
|
||||
email_notification = mail.MailNotifier(
|
||||
fromaddr="webrtc-cb-watchlist@google.com",
|
||||
extraRecipients=["webrtc-cb-watchlist@google.com"],
|
||||
fromaddr='webrtc-cb-watchlist@google.com',
|
||||
extraRecipients=['webrtc-cb-watchlist@google.com'],
|
||||
sendToInterestedUsers=True,
|
||||
mode='failing')
|
||||
c['status'] = [web_page, email_notification]
|
||||
@@ -363,15 +363,15 @@ c['status'] = [web_page, email_notification]
|
||||
# before you have a functioning 'sources' set up). The debug tool uses the
|
||||
# same port number as the slaves do: 'slavePortnum'.
|
||||
|
||||
#c['debugPassword'] = "debugpassword"
|
||||
#c['debugPassword'] = 'debugpassword'
|
||||
|
||||
# if you set 'manhole', you can ssh into the buildmaster and get an
|
||||
# interactive python shell, which may be useful for debugging buildbot
|
||||
# internals. It is probably only useful for buildbot developers. You can also
|
||||
# use an authorized_keys file, or plain telnet.
|
||||
#from buildbot import manhole
|
||||
#c['manhole'] = manhole.PasswordManhole("tcp:9999:interface=127.0.0.1",
|
||||
# "admin", "password")
|
||||
#c['manhole'] = manhole.PasswordManhole('tcp:9999:interface=127.0.0.1',
|
||||
# 'admin', 'password')
|
||||
|
||||
|
||||
####### PROJECT IDENTITY
|
||||
@@ -381,8 +381,8 @@ c['status'] = [web_page, email_notification]
|
||||
# waterfall HTML page. The 'projectURL' string will be used to provide a link
|
||||
# from buildbot HTML pages to your project's home page.
|
||||
|
||||
c['projectName'] = "WebRTC"
|
||||
c['projectURL'] = "http://www.webrtc.org"
|
||||
c['projectName'] = 'WebRTC'
|
||||
c['projectURL'] = 'http://www.webrtc.org'
|
||||
|
||||
# the 'buildbotURL' string should point to the location where the buildbot's
|
||||
# internal web server (usually the html.Waterfall page) is visible. This
|
||||
@@ -390,4 +390,4 @@ c['projectURL'] = "http://www.webrtc.org"
|
||||
# with an externally-visible host name which the buildbot cannot figure out
|
||||
# without some help.
|
||||
|
||||
c['buildbotURL'] = "http://webrtc-cb-linux-master.cbf.corp.google.com:8010/"
|
||||
c['buildbotURL'] = 'http://webrtc-cb-linux-master.cbf.corp.google.com:8010/'
|
||||
|
@@ -16,18 +16,18 @@ from buildbot.process import properties
|
||||
from buildbot.process.properties import WithProperties
|
||||
import os
|
||||
import sys
|
||||
import urlparse
|
||||
|
||||
# Defines the order of the booleans of the supported platforms in the test
|
||||
# dictionaries in master.cfg.
|
||||
SUPPORTED_PLATFORMS = ("Linux", "Mac", "Windows")
|
||||
SUPPORTED_PLATFORMS = ('Linux', 'Mac', 'Windows')
|
||||
|
||||
SVN_LOCATION = "http://webrtc.googlecode.com/svn/trunk"
|
||||
VALGRIND_CMD = ["tools/valgrind-webrtc/webrtc_tests.sh", "-t", "cmdline"]
|
||||
SVN_LOCATION = 'http://webrtc.googlecode.com/svn/trunk'
|
||||
VALGRIND_CMD = ['tools/valgrind-webrtc/webrtc_tests.sh', '-t', 'cmdline']
|
||||
|
||||
DEFAULT_COVERAGE_DIR = "/var/www"
|
||||
DEFAULT_COVERAGE_DIR = '/var/www/'
|
||||
|
||||
# Copied from Chromium's
|
||||
# trunk/tools/build/scripts/master/factory/chromium_factory.py
|
||||
# Copied from trunk/tools/build/scripts/master/factory/chromium_factory.py
|
||||
# but converted to a list since we set defines instead of using an environment
|
||||
# variable.
|
||||
#
|
||||
@@ -58,249 +58,310 @@ MEMORY_TOOLS_GYP_DEFINES = [
|
||||
]
|
||||
|
||||
class WebRTCFactory(factory.BuildFactory):
|
||||
"""A Build Factory affected by properties."""
|
||||
"""Abstract superclass for all build factories.
|
||||
|
||||
A build factory defines a sequence of steps to take in a build process.
|
||||
This class provides some helper methods and some abstract methods that
|
||||
can be overridden to create customized build sequences.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
factory.BuildFactory.__init__(self)
|
||||
|
||||
def __init__(self, build_factory_properties=None, steps=None,
|
||||
enable_coverage=False, enable_valgrind=False,
|
||||
account='webrtc-cb', coverage_url=None,
|
||||
coverage_dir=DEFAULT_COVERAGE_DIR):
|
||||
factory.BuildFactory.__init__(self, steps)
|
||||
self.properties = properties.Properties()
|
||||
self.enable_build = False
|
||||
self.build_enabled = False
|
||||
self.force_sync = False
|
||||
self.enable_coverage = enable_coverage
|
||||
self.enable_valgrind = enable_valgrind
|
||||
self.gyp_params = []
|
||||
self.release = False
|
||||
self.coverage_url = coverage_url
|
||||
self.coverage_dir = coverage_dir
|
||||
|
||||
def EnableBuild(self, force_sync):
|
||||
"""Build the binary [must be overridden]."""
|
||||
pass
|
||||
"""Adds steps for building WebRTC [must be overridden].
|
||||
|
||||
def AddCommonTestSteps(self, test):
|
||||
"""Add common steps for test.
|
||||
Implementations of this method must add clean and build steps so that
|
||||
when all steps have been run, we have an up-to-date, complete and correct
|
||||
build of WebRTC for the platform. It is up to the method how to do this.
|
||||
|
||||
test: test to be run.
|
||||
Args:
|
||||
force_sync: the method must pass --force to 'gclient sync' if it is
|
||||
used.
|
||||
"""
|
||||
self.AddCommonMakeStep(test)
|
||||
self.AddCommonTestRunStep(test)
|
||||
|
||||
def AddCommonStep(self, cmd, descriptor="", workdir="build",
|
||||
warnOnFailure=False,):
|
||||
"""Define common step."""
|
||||
if type(descriptor) is str:
|
||||
descriptor = [descriptor]
|
||||
warn = warnOnFailure
|
||||
flunkOnFailure = not warn
|
||||
self.addStep(shell.ShellCommand(command=cmd, workdir=workdir,
|
||||
description=descriptor + ["running..."],
|
||||
descriptionDone=descriptor + ["done..."],
|
||||
warnOnFailure=warn,
|
||||
flunkOnFailure=flunkOnFailure,
|
||||
name="".join(descriptor)))
|
||||
|
||||
def AddCommonTestRunStep(self):
|
||||
"""Define common test run step [must be overridden]."""
|
||||
pass
|
||||
|
||||
def AddCommonMakeStep(self):
|
||||
"""Define common make step [must be overridden]."""
|
||||
pass
|
||||
|
||||
def AddCommonGYPStep(self, gyp_file, gyp_params=[], descriptor="gyp"):
|
||||
cmd = ["./build/gyp_chromium", "--depth=.", gyp_file]
|
||||
cmd += gyp_params + self.gyp_params
|
||||
self.addStep(shell.ShellCommand(command=cmd, workdir="build/trunk",
|
||||
description=[descriptor, "running..."],
|
||||
descriptionDone=[descriptor, "done..."],
|
||||
name="gyp_%s" % descriptor))
|
||||
|
||||
def EnableTest(self, test):
|
||||
"""Enable Test to be run. May be overridden.
|
||||
|
||||
Override to handle special cases for specific platforms.
|
||||
|
||||
test: test to be run.
|
||||
"""
|
||||
self.AddCommonTestRunStep(test)
|
||||
|
||||
def EnableTests(self, tests):
|
||||
"""Enable Test to be run.
|
||||
"""Adds test run steps for all tests in the list.
|
||||
|
||||
tests: list of test to be run.
|
||||
This method must be run after enabling the build.
|
||||
|
||||
Args:
|
||||
tests: list of test to be run.
|
||||
"""
|
||||
if self.enable_coverage:
|
||||
self.EnableBaseCoverage()
|
||||
for test in tests:
|
||||
self.EnableTest(test)
|
||||
if self.enable_coverage:
|
||||
self.EnableCoverage()
|
||||
|
||||
def EnableBaseCoverage(self):
|
||||
"""Enable base coverage data [must be overridden]."""
|
||||
def AddCommonStep(self, cmd, descriptor='', workdir='build',
|
||||
warn_on_failure=False,):
|
||||
"""Adds a common step which will run as a shell command on the slave.
|
||||
|
||||
A common step can be anything except a test execution step.
|
||||
|
||||
Args:
|
||||
cmd: The command to run. This command follows the contract for
|
||||
ShellCommand, so see that documentation for more details.
|
||||
descriptor: A string, or a list of strings, describing what the step
|
||||
does. The descriptor gets printed in the waterfall display.
|
||||
workdir: The working directory to run the command in.
|
||||
warnOnFailure: Enable if you want a warning on failure instead of
|
||||
an error. Enable for less critical commands.
|
||||
"""
|
||||
if type(descriptor) is str:
|
||||
descriptor = [descriptor]
|
||||
|
||||
flunk_on_failure = not warn_on_failure
|
||||
self.addStep(shell.ShellCommand(command=cmd, workdir=workdir,
|
||||
description=descriptor + ['running...'],
|
||||
descriptionDone=descriptor + ['done...'],
|
||||
warnOnFailure=warn_on_failure,
|
||||
flunkOnFailure=flunk_on_failure,
|
||||
name=''.join(descriptor)))
|
||||
|
||||
def AddCommonTestRunStep(self, test, descriptor='', cmd=None,
|
||||
workdir='build/trunk'):
|
||||
"""Adds a step for running a single test [must be overridden].
|
||||
|
||||
Args:
|
||||
test: The test binary name. The step will attempt to execute this
|
||||
binary in the binary output folder, except if the cmd argument is
|
||||
defined (in that case, we will run cmd instead and just use the
|
||||
test name in the descriptor).
|
||||
descriptor: This should either be a string or a list of strings. The
|
||||
descriptor or descriptors are appended to the test name and
|
||||
displayed in the waterfall.
|
||||
cmd: If necessary, you can specify this argument to override the
|
||||
default behavior, which is to just run the binary specified in
|
||||
test without arguments.
|
||||
workdir: The base working directory to run the command in. This
|
||||
directory will map to the WebRTC project root, e.g. the trunk
|
||||
directory. This method will make sure that the test binary is run
|
||||
in the correct output directory for the platform.
|
||||
"""
|
||||
pass
|
||||
|
||||
def EnableCoverage(self):
|
||||
"""Enable coverage data [must be overridden]."""
|
||||
pass
|
||||
def EnableTest(self, test):
|
||||
"""Makes a test run in the build sequence. May be overridden.
|
||||
|
||||
Override to handle special cases for specific platforms, for instance if
|
||||
a particular test binary requires command line arguments.
|
||||
|
||||
Args:
|
||||
test: The test name to enable.
|
||||
"""
|
||||
self.AddCommonTestRunStep(test)
|
||||
|
||||
def AddCommonGYPStep(self, gyp_file, gyp_params=[], descriptor='gyp'):
|
||||
"""Helper method for invoking GYP on WebRTC.
|
||||
|
||||
GYP will generate makefiles or its equivalent in a platform-specific
|
||||
manner.
|
||||
|
||||
Args:
|
||||
gyp_file: The root GYP file to use.
|
||||
gyp_params: Custom GYP parameters (same semantics as the GYP_PARAMS
|
||||
environment variable).
|
||||
descriptor: The descriptor to use for the step.
|
||||
"""
|
||||
cmd = ['./build/gyp_chromium', '--depth=.', gyp_file]
|
||||
cmd += gyp_params + self.gyp_params
|
||||
self.addStep(shell.ShellCommand(command=cmd, workdir='build/trunk',
|
||||
description=[descriptor, 'running...'],
|
||||
descriptionDone=[descriptor, 'done...'],
|
||||
name='gyp_%s' % descriptor))
|
||||
|
||||
class GenerateCodeCoverage(ShellCommand):
|
||||
warnOnFailure = True
|
||||
"""This custom shell command generates coverage HTML using genhtml.
|
||||
|
||||
The command will dump the HTML output into coverage_dir, in a directory
|
||||
whose name is generated from the build number and slave name. We will
|
||||
expect that the coverage directory is the web server root (i.e. public html
|
||||
root) corresponding to the web server URL. That is, if we write Foo to
|
||||
the coverage directory we expect that directory to be reachable from
|
||||
url/Foo.
|
||||
"""
|
||||
|
||||
def __init__(self, coverage_url, coverage_dir, coverage_file, **kwargs):
|
||||
"""Prepares the coverage command.
|
||||
|
||||
Args:
|
||||
coverage_url: The base URL for the serving web server we will use
|
||||
when we generate the link to the coverage. This will generally
|
||||
be the slave's URL (something like http://slave-hostname/).
|
||||
coverage_dir: Where to write coverage HTML.
|
||||
coverage_file: The LCOV file to generate the coverage from.
|
||||
"""
|
||||
|
||||
def __init__(self, coverage_url=None, coverage_dir=None, **kwargs):
|
||||
if coverage_url is None or coverage_dir is None:
|
||||
raise TypeError("coverage location required")
|
||||
ShellCommand.__init__(self, **kwargs)
|
||||
self.addFactoryArguments(coverage_url=coverage_url,
|
||||
coverage_dir=coverage_dir)
|
||||
coverage_dir=coverage_dir,
|
||||
coverage_file=coverage_file)
|
||||
self.setDefaultWorkdir("build/trunk")
|
||||
self.coverage_url = coverage_url
|
||||
self.coverage_dir = coverage_dir
|
||||
self.coverage_file = coverage_file
|
||||
self.description = ["Coverage Report"]
|
||||
self.setCommand(["./tools/continuous_build/generate_coverage_html.sh",
|
||||
"final.info",
|
||||
WithProperties(coverage_dir + "/%(buildername)s_%(buildnumber)s")])
|
||||
output_dir = os.path.join(coverage_dir,
|
||||
'%(buildername)s_%(buildnumber)s')
|
||||
self.setCommand(['./tools/continuous_build/generate_coverage_html.sh',
|
||||
coverage_file, WithProperties(output_dir)])
|
||||
|
||||
def createSummary(self, log):
|
||||
coverage_url = "%s/%s_%s" % (self.coverage_url,
|
||||
self.getProperty("buildername"), self.getProperty("buildnumber"))
|
||||
self.addURL("coverage", coverage_url)
|
||||
coverage_url = urlparse.urljoin(self.coverage_url,
|
||||
'%s_%s' % (self.getProperty('buildername'),
|
||||
self.getProperty('buildnumber')))
|
||||
self.addURL('click here', coverage_url)
|
||||
|
||||
def start(self):
|
||||
ShellCommand.start(self)
|
||||
|
||||
################################################################################
|
||||
|
||||
class WebRTCAndroidFactory(WebRTCFactory):
|
||||
"""A Build Factory affected by properties."""
|
||||
"""Sets up the Android build."""
|
||||
|
||||
def __init__(self, build_factory_properties=None, steps=None,
|
||||
enable_coverage=False, account=None):
|
||||
WebRTCFactory.__init__(self, build_factory_properties, steps,
|
||||
enable_coverage, account)
|
||||
def __init__(self):
|
||||
WebRTCFactory.__init__(self)
|
||||
|
||||
def EnableBuild(self, product="toro"):
|
||||
prefix = "rm -rf out/target/product/%s/obj/" % product
|
||||
def EnableBuild(self, product='toro'):
|
||||
prefix = 'rm -rf out/target/product/%s/obj/' % product
|
||||
cleanup_list = [
|
||||
"rm -rf external/webrtc",
|
||||
prefix + "STATIC_LIBRARIES/libwebrtc_*",
|
||||
prefix + "SHARE_LIBRARIES/libwebrtc_*",
|
||||
prefix + "EXECUTABLES/webrtc_*"
|
||||
'rm -rf external/webrtc',
|
||||
prefix + 'STATIC_LIBRARIES/libwebrtc_*',
|
||||
prefix + 'SHARE_LIBRARIES/libwebrtc_*',
|
||||
prefix + 'EXECUTABLES/webrtc_*'
|
||||
]
|
||||
cmd = " ; ".join(cleanup_list)
|
||||
self.addStep(shell.Compile(command=(cmd), workdir="build/trunk",
|
||||
description=["cleanup", "running..."], haltOnFailure=False,
|
||||
warnOnFailure=True, flunkOnFailure=False,
|
||||
descriptionDone=["cleanup", "done..."], name="cleanup"))
|
||||
cmd = "svn checkout %s external/webrtc" % SVN_LOCATION
|
||||
cmd = ' ; '.join(cleanup_list)
|
||||
self.addStep(shell.Compile(command=(cmd), workdir='build/trunk',
|
||||
description=['cleanup', 'running...'], haltOnFailure=False,
|
||||
warn_on_failure=True, flunkOnFailure=False,
|
||||
descriptionDone=['cleanup', 'done...'], name='cleanup'))
|
||||
cmd = 'svn checkout %s external/webrtc' % SVN_LOCATION
|
||||
self.addStep(shell.Compile(command=(cmd),
|
||||
workdir="build/trunk", description=["svn", "running..."],
|
||||
haltOnFailure=False, descriptionDone=["svn", "done..."], name="svn"))
|
||||
cmd = ("source build/envsetup.sh && lunch full_%s-eng "
|
||||
"&& mmm external/webrtc showcommands" % product)
|
||||
workdir='build/trunk', description=['svn', 'running...'],
|
||||
haltOnFailure=False, descriptionDone=['svn', 'done...'], name='svn'))
|
||||
cmd = ('source build/envsetup.sh && lunch full_%s-eng '
|
||||
'&& mmm external/webrtc showcommands' % product)
|
||||
self.addStep(shell.Compile(command=(cmd),
|
||||
workdir="build/trunk", description=["build", "running..."],
|
||||
workdir='build/trunk', description=['build', 'running...'],
|
||||
haltOnFailure=False,
|
||||
descriptionDone=["build", "done..."], name="build"))
|
||||
descriptionDone=['build', 'done...'], name='build'))
|
||||
|
||||
################################################################################
|
||||
|
||||
################################################################################
|
||||
class WebRTCChromeFactory(WebRTCFactory):
|
||||
"""A Build Factory affected by properties."""
|
||||
"""Sets up the Chrome OS build."""
|
||||
|
||||
def __init__(self, build_factory_properties=None, steps=None,
|
||||
enable_coverage=False, account=None):
|
||||
WebRTCFactory.__init__(self, build_factory_properties, steps,
|
||||
enable_coverage, account)
|
||||
def __init__(self):
|
||||
WebRTCFactory.__init__(self)
|
||||
|
||||
def EnableBuild(self):
|
||||
self.AddCommonStep(["rm", "-rf", "src"], descriptor="Cleanup")
|
||||
cmd = ["gclient", "sync", "--force"]
|
||||
self.AddCommonStep(cmd, descriptor="Sync")
|
||||
self.AddCommonMakeStep("chrome")
|
||||
self.AddCommonStep(['rm', '-rf', 'src'], descriptor='Cleanup')
|
||||
cmd = ['gclient', 'sync', '--force']
|
||||
self.AddCommonStep(cmd, descriptor='Sync')
|
||||
self.AddCommonMakeStep('chrome')
|
||||
|
||||
def AddCommonMakeStep(self, make, descriptor="", make_extra=None):
|
||||
def AddCommonMakeStep(self, make, descriptor='', make_extra=None):
|
||||
make_descriptor = [make, descriptor]
|
||||
cmd = ["make", make, "-j100"]
|
||||
cmd = ['make', make, '-j100']
|
||||
if make_extra is not None:
|
||||
cmd.append(make_extra)
|
||||
self.addStep(shell.ShellCommand(command=cmd,
|
||||
workdir="build/src", description=["Making"] + make_descriptor,
|
||||
descriptionDone=make_descriptor + ["built"],
|
||||
name="_".join(make_descriptor)))
|
||||
workdir='build/src', description=['Making'] + make_descriptor,
|
||||
descriptionDone=make_descriptor + ['built'],
|
||||
name='_'.join(make_descriptor)))
|
||||
|
||||
|
||||
################################################################################
|
||||
class WebRTCLinuxFactory(WebRTCFactory):
|
||||
"""A Build Factory affected by properties."""
|
||||
"""Sets up the Linux build.
|
||||
|
||||
def __init__(self, build_factory_properties=None, steps=None,
|
||||
enable_coverage=False, enable_valgrind=False, account=None,
|
||||
coverage_url=None, coverage_dir=DEFAULT_COVERAGE_DIR):
|
||||
WebRTCFactory.__init__(self, build_factory_properties, steps,
|
||||
enable_coverage, enable_valgrind, account,
|
||||
coverage_url, coverage_dir)
|
||||
This factory is quite configurable and can run a variety of builds.
|
||||
"""
|
||||
|
||||
def __init__(self, valgrind_enabled=False):
|
||||
WebRTCFactory.__init__(self)
|
||||
|
||||
self.coverage_enabled = False
|
||||
self.valgrind_enabled = valgrind_enabled
|
||||
|
||||
def EnableCoverage(self, coverage_url, coverage_dir=DEFAULT_COVERAGE_DIR):
|
||||
"""Enables coverage measurements using LCOV/GCOV.
|
||||
|
||||
This method must be called before enabling build.
|
||||
|
||||
Args:
|
||||
coverage_url: See the GenerateCodeCoverage command's contract for
|
||||
this argument.
|
||||
coverage_dir: See the GenerateCodeCoverage command's contract for
|
||||
this argument.
|
||||
"""
|
||||
|
||||
assert self.build_enabled is False
|
||||
|
||||
self.coverage_enabled = True
|
||||
self.coverage_url = coverage_url
|
||||
self.coverage_dir = coverage_dir
|
||||
|
||||
def EnableBuild(self, force_sync=False, release=False, build32=False,
|
||||
chrome_os=False, clang=False):
|
||||
if build32:
|
||||
self.gyp_params.append("-Dtarget_arch=ia32")
|
||||
self.gyp_params.append('-Dtarget_arch=ia32')
|
||||
|
||||
self.enable_build = True
|
||||
self.build_enabled = True
|
||||
self.force_sync = force_sync
|
||||
"""Linux specific Build"""
|
||||
self.release = release
|
||||
|
||||
self.AddCommonStep(["rm", "-rf", "trunk"], descriptor="Cleanup")
|
||||
self.AddCommonStep(['rm', '-rf', 'trunk'], descriptor='Cleanup')
|
||||
|
||||
# Valgrind bots need special GYP defines to enable memory profiling
|
||||
# friendly compilation. They already has a custom .gclient
|
||||
# configuration file created so they don't need one being
|
||||
# generated like the other bots.
|
||||
if self.enable_valgrind:
|
||||
# friendly compilation. They already has a custom .gclient configuration
|
||||
# file created so they don't need one being generated like the other bots.
|
||||
if self.valgrind_enabled:
|
||||
for gyp_define in MEMORY_TOOLS_GYP_DEFINES:
|
||||
self.gyp_params.append("-D" + gyp_define)
|
||||
self.gyp_params.append('-D' + gyp_define)
|
||||
else:
|
||||
self.AddCommonStep(["gclient", "config", SVN_LOCATION],
|
||||
descriptor="gclient_config")
|
||||
self.AddCommonStep(['gclient', 'config', SVN_LOCATION],
|
||||
descriptor='gclient_config')
|
||||
|
||||
cmd = ["gclient", "sync"]
|
||||
cmd = ['gclient', 'sync']
|
||||
if force_sync:
|
||||
cmd.append("--force")
|
||||
self.AddCommonStep(cmd, descriptor="Sync")
|
||||
cmd.append('--force')
|
||||
self.AddCommonStep(cmd, descriptor='Sync')
|
||||
if chrome_os:
|
||||
self.gyp_params.append("-Dchromeos=1")
|
||||
self.gyp_params.append('-Dchromeos=1')
|
||||
|
||||
if clang:
|
||||
self.gyp_params.append("-Dclang=1")
|
||||
self.gyp_params.append('-Dclang=1')
|
||||
|
||||
if self.enable_coverage:
|
||||
self.gyp_params.append("-Dcoverage=1")
|
||||
self.AddCommonGYPStep("webrtc.gyp", descriptor="CommonGYP")
|
||||
if self.coverage_enabled:
|
||||
self.gyp_params.append('-Dcoverage=1')
|
||||
self.AddCommonGYPStep('webrtc.gyp', descriptor='CommonGYP')
|
||||
|
||||
if clang:
|
||||
self.AddCommonStep(["trunk/tools/clang/scripts/update.sh"],
|
||||
descriptor="Update_Clang")
|
||||
self.AddCommonStep(['trunk/tools/clang/scripts/update.sh'],
|
||||
descriptor='Update_Clang')
|
||||
|
||||
if self.release:
|
||||
self.AddCommonMakeStep("all", make_extra="BUILDTYPE=Release")
|
||||
self.AddCommonMakeStep('all', make_extra='BUILDTYPE=Release')
|
||||
else:
|
||||
self.AddCommonMakeStep("all")
|
||||
self.AddCommonMakeStep('all')
|
||||
|
||||
def AddCommonTestRunStep(self, test, descriptor="", cmd=None,
|
||||
workdir="build/trunk"):
|
||||
test_folder = "Release" if self.release else "Debug"
|
||||
def AddCommonTestRunStep(self, test, descriptor='', cmd=None,
|
||||
workdir='build/trunk'):
|
||||
test_folder = 'Release' if self.release else 'Debug'
|
||||
test_descriptor = [test, descriptor]
|
||||
if cmd is None:
|
||||
cmd = ["out/%s/%s" % (test_folder, test)]
|
||||
if self.enable_valgrind:
|
||||
cmd = ['out/%s/%s' % (test_folder, test)]
|
||||
if self.valgrind_enabled:
|
||||
cmd = VALGRIND_CMD + cmd
|
||||
self.addStep(shell.ShellCommand(command=cmd,
|
||||
workdir=workdir, description=["Running"] + test_descriptor,
|
||||
descriptionDone=test_descriptor + ["finished"],
|
||||
name="_".join(test_descriptor)))
|
||||
workdir=workdir, description=['Running'] + test_descriptor,
|
||||
descriptionDone=test_descriptor + ['finished'],
|
||||
name='_'.join(test_descriptor)))
|
||||
|
||||
def AddXvfbTestRunStep(self, test_name, test_binary, test_arguments=''):
|
||||
""" Adds a test to be run inside a XVFB window manager."""
|
||||
@@ -309,81 +370,91 @@ class WebRTCLinuxFactory(WebRTCFactory):
|
||||
'%s %s' % (test_binary, test_arguments))
|
||||
self.AddCommonTestRunStep(test=test_name, cmd=cmd)
|
||||
|
||||
def AddCommonMakeStep(self, make, descriptor="", make_extra=None):
|
||||
def AddCommonMakeStep(self, make, descriptor='', make_extra=None):
|
||||
make_descriptor = [make, descriptor]
|
||||
#cpu = `grep -i \"processor\" /proc/cpuinfo | sort -u | wc -l`
|
||||
cmd = ["make", make, "-j100"]
|
||||
cmd = ['make', make, '-j100']
|
||||
if make_extra is not None:
|
||||
cmd.append(make_extra)
|
||||
self.addStep(shell.ShellCommand(command=cmd,
|
||||
workdir="build/trunk", description=["Making"] + make_descriptor,
|
||||
descriptionDone=make_descriptor + ["built"],
|
||||
name="_".join(make_descriptor)))
|
||||
workdir='build/trunk', description=['Making'] + make_descriptor,
|
||||
descriptionDone=make_descriptor + ['built'],
|
||||
name='_'.join(make_descriptor)))
|
||||
|
||||
def EnableBaseCoverage(self):
|
||||
self.AddCommonStep(["lcov", "--directory", ".", "--zerocounters"],
|
||||
workdir="build/trunk",
|
||||
warnOnFailure=True,
|
||||
descriptor=["LCOV", "Zero"])
|
||||
self.AddCommonStep(["lcov", "--directory", ".", "--capture", "-b",
|
||||
".", "--initial",
|
||||
"--output-file", "webrtc_base.info"],
|
||||
workdir="build/trunk",
|
||||
warnOnFailure=True,
|
||||
descriptor=["LCOV", "Base", "Capture"])
|
||||
def AddStepsToEstablishCoverageBaseline(self):
|
||||
self.AddCommonStep(['lcov', '--directory', '.', '--capture', '-b',
|
||||
'.', '--initial',
|
||||
'--output-file', 'webrtc_base.info'],
|
||||
workdir='build/trunk',
|
||||
warn_on_failure=True,
|
||||
descriptor=['LCOV', 'Baseline', 'Capture'])
|
||||
self.AddCommonStep(['lcov', '--extract', 'webrtc_base.info', '*/src/*',
|
||||
'--output', 'filtered.info'],
|
||||
workdir="build/trunk",
|
||||
warnOnFailure=True,
|
||||
descriptor=["LCOV", "Base", "Extract"])
|
||||
self.AddCommonStep(["lcov", "--remove", "filtered.info", "*/usr/include/*",
|
||||
"/third*", "/testing/*", "*/test/*", "*_unittest.*",
|
||||
"*/mock/*", "--output",
|
||||
"webrtc_base_filtered_final.info"],
|
||||
workdir="build/trunk",
|
||||
warnOnFailure=True,
|
||||
descriptor=["LCOV", "Base", "Filter"])
|
||||
workdir='build/trunk',
|
||||
warn_on_failure=True,
|
||||
descriptor=['LCOV', 'Baseline', 'Extract'])
|
||||
self.AddCommonStep(['lcov', '--remove', 'filtered.info', '*/usr/include/*',
|
||||
'/third*', '/testing/*', '*/test/*', '*_unittest.*',
|
||||
'*/mock/*', '--output',
|
||||
'webrtc_base_filtered_final.info'],
|
||||
workdir='build/trunk',
|
||||
warn_on_failure=True,
|
||||
descriptor=['LCOV', 'Baseline', 'Filter'])
|
||||
|
||||
def EnableCoverage(self):
|
||||
def AddStepsToComputeCoverage(self):
|
||||
"""Enable coverage data."""
|
||||
|
||||
# Delete all third-party .gcda files to save time and work around a bug
|
||||
# in lcov which tends to hang when capturing on libjpgturbo.
|
||||
self.AddCommonStep(["./tools/continuous_build/clean_third_party_gcda.sh"],
|
||||
warnOnFailure=True,
|
||||
workdir="build/trunk", descriptor=["LCOV",
|
||||
"Delete 3rd party"])
|
||||
self.AddCommonStep(['./tools/continuous_build/clean_third_party_gcda.sh'],
|
||||
warn_on_failure=True,
|
||||
workdir='build/trunk', descriptor=['LCOV',
|
||||
'Delete 3rd party'])
|
||||
|
||||
self.AddCommonStep(["lcov", "--directory", ".", "--capture", "-b",
|
||||
".", "--output-file", "webrtc.info"],
|
||||
warnOnFailure=True,
|
||||
workdir="build/trunk", descriptor=["LCOV", "Capture"])
|
||||
self.AddCommonStep(['lcov', '--directory', '.', '--capture', '-b',
|
||||
'.', '--output-file', 'webrtc.info'],
|
||||
warn_on_failure=True,
|
||||
workdir='build/trunk', descriptor=['LCOV', 'Capture'])
|
||||
self.AddCommonStep(['lcov', '--extract', 'webrtc.info', '*/src/*',
|
||||
'--output', 'test.info'], warnOnFailure=True,
|
||||
workdir="build/trunk", descriptor=["LCOV", "Extract"])
|
||||
self.AddCommonStep(["lcov", "--remove", "test.info", "*/usr/include/*",
|
||||
"/third*", "/testing/*", "*/test/*", "*_unittest.*",
|
||||
"*/mock/*", "--output",
|
||||
"final.info"], warnOnFailure=True,
|
||||
workdir="build/trunk", descriptor=["LCOV", "Filter"])
|
||||
'--output', 'test.info'], warn_on_failure=True,
|
||||
workdir='build/trunk', descriptor=['LCOV', 'Extract'])
|
||||
self.AddCommonStep(['lcov', '--remove', 'test.info', '*/usr/include/*',
|
||||
'/third*', '/testing/*', '*/test/*', '*_unittest.*',
|
||||
'*/mock/*', '--output',
|
||||
'final.info'], warn_on_failure=True,
|
||||
workdir='build/trunk', descriptor=['LCOV', 'Filter'])
|
||||
self.AddCommonStep(['lcov', '-a', 'webrtc_base_filtered_final.info', '-a',
|
||||
'final.info', '-o', 'final.info'], warnOnFailure=True,
|
||||
workdir="build/trunk", descriptor=["LCOV", "Merge"])
|
||||
'final.info', '-o', 'final.info'], warn_on_failure=True,
|
||||
workdir='build/trunk', descriptor=['LCOV', 'Merge'])
|
||||
self.addStep(GenerateCodeCoverage(coverage_url=self.coverage_url,
|
||||
coverage_dir=self.coverage_dir))
|
||||
coverage_dir=self.coverage_dir,
|
||||
coverage_file='final.info'))
|
||||
|
||||
def EnableTests(self, tests):
|
||||
if self.coverage_enabled:
|
||||
self.AddStepsToEstablishCoverageBaseline()
|
||||
|
||||
WebRTCFactory.EnableTests(self, tests)
|
||||
|
||||
if self.coverage_enabled:
|
||||
self.AddStepsToComputeCoverage()
|
||||
|
||||
def EnableTest(self, test):
|
||||
"""Enable Test to be run.
|
||||
"""Adds a step for running a test on Linux.
|
||||
|
||||
test: test to be run.
|
||||
In general, this method will interpret the name as the name of a binary
|
||||
in the default build output directory, except for a few special cases
|
||||
which require custom command lines.
|
||||
|
||||
Args:
|
||||
test: the test name as a string.
|
||||
"""
|
||||
if test == "audioproc_unittest":
|
||||
if test == 'audioproc_unittest':
|
||||
self.AddCommonTestRunStep(test)
|
||||
self.AddCommonGYPStep("webrtc.gyp", gyp_params=["-Dprefer_fixed_point=1"],
|
||||
descriptor="fixed_point")
|
||||
self.AddCommonMakeStep(test, descriptor="make_fixed_point")
|
||||
self.AddCommonTestRunStep(test, descriptor="fixed_point")
|
||||
elif test == "vie_auto_test":
|
||||
self.AddCommonGYPStep('webrtc.gyp', gyp_params=['-Dprefer_fixed_point=1'],
|
||||
descriptor='fixed_point')
|
||||
self.AddCommonMakeStep(test, descriptor='make_fixed_point')
|
||||
self.AddCommonTestRunStep(test, descriptor='fixed_point')
|
||||
elif test == 'vie_auto_test':
|
||||
# TODO(phoglund): Enable the full stack test once it is completed and
|
||||
# nonflaky.
|
||||
binary = "out/Debug/vie_auto_test"
|
||||
@@ -396,151 +467,147 @@ class WebRTCLinuxFactory(WebRTCFactory):
|
||||
test_arguments=args)
|
||||
elif test == "video_render_module_test":
|
||||
self.AddXvfbTestRunStep(test_name=test,
|
||||
test_binary='out/Debug/video_render_module_test');
|
||||
test_binary='out/Debug/video_render_module_test')
|
||||
elif test == "voe_auto_test":
|
||||
# TODO(phoglund): Remove this notice and take appropriate action when
|
||||
# http://code.google.com/p/webrtc/issues/detail?id=266 is concluded.
|
||||
self.addStep(shell.Compile(
|
||||
command=('out/Debug/voe_auto_test --automated '
|
||||
'--gtest_filter="-VolumeTest.*"'),
|
||||
workdir="build/trunk", description=[test, "running..."],
|
||||
descriptionDone=[test, "done..."], name="%s" % test))
|
||||
workdir='build/trunk', description=[test, 'running...'],
|
||||
descriptionDone=[test, 'done...'], name='%s' % test))
|
||||
else:
|
||||
self.AddCommonTestRunStep(test)
|
||||
|
||||
|
||||
################################################################################
|
||||
class WebRTCMacFactory(WebRTCFactory):
|
||||
"""A Build Factory affected by properties."""
|
||||
"""Sets up the Mac build, both for make and xcode."""
|
||||
|
||||
def __init__(self, build_factory_properties=None, steps=None,
|
||||
enable_coverage=False, account=None):
|
||||
WebRTCFactory.__init__(self, build_factory_properties, steps,
|
||||
enable_coverage, account)
|
||||
self.build_type = "both"
|
||||
self.allowed_build_types = ["both", "xcode", "make"]
|
||||
def __init__(self):
|
||||
WebRTCFactory.__init__(self)
|
||||
self.build_type = 'both'
|
||||
self.allowed_build_types = ['both', 'xcode', 'make']
|
||||
|
||||
def EnableBuild(self, force_sync=True, build_type="both", release=False):
|
||||
self.enable_build = True
|
||||
def EnableBuild(self, force_sync=True, build_type='both', release=False):
|
||||
self.build_enabled = True
|
||||
self.force_sync = force_sync
|
||||
self.release = release
|
||||
"""Mac specific Build"""
|
||||
if build_type not in self.allowed_build_types:
|
||||
print "*** INCORRECT BUILD TYPE (%s)!!! ***" % build_type
|
||||
print '*** INCORRECT BUILD TYPE (%s)!!! ***' % build_type
|
||||
sys.exit(0)
|
||||
else:
|
||||
self.build_type = build_type
|
||||
self.AddCommonStep(["rm", "-rf", "trunk"], descriptor="Cleanup")
|
||||
self.AddCommonStep(["gclient", "config", SVN_LOCATION],
|
||||
descriptor="gclient_config")
|
||||
cmd = ["gclient", "sync"]
|
||||
self.AddCommonStep(['rm', '-rf', 'trunk'], descriptor='Cleanup')
|
||||
self.AddCommonStep(['gclient', 'config', SVN_LOCATION],
|
||||
descriptor='gclient_config')
|
||||
cmd = ['gclient', 'sync']
|
||||
if force_sync:
|
||||
cmd.append("--force")
|
||||
self.AddCommonStep(cmd, descriptor="Sync")
|
||||
if self.build_type == "make" or self.build_type == "both":
|
||||
self.AddCommonGYPStep("webrtc.gyp", gyp_params=["-f", "make"],
|
||||
descriptor="EnableMake")
|
||||
self.AddCommonMakeStep("all")
|
||||
cmd.append('--force')
|
||||
self.AddCommonStep(cmd, descriptor='Sync')
|
||||
if self.build_type == 'make' or self.build_type == 'both':
|
||||
self.AddCommonGYPStep('webrtc.gyp', gyp_params=['-f', 'make'],
|
||||
descriptor='EnableMake')
|
||||
self.AddCommonMakeStep('all')
|
||||
|
||||
def AddCommonTestRunStep(self, test, descriptor="", cmd=None,
|
||||
workdir="build/trunk"):
|
||||
test_folder = "Release" if self.release else "Debug"
|
||||
def AddCommonTestRunStep(self, test, descriptor='', cmd=None,
|
||||
workdir='build/trunk'):
|
||||
test_folder = 'Release' if self.release else 'Debug'
|
||||
test_descriptor = [test, descriptor]
|
||||
if cmd is None:
|
||||
if self.build_type == "xcode" or self.build_type == "both":
|
||||
cmd = ["xcodebuild/%s/%s" % (test_folder, test)]
|
||||
self.AddCommonStep(cmd, descriptor=test_descriptor + ["(xcode)"],
|
||||
workdir="build/trunk")
|
||||
if self.build_type == "make" or self.build_type == "both":
|
||||
cmd = ["out/%s/%s" % (test_folder, test)]
|
||||
self.AddCommonStep(cmd, descriptor=test_descriptor + ["(make)"],
|
||||
workdir="build/trunk")
|
||||
if self.build_type == 'xcode' or self.build_type == 'both':
|
||||
cmd = ['xcodebuild/%s/%s' % (test_folder, test)]
|
||||
self.AddCommonStep(cmd, descriptor=test_descriptor + ['(xcode)'],
|
||||
workdir='build/trunk')
|
||||
if self.build_type == 'make' or self.build_type == 'both':
|
||||
cmd = ['out/%s/%s' % (test_folder, test)]
|
||||
self.AddCommonStep(cmd, descriptor=test_descriptor + ['(make)'],
|
||||
workdir='build/trunk')
|
||||
|
||||
def AddCommonMakeStep(self, make, descriptor="", make_extra=None):
|
||||
def AddCommonMakeStep(self, make, descriptor='', make_extra=None):
|
||||
make_descriptor = [make, descriptor]
|
||||
if self.build_type == "make" or self.build_type == "both":
|
||||
cmd = ["make", make, "-j100"]
|
||||
if self.build_type == 'make' or self.build_type == 'both':
|
||||
cmd = ['make', make, '-j100']
|
||||
if make_extra is not None:
|
||||
cmd.append(make_extra)
|
||||
if self.release:
|
||||
cmd.append("BUILDTYPE=Release")
|
||||
self.AddCommonStep(cmd, descriptor=make_descriptor + ["(make)"],
|
||||
workdir="build/trunk")
|
||||
if self.build_type == "xcode" or self.build_type == "both":
|
||||
configuration = "Release" if self.release else "Debug"
|
||||
cmd = ["xcodebuild", "-project", "webrtc.xcodeproj", "-configuration",
|
||||
configuration, "-target", "All"]
|
||||
self.AddCommonStep(cmd, descriptor=make_descriptor + ["(xcode)"],
|
||||
workdir="build/trunk")
|
||||
cmd.append('BUILDTYPE=Release')
|
||||
self.AddCommonStep(cmd, descriptor=make_descriptor + ['(make)'],
|
||||
workdir='build/trunk')
|
||||
if self.build_type == 'xcode' or self.build_type == 'both':
|
||||
configuration = 'Release' if self.release else 'Debug'
|
||||
cmd = ['xcodebuild', '-project', 'webrtc.xcodeproj', '-configuration',
|
||||
configuration, '-target', 'All']
|
||||
self.AddCommonStep(cmd, descriptor=make_descriptor + ['(xcode)'],
|
||||
workdir='build/trunk')
|
||||
|
||||
|
||||
################################################################################
|
||||
class WebRTCWinFactory(WebRTCFactory):
|
||||
"""A Build Factory affected by properties."""
|
||||
"""Sets up the Windows build."""
|
||||
|
||||
def __init__(self, build_factory_properties=None, steps=None,
|
||||
enable_coverage=False, account=None):
|
||||
WebRTCFactory.__init__(self, build_factory_properties, steps,
|
||||
enable_coverage, account)
|
||||
self.configuration = "Debug"
|
||||
self.platform = "x64"
|
||||
self.allowed_platforms = ["x64", "Win32"]
|
||||
self.allowed_configurations = ["Debug", "Release", "both"]
|
||||
def __init__(self):
|
||||
WebRTCFactory.__init__(self)
|
||||
|
||||
def EnableBuild(self, force_sync=True, platform="Win32",
|
||||
configuration="Debug", build_only=False):
|
||||
self.enable_build = True
|
||||
self.configuration = 'Debug'
|
||||
self.platform = 'x64'
|
||||
self.allowed_platforms = ['x64', 'Win32']
|
||||
self.allowed_configurations = ['Debug', 'Release', 'both']
|
||||
|
||||
def EnableBuild(self, force_sync=True, platform='Win32',
|
||||
configuration='Debug', build_only=False):
|
||||
self.build_enabled = True
|
||||
self.force_sync = force_sync
|
||||
"""Win specific Build"""
|
||||
if platform not in self.allowed_platforms:
|
||||
print "*** INCORRECT PLATFORM (%s)!!! ***" % platform
|
||||
print '*** INCORRECT PLATFORM (%s)!!! ***' % platform
|
||||
sys.exit(0)
|
||||
else:
|
||||
self.platform = platform
|
||||
if configuration not in self.allowed_configurations:
|
||||
print "*** INCORRECT CONFIGURATION (%s)!!! ***" % configuration
|
||||
print '*** INCORRECT CONFIGURATION (%s)!!! ***' % configuration
|
||||
sys.exit(0)
|
||||
else:
|
||||
self.configuration = configuration
|
||||
if not build_only:
|
||||
self.AddCommonStep(["rm", "-rf", "trunk"], descriptor="Cleanup")
|
||||
self.AddCommonStep(["gclient", "config", SVN_LOCATION],
|
||||
descriptor="gclient_config")
|
||||
cmd = ["gclient", "sync"]
|
||||
self.AddCommonStep(['rm', '-rf', 'trunk'], descriptor='Cleanup')
|
||||
self.AddCommonStep(['gclient', 'config', SVN_LOCATION],
|
||||
descriptor='gclient_config')
|
||||
cmd = ['gclient', 'sync']
|
||||
if force_sync:
|
||||
cmd.append("--force")
|
||||
self.AddCommonStep(cmd, descriptor="Sync")
|
||||
cmd.append('--force')
|
||||
self.AddCommonStep(cmd, descriptor='Sync')
|
||||
|
||||
if self.configuration == "Debug" or self.configuration == "both":
|
||||
cmd = ["msbuild", "webrtc.sln", "/t:Clean",
|
||||
"/p:Configuration=Debug;Platform=%s" % (self.platform)]
|
||||
self.AddCommonStep(cmd, descriptor="Build_Clean", workdir="build/trunk")
|
||||
cmd = ["msbuild", "webrtc.sln",
|
||||
"/p:Configuration=Debug;Platform=%s" % (self.platform)]
|
||||
self.AddCommonStep(cmd, descriptor="Build_Debug", workdir="build/trunk")
|
||||
if self.configuration == "Release" or self.configuration == "both":
|
||||
cmd = ["msbuild", "webrtc.sln", "/t:Clean",
|
||||
"/p:Configuration=Release;Platform=%s" % (self.platform)]
|
||||
self.AddCommonStep(cmd, descriptor="Build_Clean", workdir="build/trunk")
|
||||
cmd = ["msbuild", "webrtc.sln",
|
||||
"/p:Configuration=Release;Platform=%s" % (self.platform)]
|
||||
self.AddCommonStep(cmd, descriptor="Build_Release", workdir="build/trunk")
|
||||
if self.configuration == 'Debug' or self.configuration == 'both':
|
||||
cmd = ['msbuild', 'webrtc.sln', '/t:Clean',
|
||||
'/p:Configuration=Debug;Platform=%s' % (self.platform)]
|
||||
self.AddCommonStep(cmd, descriptor='Build_Clean', workdir='build/trunk')
|
||||
cmd = ['msbuild', 'webrtc.sln',
|
||||
'/p:Configuration=Debug;Platform=%s' % (self.platform)]
|
||||
self.AddCommonStep(cmd, descriptor='Build_Debug', workdir='build/trunk')
|
||||
if self.configuration == 'Release' or self.configuration == 'both':
|
||||
cmd = ['msbuild', 'webrtc.sln', '/t:Clean',
|
||||
'/p:Configuration=Release;Platform=%s' % (self.platform)]
|
||||
self.AddCommonStep(cmd, descriptor='Build_Clean', workdir='build/trunk')
|
||||
cmd = ['msbuild', 'webrtc.sln',
|
||||
'/p:Configuration=Release;Platform=%s' % (self.platform)]
|
||||
self.AddCommonStep(cmd, descriptor='Build_Release', workdir='build/trunk')
|
||||
|
||||
def AddCommonTestRunStep(self, test, descriptor="", cmd=None,
|
||||
workdir="build/trunk"):
|
||||
def AddCommonTestRunStep(self, test, descriptor='', cmd=None,
|
||||
workdir='build/trunk'):
|
||||
test_descriptor = [test, descriptor]
|
||||
if cmd is None:
|
||||
if self.configuration == "Debug" or self.configuration == "both":
|
||||
cmd = ["build\Debug\%s.exe" % test]
|
||||
self.AddCommonStep(cmd, descriptor=test_descriptor + ["Debug"],
|
||||
if self.configuration == 'Debug' or self.configuration == 'both':
|
||||
cmd = ['build\Debug\%s.exe' % test]
|
||||
self.AddCommonStep(cmd, descriptor=test_descriptor + ['Debug'],
|
||||
workdir=workdir)
|
||||
if self.configuration == "Release" or self.configuration == "both":
|
||||
cmd = ["build\Release\%s.exe" % test]
|
||||
self.AddCommonStep(cmd, descriptor=test_descriptor + ["Release"],
|
||||
if self.configuration == 'Release' or self.configuration == 'both':
|
||||
cmd = ['build\Release\%s.exe' % test]
|
||||
self.AddCommonStep(cmd, descriptor=test_descriptor + ['Release'],
|
||||
workdir=workdir)
|
||||
|
||||
################################################################################
|
||||
# Utility functions
|
||||
|
||||
|
||||
class UnsupportedPlatformError(Exception):
|
||||
pass
|
||||
|
||||
@@ -550,9 +617,9 @@ def GetEnabledTests(test_dict, platform):
|
||||
|
||||
Args:
|
||||
test_dict: Dictionary mapping test names to tuples representing if the
|
||||
test shall be enabled on each platform. Each tuple contains one boolean
|
||||
for each platform. The platforms are in the order specified by
|
||||
SUPPORTED_PLATFORMS.
|
||||
test shall be enabled on each platform. Each tuple contains one
|
||||
boolean for each platform. The platforms are in the order specified
|
||||
by SUPPORTED_PLATFORMS.
|
||||
platform: The platform we're looking to get the tests for.
|
||||
|
||||
Returns:
|
||||
@@ -562,7 +629,7 @@ def GetEnabledTests(test_dict, platform):
|
||||
UnsupportedPlatformError: if the platform supplied is not supported.
|
||||
"""
|
||||
if platform not in SUPPORTED_PLATFORMS:
|
||||
raise UnsupportedPlatformError("*** UNSUPPORTED PLATFORM (%s)!!! ***" %
|
||||
raise UnsupportedPlatformError('*** UNSUPPORTED PLATFORM (%s)!!! ***' %
|
||||
platform)
|
||||
result = []
|
||||
platform_index = SUPPORTED_PLATFORMS.index(platform)
|
||||
|
Reference in New Issue
Block a user