Cleaned up workdir usage.

BUG=
TEST=

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1872 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
phoglund@webrtc.org
2012-03-12 09:08:41 +00:00
parent ae1c4547ee
commit 2e34c88c37

View File

@ -23,6 +23,8 @@ from buildbot.steps.shell import ShellCommand
SUPPORTED_PLATFORMS = ('Linux', 'Mac', 'Windows') SUPPORTED_PLATFORMS = ('Linux', 'Mac', 'Windows')
WEBRTC_SVN_LOCATION = 'http://webrtc.googlecode.com/svn/trunk' WEBRTC_SVN_LOCATION = 'http://webrtc.googlecode.com/svn/trunk'
WEBRTC_TRUNK_DIR = 'build/trunk/'
WEBRTC_BUILD_DIR = 'build/'
VALGRIND_CMD = ['tools/valgrind-webrtc/webrtc_tests.sh', '-t', 'cmdline'] VALGRIND_CMD = ['tools/valgrind-webrtc/webrtc_tests.sh', '-t', 'cmdline']
@ -103,7 +105,7 @@ class WebRTCFactory(factory.BuildFactory):
for test in tests: for test in tests:
self.EnableTest(test) self.EnableTest(test)
def AddCommonStep(self, cmd, descriptor='', workdir='build', def AddCommonStep(self, cmd, descriptor='', workdir=WEBRTC_TRUNK_DIR,
number_of_retries=0, halt_build_on_failure=True, number_of_retries=0, halt_build_on_failure=True,
warn_on_failure=False): warn_on_failure=False):
"""Adds a step which will run as a shell command on the slave. """Adds a step which will run as a shell command on the slave.
@ -119,7 +121,12 @@ class WebRTCFactory(factory.BuildFactory):
ShellCommand, so see that documentation for more details. ShellCommand, so see that documentation for more details.
descriptor: A string, or a list of strings, describing what the step descriptor: A string, or a list of strings, describing what the step
does. The descriptor gets printed in the waterfall display. does. The descriptor gets printed in the waterfall display.
workdir: The working directory to run the command in. workdir: The working directory to run the command in, relative to
the bot's build name directory. The WebRTC root will generally be
in build/trunk/ relative to that directory. The caller is
responsible for making sure that the slashes are flipped the right
way depending on platform, which means you can't use the default
value if the step will run on a Windows machine.
number_of_retries: Number of times to retry the command, if it fails. number_of_retries: Number of times to retry the command, if it fails.
halt_build_on_failure: Stops the build dead in its tracks if this step halt_build_on_failure: Stops the build dead in its tracks if this step
fails. Use for critical steps. This option does not make sense with fails. Use for critical steps. This option does not make sense with
@ -131,6 +138,7 @@ class WebRTCFactory(factory.BuildFactory):
if type(descriptor) is str: if type(descriptor) is str:
descriptor = [descriptor] descriptor = [descriptor]
# Add spaces to wrap long test names to make waterfall output more compact. # Add spaces to wrap long test names to make waterfall output more compact.
wrapped_text = self._WrapLongLines(descriptor) wrapped_text = self._WrapLongLines(descriptor)
@ -152,15 +160,18 @@ class WebRTCFactory(factory.BuildFactory):
Smart clean only cleans the whole repository if the build status oracle Smart clean only cleans the whole repository if the build status oracle
thinks the last build failed. Otherwise it cleans just the build output. thinks the last build failed. Otherwise it cleans just the build output.
""" """
self.addStep(SmartClean(self.build_status_oracle)) self.addStep(SmartClean(self.build_status_oracle,
workdir=WEBRTC_BUILD_DIR))
def AddCommonTestRunStep(self, test, descriptor='', cmd=None, def AddCommonTestRunStep(self, test, descriptor='', cmd=None):
workdir='build/trunk'):
"""Adds a step for running a single test [must be overridden]. """Adds a step for running a single test [must be overridden].
In general, failing tests should not halt the build and allow other tests In general, failing tests should not halt the build and allow other tests
to execute. A failing test should fail, or 'flunk', the build though. to execute. A failing test should fail, or 'flunk', the build though.
The working directory for this command will be the WebRTC root directory
(generally build/trunk).
Implementations of this method must add new steps through AddCommonStep Implementations of this method must add new steps through AddCommonStep
and not by calling addStep. and not by calling addStep.
@ -175,10 +186,6 @@ class WebRTCFactory(factory.BuildFactory):
cmd: If necessary, you can specify this argument to override the cmd: If necessary, you can specify this argument to override the
default behavior, which is to just run the binary specified in default behavior, which is to just run the binary specified in
test without arguments. 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 pass
@ -195,7 +202,7 @@ class WebRTCFactory(factory.BuildFactory):
def AddGclientSyncStep(self, force_sync): def AddGclientSyncStep(self, force_sync):
"""Helper method for invoking gclient sync. Will retry if the operation """Helper method for invoking gclient sync. Will retry if the operation
fails. fails. Runs in the bot's build directory (e.g. one step above trunk).
Args: Args:
force_sync: If the sync should be forced, i.e. update even for force_sync: If the sync should be forced, i.e. update even for
@ -205,6 +212,7 @@ class WebRTCFactory(factory.BuildFactory):
if force_sync: if force_sync:
cmd.append('--force') cmd.append('--force')
self.AddCommonStep(cmd, descriptor='Sync', self.AddCommonStep(cmd, descriptor='Sync',
workdir=WEBRTC_BUILD_DIR,
number_of_retries=GCLIENT_RETRIES) number_of_retries=GCLIENT_RETRIES)
def AddCommonGYPStep(self, gyp_file, gyp_params=[], descriptor='gyp'): def AddCommonGYPStep(self, gyp_file, gyp_params=[], descriptor='gyp'):
@ -213,8 +221,8 @@ class WebRTCFactory(factory.BuildFactory):
GYP will generate makefiles or its equivalent in a platform-specific GYP will generate makefiles or its equivalent in a platform-specific
manner. A failed GYP step will halt the build. manner. A failed GYP step will halt the build.
Implementations of this method must add new steps through AddCommonStep This command will run in the WebRTC root directory
and not by calling addStep. (generally build/trunk).
Args: Args:
gyp_file: The root GYP file to use. gyp_file: The root GYP file to use.
@ -224,7 +232,7 @@ class WebRTCFactory(factory.BuildFactory):
""" """
cmd = ['./build/gyp_chromium', '--depth=.', gyp_file] cmd = ['./build/gyp_chromium', '--depth=.', gyp_file]
cmd += gyp_params + self.gyp_params cmd += gyp_params + self.gyp_params
self.AddCommonStep(cmd=cmd, workdir='build/trunk', descriptor=descriptor) self.AddCommonStep(cmd=cmd, descriptor=descriptor)
def _WrapLongLines(self, string_list, max_line_length=25, wrap_character='_'): def _WrapLongLines(self, string_list, max_line_length=25, wrap_character='_'):
""" Creates a list with wrapped strings for lines that are too long. """ Creates a list with wrapped strings for lines that are too long.
@ -365,7 +373,6 @@ class GenerateCodeCoverage(ShellCommand):
self.addFactoryArguments(coverage_url=coverage_url, self.addFactoryArguments(coverage_url=coverage_url,
coverage_dir=coverage_dir, coverage_dir=coverage_dir,
coverage_file=coverage_file) coverage_file=coverage_file)
self.setDefaultWorkdir('build/trunk')
self.coverage_url = coverage_url self.coverage_url = coverage_url
self.coverage_dir = coverage_dir self.coverage_dir = coverage_dir
self.coverage_file = coverage_file self.coverage_file = coverage_file
@ -402,14 +409,14 @@ class WebRTCAndroidFactory(WebRTCFactory):
prefix + 'EXECUTABLES/webrtc_*' prefix + 'EXECUTABLES/webrtc_*'
] ]
cmd = ' ; '.join(cleanup_list) cmd = ' ; '.join(cleanup_list)
self.AddCommonStep(cmd, descriptor='cleanup', workdir='build/trunk') self.AddCommonStep(cmd, descriptor='cleanup')
cmd = 'svn checkout %s external/webrtc' % WEBRTC_SVN_LOCATION cmd = 'svn checkout %s external/webrtc' % WEBRTC_SVN_LOCATION
self.AddCommonStep(cmd, descriptor='svn (checkout)', workdir='build/trunk') self.AddCommonStep(cmd, descriptor='svn (checkout)')
cmd = ('source build/envsetup.sh && lunch full_%s-eng ' cmd = ('source build/envsetup.sh && lunch full_%s-eng '
'&& mmm external/webrtc showcommands' % product) '&& mmm external/webrtc showcommands' % product)
self.AddCommonStep(cmd, descriptor='build', workdir='build/trunk') self.AddCommonStep(cmd, descriptor='build')
class WebRTCChromeFactory(WebRTCFactory): class WebRTCChromeFactory(WebRTCFactory):
@ -419,7 +426,8 @@ class WebRTCChromeFactory(WebRTCFactory):
WebRTCFactory.__init__(self, build_status_oracle) WebRTCFactory.__init__(self, build_status_oracle)
def EnableBuild(self): def EnableBuild(self):
self.AddCommonStep(['rm', '-rf', 'src'], descriptor='Cleanup') self.AddCommonStep(['rm', '-rf', 'src'], workdir=WEBRTC_BUILD_DIR,
descriptor='Cleanup')
self.AddGclientSyncStep(force_sync=True) self.AddGclientSyncStep(force_sync=True)
self.AddCommonMakeStep('chrome') self.AddCommonMakeStep('chrome')
@ -480,6 +488,7 @@ class WebRTCLinuxFactory(WebRTCFactory):
self.gyp_params.append('-D' + gyp_define) self.gyp_params.append('-D' + gyp_define)
else: else:
self.AddCommonStep(['gclient', 'config', WEBRTC_SVN_LOCATION], self.AddCommonStep(['gclient', 'config', WEBRTC_SVN_LOCATION],
workdir=WEBRTC_BUILD_DIR,
descriptor='gclient_config') descriptor='gclient_config')
self.AddGclientSyncStep(force_sync=False) self.AddGclientSyncStep(force_sync=False)
@ -495,23 +504,22 @@ class WebRTCLinuxFactory(WebRTCFactory):
if clang: if clang:
self.AddCommonStep(['trunk/tools/clang/scripts/update.sh'], self.AddCommonStep(['trunk/tools/clang/scripts/update.sh'],
descriptor='Update_Clang') workdir=WEBRTC_BUILD_DIR,
descriptor='Update_Clang')
if self.release: if self.release:
self.AddCommonMakeStep('all', make_extra='BUILDTYPE=Release') self.AddCommonMakeStep('all', make_extra='BUILDTYPE=Release')
else: else:
self.AddCommonMakeStep('all') self.AddCommonMakeStep('all')
def AddCommonTestRunStep(self, test, extra_text=None, cmd=None, def AddCommonTestRunStep(self, test, extra_text=None, cmd=None):
workdir='build/trunk'):
descriptor = [test, extra_text] if extra_text else [test] descriptor = [test, extra_text] if extra_text else [test]
if cmd is None: if cmd is None:
test_folder = 'Release' if self.release else 'Debug' test_folder = 'Release' if self.release else 'Debug'
cmd = ['out/%s/%s' % (test_folder, test)] cmd = ['out/%s/%s' % (test_folder, test)]
if self.valgrind_enabled: if self.valgrind_enabled:
cmd = VALGRIND_CMD + cmd cmd = VALGRIND_CMD + cmd
self.AddCommonStep(cmd, descriptor=descriptor, workdir=workdir, self.AddCommonStep(cmd, descriptor=descriptor, halt_build_on_failure=False)
halt_build_on_failure=False)
def AddXvfbTestRunStep(self, test_name, test_binary, test_arguments=''): def AddXvfbTestRunStep(self, test_name, test_binary, test_arguments=''):
""" Adds a test to be run inside a XVFB window manager.""" """ Adds a test to be run inside a XVFB window manager."""
@ -526,19 +534,17 @@ class WebRTCLinuxFactory(WebRTCFactory):
cmd = ['make', target, '-j100'] cmd = ['make', target, '-j100']
if make_extra: if make_extra:
cmd.append(make_extra) cmd.append(make_extra)
self.AddCommonStep(cmd=cmd, descriptor=descriptor, workdir='build/trunk') self.AddCommonStep(cmd=cmd, descriptor=descriptor)
def AddStepsToEstablishCoverageBaseline(self): def AddStepsToEstablishCoverageBaseline(self):
self.AddCommonStep(['lcov', '--directory', '.', '--capture', '-b', self.AddCommonStep(['lcov', '--directory', '.', '--capture', '-b',
'.', '--initial', '.', '--initial',
'--output-file', 'webrtc_base.info'], '--output-file', 'webrtc_base.info'],
workdir='build/trunk',
warn_on_failure=True, warn_on_failure=True,
halt_build_on_failure=False, halt_build_on_failure=False,
descriptor='LCOV (Baseline Capture)') descriptor='LCOV (Baseline Capture)')
self.AddCommonStep(['lcov', '--extract', 'webrtc_base.info', '*/src/*', self.AddCommonStep(['lcov', '--extract', 'webrtc_base.info', '*/src/*',
'--output', 'filtered.info'], '--output', 'filtered.info'],
workdir='build/trunk',
warn_on_failure=True, warn_on_failure=True,
halt_build_on_failure=False, halt_build_on_failure=False,
descriptor='LCOV (Baseline Extract)') descriptor='LCOV (Baseline Extract)')
@ -546,7 +552,6 @@ class WebRTCLinuxFactory(WebRTCFactory):
'/third*', '/testing/*', '*/test/*', '*_unittest.*', '/third*', '/testing/*', '*/test/*', '*_unittest.*',
'*/mock/*', '--output', '*/mock/*', '--output',
'webrtc_base_filtered_final.info'], 'webrtc_base_filtered_final.info'],
workdir='build/trunk',
warn_on_failure=True, warn_on_failure=True,
halt_build_on_failure=False, halt_build_on_failure=False,
descriptor='LCOV (Baseline Filter)') descriptor='LCOV (Baseline Filter)')
@ -559,19 +564,16 @@ class WebRTCLinuxFactory(WebRTCFactory):
self.AddCommonStep(['./tools/continuous_build/clean_third_party_gcda.sh'], self.AddCommonStep(['./tools/continuous_build/clean_third_party_gcda.sh'],
warn_on_failure=True, warn_on_failure=True,
halt_build_on_failure=False, halt_build_on_failure=False,
workdir='build/trunk',
descriptor='LCOV (Delete 3rd party)') descriptor='LCOV (Delete 3rd party)')
self.AddCommonStep(['lcov', '--directory', '.', '--capture', '-b', self.AddCommonStep(['lcov', '--directory', '.', '--capture', '-b',
'.', '--output-file', 'webrtc.info'], '.', '--output-file', 'webrtc.info'],
warn_on_failure=True, warn_on_failure=True,
halt_build_on_failure=False, halt_build_on_failure=False,
workdir='build/trunk',
descriptor='LCOV (Capture)') descriptor='LCOV (Capture)')
self.AddCommonStep(['lcov', '--extract', 'webrtc.info', '*/src/*', self.AddCommonStep(['lcov', '--extract', 'webrtc.info', '*/src/*',
'--output', 'test.info'], '--output', 'test.info'],
warn_on_failure=True, warn_on_failure=True,
halt_build_on_failure=False, halt_build_on_failure=False,
workdir='build/trunk',
descriptor='LCOV (Extract)') descriptor='LCOV (Extract)')
self.AddCommonStep(['lcov', '--remove', 'test.info', '*/usr/include/*', self.AddCommonStep(['lcov', '--remove', 'test.info', '*/usr/include/*',
'/third*', '/testing/*', '*/test/*', '*_unittest.*', '/third*', '/testing/*', '*/test/*', '*_unittest.*',
@ -579,17 +581,18 @@ class WebRTCLinuxFactory(WebRTCFactory):
'final.info'], 'final.info'],
warn_on_failure=True, warn_on_failure=True,
halt_build_on_failure=False, halt_build_on_failure=False,
workdir='build/trunk',
descriptor='LCOV (Filter)') descriptor='LCOV (Filter)')
self.AddCommonStep(['lcov', '-a', 'webrtc_base_filtered_final.info', '-a', self.AddCommonStep(['lcov', '-a', 'webrtc_base_filtered_final.info', '-a',
'final.info', '-o', 'final.info'], 'final.info', '-o', 'final.info'],
warn_on_failure=True, warn_on_failure=True,
halt_build_on_failure=False, halt_build_on_failure=False,
workdir='build/trunk',
descriptor='LCOV (Merge)') descriptor='LCOV (Merge)')
# This step isn't monitored but it's fine since it's not critical.
self.addStep(GenerateCodeCoverage(coverage_url=self.coverage_url, self.addStep(GenerateCodeCoverage(coverage_url=self.coverage_url,
coverage_dir=self.coverage_dir, coverage_dir=self.coverage_dir,
coverage_file='final.info')) coverage_file='final.info',
workdir=WEBRTC_TRUNK_DIR))
def EnableTests(self, tests): def EnableTests(self, tests):
if self.coverage_enabled: if self.coverage_enabled:
@ -654,6 +657,7 @@ class WebRTCMacFactory(WebRTCFactory):
self.build_type = build_type self.build_type = build_type
self.AddSmartCleanStep() self.AddSmartCleanStep()
self.AddCommonStep(['gclient', 'config', WEBRTC_SVN_LOCATION], self.AddCommonStep(['gclient', 'config', WEBRTC_SVN_LOCATION],
workdir=WEBRTC_BUILD_DIR,
descriptor='gclient_config') descriptor='gclient_config')
self.AddGclientSyncStep(force_sync=True) self.AddGclientSyncStep(force_sync=True)
@ -662,8 +666,7 @@ class WebRTCMacFactory(WebRTCFactory):
descriptor='EnableMake') descriptor='EnableMake')
self.AddCommonMakeStep('all') self.AddCommonMakeStep('all')
def AddCommonTestRunStep(self, test, extra_text=None, cmd=None, def AddCommonTestRunStep(self, test, extra_text=None, cmd=None):
workdir='build/trunk'):
descriptor = [test, extra_text] if extra_text else [test] descriptor = [test, extra_text] if extra_text else [test]
if cmd is None: if cmd is None:
out_path = 'xcodebuild' if self.build_type == 'xcode' else 'out' out_path = 'xcodebuild' if self.build_type == 'xcode' else 'out'
@ -672,12 +675,12 @@ class WebRTCMacFactory(WebRTCFactory):
if self.build_type == 'xcode' or self.build_type == 'both': if self.build_type == 'xcode' or self.build_type == 'both':
self.AddCommonStep(cmd, descriptor=descriptor + ['(xcode)'], self.AddCommonStep(cmd, descriptor=descriptor + ['(xcode)'],
halt_build_on_failure=False, workdir=workdir) halt_build_on_failure=False)
# Execute test only for 'make' build type. # Execute test only for 'make' build type.
# If 'both' is enabled we'll only execute the 'xcode' built ones. # If 'both' is enabled we'll only execute the 'xcode' built ones.
if self.build_type == 'make': if self.build_type == 'make':
self.AddCommonStep(cmd, descriptor=descriptor + ['(make)'], self.AddCommonStep(cmd, descriptor=descriptor + ['(make)'],
halt_build_on_failure=False, workdir=workdir) halt_build_on_failure=False)
def AddCommonMakeStep(self, target, extra_text=None, make_extra=None): def AddCommonMakeStep(self, target, extra_text=None, make_extra=None):
descriptor = [target, extra_text] if extra_text else [target] descriptor = [target, extra_text] if extra_text else [target]
@ -687,14 +690,12 @@ class WebRTCMacFactory(WebRTCFactory):
cmd.append(make_extra) cmd.append(make_extra)
if self.release: if self.release:
cmd.append('BUILDTYPE=Release') cmd.append('BUILDTYPE=Release')
self.AddCommonStep(cmd, descriptor=descriptor + ['(make)'], self.AddCommonStep(cmd, descriptor=descriptor + ['(make)'])
workdir='build/trunk')
if self.build_type == 'xcode' or self.build_type == 'both': if self.build_type == 'xcode' or self.build_type == 'both':
configuration = 'Release' if self.release else 'Debug' configuration = 'Release' if self.release else 'Debug'
cmd = ['xcodebuild', '-project', 'webrtc.xcodeproj', '-configuration', cmd = ['xcodebuild', '-project', 'webrtc.xcodeproj', '-configuration',
configuration, '-target', 'All'] configuration, '-target', 'All']
self.AddCommonStep(cmd, descriptor=descriptor + ['(xcode)'], self.AddCommonStep(cmd, descriptor=descriptor + ['(xcode)'])
workdir='build/trunk')
class WebRTCWinFactory(WebRTCFactory): class WebRTCWinFactory(WebRTCFactory):
"""Sets up the Windows build. """Sets up the Windows build.
@ -709,6 +710,14 @@ class WebRTCWinFactory(WebRTCFactory):
self.allowed_platforms = ['x64', 'Win32'] self.allowed_platforms = ['x64', 'Win32']
self.allowed_configurations = ['Debug', 'Release', 'both'] self.allowed_configurations = ['Debug', 'Release', 'both']
def AddCommonStep(self, cmd, descriptor='', workdir=WEBRTC_TRUNK_DIR,
number_of_retries=0, halt_build_on_failure=True,
warn_on_failure=False):
workdir = workdir.replace('/', '\\')
WebRTCFactory.AddCommonStep(self, cmd, descriptor, workdir,
number_of_retries, halt_build_on_failure,
warn_on_failure)
def EnableBuild(self, platform='Win32', configuration='Debug'): def EnableBuild(self, platform='Win32', configuration='Debug'):
if platform not in self.allowed_platforms: if platform not in self.allowed_platforms:
raise UnsupportedConfigurationError('Platform %s is not supported.' raise UnsupportedConfigurationError('Platform %s is not supported.'
@ -733,37 +742,37 @@ class WebRTCWinFactory(WebRTCFactory):
# Now do the clean + build. # Now do the clean + build.
self.AddSmartCleanStep() self.AddSmartCleanStep()
self.AddCommonStep(['gclient', 'config', WEBRTC_SVN_LOCATION], self.AddCommonStep(['gclient', 'config', WEBRTC_SVN_LOCATION],
descriptor='gclient_config') descriptor='gclient_config',
workdir=WEBRTC_BUILD_DIR)
self.AddGclientSyncStep(force_sync=True) self.AddGclientSyncStep(force_sync=True)
if self.configuration == 'Debug' or self.configuration == 'both': if self.configuration == 'Debug' or self.configuration == 'both':
cmd = ['msbuild', 'webrtc.sln', '/t:Clean', '/verbosity:diagnostic', cmd = ['msbuild', 'webrtc.sln', '/t:Clean', '/verbosity:diagnostic',
'/p:Configuration=Debug;Platform=%s' % (self.platform)] '/p:Configuration=Debug;Platform=%s' % (self.platform)]
self.AddCommonStep(cmd, descriptor='Build(Clean)', workdir='build/trunk') self.AddCommonStep(cmd, descriptor='Build(Clean)')
cmd = ['msbuild', 'webrtc.sln', '/verbosity:diagnostic', cmd = ['msbuild', 'webrtc.sln', '/verbosity:diagnostic',
'/p:Configuration=Debug;Platform=%s' % (self.platform)] '/p:Configuration=Debug;Platform=%s' % (self.platform)]
self.AddCommonStep(cmd, descriptor='Build(Debug)', workdir='build/trunk') self.AddCommonStep(cmd, descriptor='Build(Debug)')
if self.configuration == 'Release' or self.configuration == 'both': if self.configuration == 'Release' or self.configuration == 'both':
cmd = ['msbuild', 'webrtc.sln', '/t:Clean', '/verbosity:diagnostic', cmd = ['msbuild', 'webrtc.sln', '/t:Clean', '/verbosity:diagnostic',
'/p:Configuration=Release;Platform=%s' % (self.platform)] '/p:Configuration=Release;Platform=%s' % (self.platform)]
self.AddCommonStep(cmd, descriptor='Build(Clean)', workdir='build/trunk') self.AddCommonStep(cmd, descriptor='Build(Clean)')
cmd = ['msbuild', 'webrtc.sln', '/verbosity:diagnostic', cmd = ['msbuild', 'webrtc.sln', '/verbosity:diagnostic',
'/p:Configuration=Release;Platform=%s' % (self.platform)] '/p:Configuration=Release;Platform=%s' % (self.platform)]
self.AddCommonStep(cmd, descriptor='Build(Release)', self.AddCommonStep(cmd, descriptor='Build(Release)')
workdir='build/trunk')
def AddCommonTestRunStep(self, test, cmd=None, workdir='build/trunk'): def AddCommonTestRunStep(self, test, cmd=None):
descriptor = [test] descriptor = [test]
if self.configuration == 'Debug' or self.configuration == 'both': if self.configuration == 'Debug' or self.configuration == 'both':
if cmd is None: if cmd is None:
cmd = ['build\Debug\%s.exe' % test] cmd = ['build\Debug\%s.exe' % test]
self.AddCommonStep(cmd, descriptor=descriptor, self.AddCommonStep(cmd, descriptor=descriptor,
halt_build_on_failure=False, workdir=workdir) halt_build_on_failure=False)
if self.configuration == 'Release' or self.configuration == 'both': if self.configuration == 'Release' or self.configuration == 'both':
if cmd is None: if cmd is None:
cmd = ['build\Release\%s.exe' % test] cmd = ['build\Release\%s.exe' % test]
self.AddCommonStep(cmd, descriptor=descriptor, self.AddCommonStep(cmd, descriptor=descriptor,
halt_build_on_failure=False, workdir=workdir) halt_build_on_failure=False)
# Utility functions # Utility functions