Index: buildbot/osuosl/master/config/builders.py =================================================================== --- buildbot/osuosl/master/config/builders.py +++ buildbot/osuosl/master/config/builders.py @@ -721,6 +721,12 @@ build_type="Debug", test_archs=['x86_64', 'i386'], test_compilers=['clang', 'totclang', 'gcc4.8.2'], + slave_hostname="lldb-buildslave-ubuntu-1404", + remote_host="lldb-remotetest-ubuntu-1410", + remote_port="5432", + remote_dir="/lldb-buildbot/remotetest", + remote_test_archs=['x86_64'], + remote_test_compilers=['clang'], env={'SHELL':"/bin/bash"})}, {'name': "lldb-x86_64-darwin-13.4", 'slavenames': ["lldb-x86_64-darwin-13.4"], Index: zorg/buildbot/builders/LLDBBuilder.py =================================================================== --- zorg/buildbot/builders/LLDBBuilder.py +++ zorg/buildbot/builders/LLDBBuilder.py @@ -237,6 +237,104 @@ workdir='%s/tools/lldb/test' % llvm_objdir)) return f +# Run Test with list of compilers and archs +def getLLDBTestSteps(f, + isRemoteTest, + bindir, + test_archs, + test_compilers, + remote_host=None, + remote_port=None, + remote_dir=None, + env=None): + # Skip test steps if no test compiler or arch is specified + if not test_archs or not test_compilers: + return f + llvm_srcdir = "llvm" + llvm_builddir = "build" + for compiler in test_compilers: + # find full path for top of tree clang + if compiler=='totclang': + compilerPath=bindir+'/clang' + else: + compilerPath = compiler + for arch in test_archs: + DOTEST_OPTS=''.join(['--executable ' + bindir + '/lldb ', + '-A %s ' % arch, + '-C %s ' % compilerPath, + '-s lldb-test-traces-%s-%s ' % (compiler, arch), + '-u CXXFLAGS ', + '-u CFLAGS']) + testname = "local" + if(isRemoteTest): + DOTEST_OPTS+=''.join([' --platform-name remote-linux ', + '--platform-url connect://%s:%s ' % (remote_host, remote_port), + '--platform-working-dir %s' % remote_dir]) + testname = "remote" + f.addStep(LitTestCommand(name="test lldb %s (%s-%s)" % (testname, compiler, arch), + command=['../%s/tools/lldb/test/dosep.py' % llvm_srcdir, + '--options', + WithProperties(DOTEST_OPTS)], + description="test lldb", + parseSummaryOnly=True, + workdir='%s' % llvm_builddir)) + f=cleanSVNSourceTree(f, '%s/tools/lldb' % llvm_srcdir) + return f + +# Add steps to run lldb test on remote target +def getLLDBRemoteTestSteps(f, + bindir, + slave_hostname, + remote_host, + remote_port, + remote_dir, + remote_test_archs, + remote_test_compilers, + env): + + if None in (remote_host, remote_port, remote_dir, remote_test_archs, remote_test_compilers): + return f + if slave_hostname is None: + slave_hostname='*' + llvm_srcdir = "llvm" + llvm_builddir = "build" + # rsync + f.addStep(ShellCommand(name="rsync lldb-server", + command="rsync -hav bin/lldb-server* %s:%s" % (remote_host, remote_dir), + description="rsync lldb-server", + haltOnFailure=True, + env=env, + workdir='%s' % llvm_builddir)) + f.addStep(ShellCommand(name="rsync python2.7", + command="rsync -havL lib/python2.7 %s:%s" % (remote_host, remote_dir), + description="rsync python2.7", + haltOnFailure=True, + env=env, + workdir='%s' % llvm_builddir)) + # launch lldb-server + f.addStep(ShellCommand(name="launch lldb-server", + command="ssh %s screen -d -m %s/lldb-server platform --listen %s:%s --server" % (remote_host, remote_dir, slave_hostname, remote_port), + description="launch lldb-server on remote host", + env=env, + haltOnFailure=True, + workdir='%s' % llvm_builddir)) + # test steps + f = getLLDBTestSteps(f, + True, + bindir, + remote_test_archs, + remote_test_compilers, + remote_host, + remote_port, + remote_dir, + env) + # terminate lldb-server on remote host + f.addStep(ShellCommand(name="terminate lldb-server", + command="ssh %s pkill lldb-server" % remote_host, + description="terminate lldb-server", + env=env, + workdir='%s' % llvm_builddir)) + return f # Cmake bulid on Ubuntu # Build command sequence - cmake, ninja, ./dosep @@ -246,6 +344,12 @@ build_type, test_archs=None, test_compilers=None, + slave_hostname=None, + remote_host=None, + remote_port=None, + remote_dir=None, + remote_test_archs=None, + remote_test_compilers=None, jobs='%(jobs)s', env=None, *args, @@ -256,6 +360,7 @@ llvm_srcdir = "llvm" llvm_builddir = "build" + bindir='%(builddir)s/' + llvm_builddir + '/bin' f = buildbot.process.factory.BuildFactory() @@ -282,7 +387,8 @@ # Clean Build Folder f.addStep(ShellCommand(name="clean", - command="rm -rf *", + command="echo a", + #command="rm -rf *", description="clear build folder", env=env, workdir='%s' % llvm_builddir)) @@ -298,38 +404,26 @@ env=env, haltOnFailure=True, workdir=llvm_builddir)) - # Skip lldb-test if no test compiler or arch is specified - if not test_archs or not test_compilers: - return f # TODO: it will be good to check that architectures listed in test_archs are compatible with host architecture # For now, the caller of this function should make sure that each target architecture is supported by builder machine - # Run Test with list of compilers and archs - bindir='%(builddir)s/' + llvm_builddir + '/bin' - - for compiler in test_compilers: - # find full path for top of tree clang - if compiler=='totclang': - compilerPath=bindir+'/clang' - else: - compilerPath = compiler - for arch in test_archs: - f.addStep(LitTestCommand(name="test lldb (%s-%s)" % (compiler, arch), - command=['../%s/tools/lldb/test/dosep.py' % llvm_srcdir, - '--options', - WithProperties(''.join(['-q ', - '--arch=%s ' % arch, - '--executable ' + bindir + '/lldb ', - '-C ' + compilerPath + ' ', - '-s lldb-test-traces-%s-%s ' % (compiler, arch), - '-u CXXFLAGS ', - '-u CFLAGS']))], - description="test lldb", - parseSummaryOnly=True, - env=env, - workdir='%s' % llvm_builddir)) - f=cleanSVNSourceTree(f, '%s/tools/lldb' % llvm_srcdir) + # Add local test steps + f = getLLDBTestSteps(f, + False, + bindir, + test_archs, + test_compilers) + # Remote test + f = getLLDBRemoteTestSteps(f, + bindir, + slave_hostname, + remote_host, + remote_port, + remote_dir, + remote_test_archs, + remote_test_compilers, + env) return f def getLLDBxcodebuildFactory(use_cc=None):