Index: buildbot/osuosl/master/config/builders.py =================================================================== --- buildbot/osuosl/master/config/builders.py +++ buildbot/osuosl/master/config/builders.py @@ -625,6 +625,8 @@ depends_on_projects=["llvm", "clang", "clang-tools-extra", "lld", "compiler-rt"], checks=["check"], enable_runtimes="auto", + runTestSuite=True, + jobs=96, extra_configure_args=[ "-DLLVM_ENABLE_ASSERTIONS=On", "-DCMAKE_C_COMPILER=clang", "-DCMAKE_CXX_COMPILER=clang++", Index: zorg/buildbot/builders/ClangBuilder.py =================================================================== --- zorg/buildbot/builders/ClangBuilder.py +++ zorg/buildbot/builders/ClangBuilder.py @@ -150,6 +150,7 @@ # Test-suite runTestSuite=False, + cmakeTestSuite=False, nt_flags=None, testsuite_flags=None, submitURL=None, @@ -179,7 +180,8 @@ checkout_compiler_rt=checkout_compiler_rt, checkout_libcxx=checkout_libcxx, checkout_flang=checkout_flang, - checkout_test_suite=checkout_test_suite) + checkout_test_suite=checkout_test_suite, + cmakeTestSuite=cmakeTestSuite) def _getClangCMakeBuildFactory( clean=True, @@ -204,6 +206,7 @@ testsuite_flags=None, submitURL=None, testerName=None, + cmakeTestSuite=False, # Environmental variables for all steps. env=None, @@ -465,10 +468,13 @@ workdir=stage2_build, env=env)) - # Get generated python, lnt - python = WithProperties('%(builddir)s/test/sandbox/bin/python') - lnt = WithProperties('%(builddir)s/test/sandbox/bin/lnt') - lnt_setup = WithProperties('%(builddir)s/test/lnt/setup.py') + if not cmakeTestSuite: + # Get generated python, lnt + python = WithProperties('%(builddir)s/test/sandbox/bin/python') + lnt = WithProperties('%(builddir)s/test/sandbox/bin/lnt') + lnt_setup = WithProperties('%(builddir)s/test/lnt/setup.py') + else: + lit = WithProperties('%(builddir)s/'+stage1_build+'/bin/llvm-lit') # Paths sandbox = WithProperties('%(builddir)s/test/sandbox') @@ -481,7 +487,7 @@ # LNT Command line (don't pass -jN. Users need to pass both --threads # and --build-threads in nt_flags/test_suite_flags to get the same effect) use_runtest_testsuite = len(nt_flags) == 0 - if not use_runtest_testsuite: + if not use_runtest_testsuite and not cmakeTestSuite: test_suite_cmd = [python, lnt, 'runtest', 'nt', '--no-timestamp', '--sandbox', sandbox, @@ -490,7 +496,7 @@ '--cxx', cxx] # Append any option provided by the user test_suite_cmd.extend(nt_flags) - else: + elif not cmakeTestSuite: lit = WithProperties('%(builddir)s/'+stage1_build+'/bin/llvm-lit') test_suite_cmd = [python, lnt, 'runtest', 'test-suite', '--no-timestamp', @@ -537,22 +543,44 @@ description='recreating sandbox', workdir='test', env=env)) - f.addStep(ShellCommand(name='setup lit', - command=[python, lnt_setup, 'develop'], - haltOnFailure=True, - description='setting up LNT in sandbox', - workdir='test/sandbox', - env=env)) - f.addStep(LitTestCommand( - name='test-suite', - command=test_suite_cmd, - haltOnFailure=True, - description=['running the test suite'], - workdir='test/sandbox', - logfiles={'configure.log' : 'build/configure.log', - 'build-tools.log' : 'build/build-tools.log', - 'test.log' : 'build/test.log', - 'report.json' : 'build/report.json'}, - env=test_suite_env)) + + if not cmakeTestSuite: + f.addStep(ShellCommand(name='setup lit', + command=[python, lnt_setup, 'develop'], + haltOnFailure=True, + description='setting up LNT in sandbox', + workdir='test/sandbox', + env=env)) + f.addStep(LitTestCommand( + name='test-suite', + command=test_suite_cmd, + haltOnFailure=True, + description=['running the test suite'], + workdir='test/sandbox', + logfiles={'configure.log' : 'build/configure.log', + 'build-tools.log' : 'build/build-tools.log', + 'test.log' : 'build/test.log', + 'report.json' : 'build/report.json'}, + env=test_suite_env)) + else: + f.addStep(ShellCommand(name='cmake Test Suite', + haltOnFailure=True, + description='Running cmake on Test Suite dir', + workdir='test/sandbox/test-suite', + command=[cmake, '-G', 'Unix Makefiles', + util.Interpolate('-DCMAKE_C_COMPILER=' + '%(prop:builddir)s/'+compiler_path+'/bin/clang'), + util.Interpolate('-DCMAKE_CXX_COMPILER=' + '%(prop:builddir)s/'+compiler_path+'/bin/clang++'), + '-DTEST_SUITE_LIT:FILEPATH=llvm-lit', + test_suite_dir])) + f.addStep(ShellCommand(name='make Test Suite', + command=['make', '-k', '-j20'], + haltOnFailure=True, + description='Running make on Test Suite dir', + workdir='test/sandbox/test-suite')) + f.addStep(ShellCommand(name='Run Test Suite with lit', + haltOnFailure=True, + description='Running test suite tests', + workdir='test/sandbox/test-suite', + command=[lit, '-v', '-j20', '.'])) return f Index: zorg/buildbot/builders/UnifiedTreeBuilder.py =================================================================== --- zorg/buildbot/builders/UnifiedTreeBuilder.py +++ zorg/buildbot/builders/UnifiedTreeBuilder.py @@ -1,3 +1,4 @@ +from zorg.buildbot.commands.AnnotatedCommand import HALT_ON_FAILURE from buildbot.plugins import steps, util from buildbot.steps.shell import SetPropertyFromCommand from buildbot.process.properties import WithProperties @@ -240,6 +241,50 @@ **kwargs # Pass through all the extra arguments. )) +def addTestSuiteStep( + f, + compiler_dir = None, + jobs = None, + env = None, + **kwargs): + + cc = util.Interpolate('-DCMAKE_C_COMPILER=' + '%(prop:builddir)s/'+compiler_dir+'/bin/clang') + cxx = util.Interpolate('-DCMAKE_CXX_COMPILER=' + '%(prop:builddir)s/'+compiler_dir+'/bin/clang++') + lit = util.Interpolate('%(prop:builddir)s/' + compiler_dir + '/bin/llvm-lit') + test_suite_src_dir = util.Interpolate('%(prop:builddir)s/' + 'test/test-suite') + cmake_lit_arg = util.Interpolate('-DTEST_SUITE_LIT:FILEPATH=' + '%(prop:builddir)s/' + compiler_dir + '/bin/llvm-lit') + test_suite_workdir='test/sandbox/test-suite' + options = [cc, cxx, cmake_lit_arg] + + f.addGetSourcecodeForProject( + project='test-suite', + src_dir=test_suite_src_dir, + alwaysUseLatest=True) + + f.addStep(CmakeCommand(name='cmake Test Suite', + haltOnFailure=True, + description='Running cmake on Test Suite dir', + workdir=test_suite_workdir, + options=options, + path=test_suite_src_dir, + generator='Ninja')) + + f.addStep(NinjaCommand(name='ninja Test Suite', + description='Running make on Test Suite dir', + haltOnFailure=True, + jobs=jobs, + workdir=test_suite_workdir)) + + f.addStep(LitTestCommand(name='Run Test Suite with lit', + haltOnFailure=True, + description='Running test suite tests', + workdir=test_suite_workdir, + command=[lit, '-v', '-j20', '.'], + env=env, + **kwargs)) + + return f + def getCmakeBuildFactory( depends_on_projects = None, enable_runtimes = None, @@ -283,6 +328,8 @@ clean = False, extra_configure_args = None, env = None, + runTestSuite = False, + jobs = None, **kwargs): # Make a local copy of the configure args, as we are going to modify that. @@ -326,6 +373,13 @@ install_dir=f.install_dir, env=merged_env, **kwargs) + if runTestSuite: + addTestSuiteStep( + f, + compiler_dir=f.obj_dir, + env=merged_env, + jobs=jobs, + **kwargs) return f