Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 1 | import os |
| 2 | |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 3 | import buildbot |
| 4 | import buildbot.process.factory |
| 5 | from buildbot.steps.source import SVN |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 6 | from buildbot.steps.shell import Configure, ShellCommand |
| 7 | from buildbot.steps.shell import WarningCountingShellCommand |
| 8 | from buildbot.steps.transfer import FileDownload |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 9 | from buildbot.process.properties import WithProperties |
| 10 | |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 11 | from zorg.buildbot.commands.ClangTestCommand import ClangTestCommand |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 12 | from zorg.buildbot.commands.BatchFileDownload import BatchFileDownload |
Daniel Dunbar | 22d594a | 2010-07-31 05:29:16 +0000 | [diff] [blame] | 13 | from zorg.buildbot.commands import DejaGNUCommand |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 14 | |
Daniel Dunbar | 2b67e8f | 2011-02-11 21:03:41 +0000 | [diff] [blame] | 15 | from zorg.buildbot.builders.Util import getConfigArgs |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 16 | |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 17 | def getClangBuildFactory( |
| 18 | triple=None, |
| 19 | clean=True, |
| 20 | test=True, |
| 21 | package_dst=None, |
| 22 | run_cxx_tests=False, |
| 23 | examples=False, |
| 24 | valgrind=False, |
| 25 | valgrindLeakCheck=False, |
| 26 | outOfDir=False, |
| 27 | useTwoStage=False, |
| 28 | completely_clean=False, |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 29 | make='make', |
| 30 | jobs="%(jobs)s", |
| 31 | stage1_config='Debug+Asserts', |
| 32 | stage2_config='Release+Asserts', |
| 33 | env={}, # Environmental variables for all steps. |
| 34 | extra_configure_args=[], |
| 35 | use_pty_in_tests=False, |
Peter Collingbourne | d49ac28 | 2011-10-25 14:38:45 +0000 | [diff] [blame] | 36 | trunk_revision=None, |
| 37 | force_checkout=False, |
Peter Collingbourne | 7a95b0c | 2011-10-26 16:40:17 +0000 | [diff] [blame] | 38 | extra_clean_step=None, |
David Blaikie | a76da84 | 2012-08-13 22:24:46 +0000 | [diff] [blame] | 39 | checkout_compiler_rt=False, |
| 40 | run_gdb=False, |
David Blaikie | dad03d5 | 2012-11-16 22:37:12 +0000 | [diff] [blame] | 41 | run_modern_gdb=False, |
David Blaikie | 54d498b | 2012-12-04 21:02:38 +0000 | [diff] [blame] | 42 | run_gcc=False, |
| 43 | baseline_modern_gdb=True): |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 44 | # Prepare environmental variables. Set here all env we want everywhere. |
| 45 | merged_env = { |
| 46 | 'TERM' : 'dumb' # Make sure Clang doesn't use color escape sequences. |
| 47 | } |
| 48 | if env is not None: |
| 49 | # Overwrite pre-set items with the given ones, so user can set anything. |
| 50 | merged_env.update(env) |
David Blaikie | 2f7eb28 | 2012-08-24 18:37:00 +0000 | [diff] [blame] | 51 | |
David Blaikie | dad03d5 | 2012-11-16 22:37:12 +0000 | [diff] [blame] | 52 | if run_gdb or run_gcc or run_modern_gdb: |
David Blaikie | 88511c7 | 2012-08-24 23:14:06 +0000 | [diff] [blame] | 53 | outOfDir = True |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 54 | |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 55 | # Don't use in-dir builds with a two stage build process. |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 56 | inDir = not outOfDir and not useTwoStage |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 57 | if inDir: |
| 58 | llvm_srcdir = "llvm" |
| 59 | llvm_1_objdir = "llvm" |
David Blaikie | 88511c7 | 2012-08-24 23:14:06 +0000 | [diff] [blame] | 60 | llvm_1_installdir = None |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 61 | else: |
| 62 | llvm_srcdir = "llvm.src" |
| 63 | llvm_1_objdir = "llvm.obj" |
| 64 | llvm_1_installdir = "llvm.install.1" |
| 65 | llvm_2_objdir = "llvm.obj.2" |
Daniel Dunbar | 22d594a | 2010-07-31 05:29:16 +0000 | [diff] [blame] | 66 | llvm_2_installdir = "llvm.install" |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 67 | |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 68 | f = buildbot.process.factory.BuildFactory() |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 69 | |
| 70 | # Determine the build directory. |
| 71 | f.addStep(buildbot.steps.shell.SetProperty(name="get_builddir", |
| 72 | command=["pwd"], |
| 73 | property="builddir", |
| 74 | description="set build dir", |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 75 | workdir=".", |
| 76 | env=merged_env)) |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 77 | |
Daniel Dunbar | 06b20f1 | 2010-04-08 18:29:38 +0000 | [diff] [blame] | 78 | # Blow away completely, if requested. |
| 79 | if completely_clean: |
| 80 | f.addStep(ShellCommand(name="rm-llvm.src", |
| 81 | command=["rm", "-rf", llvm_srcdir], |
| 82 | haltOnFailure=True, |
| 83 | description=["rm src dir", "llvm"], |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 84 | workdir=".", |
| 85 | env=merged_env)) |
Daniel Dunbar | 06b20f1 | 2010-04-08 18:29:38 +0000 | [diff] [blame] | 86 | |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 87 | # Checkout sources. |
Peter Collingbourne | d49ac28 | 2011-10-25 14:38:45 +0000 | [diff] [blame] | 88 | if trunk_revision: |
| 89 | # The SVN build step provides no mechanism to check out a specific revision |
| 90 | # based on a property, so just run the commands directly here. |
| 91 | svn_co = ['svn', 'checkout'] |
| 92 | if force_checkout: |
| 93 | svn_co += ['--force'] |
| 94 | svn_co += ['--revision', WithProperties(trunk_revision)] |
| 95 | |
| 96 | svn_co_llvm = svn_co + \ |
| 97 | [WithProperties('http://llvm.org/svn/llvm-project/llvm/trunk@%s' % |
| 98 | trunk_revision), |
| 99 | llvm_srcdir] |
| 100 | svn_co_clang = svn_co + \ |
| 101 | [WithProperties('http://llvm.org/svn/llvm-project/cfe/trunk@%s' % |
| 102 | trunk_revision), |
| 103 | '%s/tools/clang' % llvm_srcdir] |
David Blaikie | 845ae0d | 2012-08-10 00:51:38 +0000 | [diff] [blame] | 104 | svn_co_clang_tools_extra = svn_co + \ |
| 105 | [WithProperties('http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@%s' % |
| 106 | trunk_revision), |
| 107 | '%s/tools/clang/tools/extra' % llvm_srcdir] |
Peter Collingbourne | d49ac28 | 2011-10-25 14:38:45 +0000 | [diff] [blame] | 108 | |
| 109 | f.addStep(ShellCommand(name='svn-llvm', |
| 110 | command=svn_co_llvm, |
| 111 | haltOnFailure=True, |
| 112 | workdir='.')) |
| 113 | f.addStep(ShellCommand(name='svn-clang', |
| 114 | command=svn_co_clang, |
| 115 | haltOnFailure=True, |
| 116 | workdir='.')) |
David Blaikie | 845ae0d | 2012-08-10 00:51:38 +0000 | [diff] [blame] | 117 | f.addStep(ShellCommand(name='svn-clang-tools-extra', |
| 118 | command=svn_co_clang_tools_extra, |
| 119 | haltOnFailure=True, |
| 120 | workdir='.')) |
Peter Collingbourne | d49ac28 | 2011-10-25 14:38:45 +0000 | [diff] [blame] | 121 | else: |
| 122 | f.addStep(SVN(name='svn-llvm', |
Daniel Dunbar | f4e23eb | 2010-09-20 21:13:02 +0000 | [diff] [blame] | 123 | mode='update', |
Peter Collingbourne | d49ac28 | 2011-10-25 14:38:45 +0000 | [diff] [blame] | 124 | baseURL='http://llvm.org/svn/llvm-project/llvm/', |
Daniel Dunbar | f4e23eb | 2010-09-20 21:13:02 +0000 | [diff] [blame] | 125 | defaultBranch='trunk', |
Peter Collingbourne | d49ac28 | 2011-10-25 14:38:45 +0000 | [diff] [blame] | 126 | workdir=llvm_srcdir)) |
| 127 | f.addStep(SVN(name='svn-clang', |
| 128 | mode='update', |
| 129 | baseURL='http://llvm.org/svn/llvm-project/cfe/', |
| 130 | defaultBranch='trunk', |
| 131 | workdir='%s/tools/clang' % llvm_srcdir)) |
David Blaikie | 845ae0d | 2012-08-10 00:51:38 +0000 | [diff] [blame] | 132 | f.addStep(SVN(name='svn-clang-tools-extra', |
| 133 | mode='update', |
| 134 | baseURL='http://llvm.org/svn/llvm-project/clang-tools-extra/', |
| 135 | defaultBranch='trunk', |
| 136 | workdir='%s/tools/clang/tools/extra' % llvm_srcdir)) |
Peter Collingbourne | d49ac28 | 2011-10-25 14:38:45 +0000 | [diff] [blame] | 137 | if checkout_compiler_rt: |
| 138 | f.addStep(SVN(name='svn-compiler-rt', |
| 139 | mode='update', |
| 140 | baseURL='http://llvm.org/svn/llvm-project/compiler-rt/', |
| 141 | defaultBranch='trunk', |
| 142 | workdir='%s/projects/compiler-rt' % llvm_srcdir)) |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 143 | |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 144 | # Clean up llvm (stage 1); unless in-dir. |
| 145 | if clean and llvm_srcdir != llvm_1_objdir: |
| 146 | f.addStep(ShellCommand(name="rm-llvm.obj.stage1", |
| 147 | command=["rm", "-rf", llvm_1_objdir], |
| 148 | haltOnFailure=True, |
| 149 | description=["rm build dir", "llvm"], |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 150 | workdir=".", |
| 151 | env=merged_env)) |
Andrew Trick | 70fa9d2 | 2011-08-25 23:38:51 +0000 | [diff] [blame] | 152 | |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 153 | # Force without llvm-gcc so we don't run afoul of Frontend test failures. |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 154 | base_configure_args = [WithProperties("%%(builddir)s/%s/configure" % llvm_srcdir), |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 155 | '--disable-bindings'] |
| 156 | base_configure_args += extra_configure_args |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 157 | if triple: |
Andrew Trick | 70fa9d2 | 2011-08-25 23:38:51 +0000 | [diff] [blame] | 158 | base_configure_args += ['--build=%s' % triple, |
David Dean | 7da2286 | 2012-10-01 19:57:30 +0000 | [diff] [blame] | 159 | '--host=%s' % triple] |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 160 | args = base_configure_args + ["--without-llvmgcc", "--without-llvmgxx"] |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 161 | args.append(WithProperties("--prefix=%%(builddir)s/%s" % llvm_1_installdir)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 162 | args += getConfigArgs(stage1_config) |
| 163 | f.addStep(Configure(command=args, |
| 164 | workdir=llvm_1_objdir, |
| 165 | description=['configuring',stage1_config], |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 166 | descriptionDone=['configure',stage1_config], |
| 167 | env=merged_env)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 168 | |
| 169 | # Make clean if using in-dir builds. |
| 170 | if clean and llvm_srcdir == llvm_1_objdir: |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 171 | f.addStep(WarningCountingShellCommand(name="clean-llvm", |
Daniel Dunbar | d20468a | 2009-11-24 18:27:23 +0000 | [diff] [blame] | 172 | command=[make, "clean"], |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 173 | haltOnFailure=True, |
| 174 | description="cleaning llvm", |
| 175 | descriptionDone="clean llvm", |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 176 | workdir=llvm_1_objdir, |
Peter Collingbourne | 7a95b0c | 2011-10-26 16:40:17 +0000 | [diff] [blame] | 177 | doStepIf=clean, |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 178 | env=merged_env)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 179 | |
Peter Collingbourne | 7a95b0c | 2011-10-26 16:40:17 +0000 | [diff] [blame] | 180 | if extra_clean_step: |
| 181 | f.addStep(extra_clean_step) |
| 182 | |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 183 | f.addStep(WarningCountingShellCommand(name="compile", |
Daniel Dunbar | d20468a | 2009-11-24 18:27:23 +0000 | [diff] [blame] | 184 | command=['nice', '-n', '10', |
| 185 | make, WithProperties("-j%s" % jobs)], |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 186 | haltOnFailure=True, |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 187 | description=["compiling", stage1_config], |
| 188 | descriptionDone=["compile", stage1_config], |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 189 | workdir=llvm_1_objdir, |
| 190 | env=merged_env)) |
Daniel Dunbar | 256fed4 | 2009-11-25 21:11:08 +0000 | [diff] [blame] | 191 | |
| 192 | if examples: |
| 193 | f.addStep(WarningCountingShellCommand(name="compile.examples", |
| 194 | command=['nice', '-n', '10', |
| 195 | make, WithProperties("-j%s" % jobs), |
| 196 | "BUILD_EXAMPLES=1"], |
| 197 | haltOnFailure=True, |
| 198 | description=["compilinge", stage1_config, "examples"], |
| 199 | descriptionDone=["compile", stage1_config, "examples"], |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 200 | workdir=llvm_1_objdir, |
| 201 | env=merged_env)) |
Daniel Dunbar | 256fed4 | 2009-11-25 21:11:08 +0000 | [diff] [blame] | 202 | |
Daniel Dunbar | 93f828a | 2010-06-23 17:42:14 +0000 | [diff] [blame] | 203 | clangTestArgs = llvmTestArgs = '-v -j %s' % jobs |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 204 | if valgrind: |
Daniel Dunbar | 89184b9 | 2010-04-18 19:09:32 +0000 | [diff] [blame] | 205 | clangTestArgs += ' --vg' |
Daniel Dunbar | a1bebce | 2010-03-21 01:24:00 +0000 | [diff] [blame] | 206 | if valgrindLeakCheck: |
| 207 | clangTestArgs += ' --vg-leak' |
Nick Lewycky | 8d26e47 | 2011-08-27 21:18:56 +0000 | [diff] [blame] | 208 | clangTestArgs += ' --vg-arg --suppressions=%(builddir)s/llvm/tools/clang/utils/valgrind/x86_64-pc-linux-gnu_gcc-4.3.3.supp --vg-arg --suppressions=%(builddir)s/llvm/utils/valgrind/x86_64-pc-linux-gnu.supp' |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 209 | extraTestDirs = '' |
| 210 | if run_cxx_tests: |
| 211 | extraTestDirs += '%(builddir)s/llvm/tools/clang/utils/C++Tests' |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 212 | if test: |
David Blaikie | 7e6f8a1 | 2012-08-31 20:46:27 +0000 | [diff] [blame] | 213 | f.addStep(ClangTestCommand(name='check-all', |
| 214 | command=[make, "check-all", "VERBOSE=1", |
Daniel Dunbar | 93f828a | 2010-06-23 17:42:14 +0000 | [diff] [blame] | 215 | WithProperties("LIT_ARGS=%s" % llvmTestArgs)], |
David Blaikie | 7e6f8a1 | 2012-08-31 20:46:27 +0000 | [diff] [blame] | 216 | description=["checking"], |
| 217 | descriptionDone=["checked"], |
Daniel Dunbar | 469e8ca | 2010-05-19 21:26:48 +0000 | [diff] [blame] | 218 | workdir=llvm_1_objdir, |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 219 | usePTY=use_pty_in_tests, |
| 220 | env=merged_env)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 221 | |
| 222 | # Install llvm and clang. |
| 223 | if llvm_1_installdir: |
Daniel Dunbar | 9870de3 | 2010-03-28 22:25:31 +0000 | [diff] [blame] | 224 | f.addStep(ShellCommand(name="rm-install.clang.stage1", |
| 225 | command=["rm", "-rf", llvm_1_installdir], |
| 226 | haltOnFailure=True, |
| 227 | description=["rm install dir", "clang"], |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 228 | workdir=".", |
| 229 | env=merged_env)) |
Daniel Dunbar | 9870de3 | 2010-03-28 22:25:31 +0000 | [diff] [blame] | 230 | f.addStep(WarningCountingShellCommand(name="install.clang.stage1", |
| 231 | command = ['nice', '-n', '10', |
| 232 | make, 'install-clang'], |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 233 | haltOnFailure=True, |
Daniel Dunbar | 9870de3 | 2010-03-28 22:25:31 +0000 | [diff] [blame] | 234 | description=["install", "clang", |
| 235 | stage1_config], |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 236 | workdir=llvm_1_objdir, |
| 237 | env=merged_env)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 238 | |
David Blaikie | dad03d5 | 2012-11-16 22:37:12 +0000 | [diff] [blame] | 239 | if run_gdb or run_gcc or run_modern_gdb: |
David Blaikie | a76da84 | 2012-08-13 22:24:46 +0000 | [diff] [blame] | 240 | ignores = getClangTestsIgnoresFromPath(os.path.expanduser('~/public/clang-tests'), 'clang-x86_64-darwin10') |
| 241 | install_prefix = "%%(builddir)s/%s" % llvm_1_installdir |
| 242 | if run_gdb: |
| 243 | addClangGDBTests(f, ignores, install_prefix) |
David Blaikie | dad03d5 | 2012-11-16 22:37:12 +0000 | [diff] [blame] | 244 | if run_modern_gdb: |
David Blaikie | 54d498b | 2012-12-04 21:02:38 +0000 | [diff] [blame] | 245 | addModernClangGDBTests(f, jobs, install_prefix, baseline_modern_gdb) |
David Blaikie | a76da84 | 2012-08-13 22:24:46 +0000 | [diff] [blame] | 246 | if run_gcc: |
| 247 | addClangGCCTests(f, ignores, install_prefix) |
| 248 | |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 249 | if not useTwoStage: |
Daniel Dunbar | dedf657 | 2010-11-13 00:23:34 +0000 | [diff] [blame] | 250 | if package_dst: |
| 251 | name = WithProperties( |
| 252 | "%(builddir)s/" + llvm_1_objdir + |
| 253 | "/clang-r%(got_revision)s-b%(buildnumber)s.tgz") |
| 254 | f.addStep(ShellCommand(name='pkg.tar', |
| 255 | description="tar root", |
| 256 | command=["tar", "zcvf", name, "./"], |
| 257 | workdir=llvm_1_installdir, |
| 258 | warnOnFailure=True, |
| 259 | flunkOnFailure=False, |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 260 | haltOnFailure=False, |
| 261 | env=merged_env)) |
Daniel Dunbar | dedf657 | 2010-11-13 00:23:34 +0000 | [diff] [blame] | 262 | f.addStep(ShellCommand(name='pkg.upload', |
Andrew Trick | 70fa9d2 | 2011-08-25 23:38:51 +0000 | [diff] [blame] | 263 | description="upload root", |
Daniel Dunbar | dedf657 | 2010-11-13 00:23:34 +0000 | [diff] [blame] | 264 | command=["scp", name, |
| 265 | WithProperties( |
| 266 | package_dst + "/%(buildername)s")], |
| 267 | workdir=".", |
| 268 | warnOnFailure=True, |
| 269 | flunkOnFailure=False, |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 270 | haltOnFailure=False, |
| 271 | env=merged_env)) |
Daniel Dunbar | dedf657 | 2010-11-13 00:23:34 +0000 | [diff] [blame] | 272 | |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 273 | return f |
| 274 | |
| 275 | # Clean up llvm (stage 2). |
| 276 | if clean: |
| 277 | f.addStep(ShellCommand(name="rm-llvm.obj.stage2", |
| 278 | command=["rm", "-rf", llvm_2_objdir], |
| 279 | haltOnFailure=True, |
| 280 | description=["rm build dir", "llvm", "(stage 2)"], |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 281 | workdir=".", |
| 282 | env=merged_env)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 283 | |
| 284 | # Configure llvm (stage 2). |
| 285 | args = base_configure_args + ["--without-llvmgcc", "--without-llvmgxx"] |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 286 | args.append(WithProperties("--prefix=%(builddir)s/" + llvm_2_installdir)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 287 | args += getConfigArgs(stage2_config) |
Benjamin Kramer | 9c6fed7 | 2012-07-20 10:18:32 +0000 | [diff] [blame] | 288 | local_env = dict(merged_env) |
| 289 | local_env.update({ |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 290 | 'CC' : WithProperties("%%(builddir)s/%s/bin/clang" % llvm_1_installdir), |
| 291 | 'CXX' : WithProperties("%%(builddir)s/%s/bin/clang++" % llvm_1_installdir)}) |
| 292 | |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 293 | f.addStep(Configure(name="configure.llvm.stage2", |
| 294 | command=args, |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 295 | haltOnFailure=True, |
| 296 | workdir=llvm_2_objdir, |
| 297 | description=["configure", "llvm", "(stage 2)", |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 298 | stage2_config], |
| 299 | env=local_env)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 300 | |
| 301 | # Build llvm (stage 2). |
| 302 | f.addStep(WarningCountingShellCommand(name="compile.llvm.stage2", |
| 303 | command=['nice', '-n', '10', |
| 304 | make, WithProperties("-j%s" % jobs)], |
| 305 | haltOnFailure=True, |
| 306 | description=["compiling", "(stage 2)", |
| 307 | stage2_config], |
| 308 | descriptionDone=["compile", "(stage 2)", |
| 309 | stage2_config], |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 310 | workdir=llvm_2_objdir, |
| 311 | env=merged_env)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 312 | |
| 313 | if test: |
David Blaikie | 7e6f8a1 | 2012-08-31 20:46:27 +0000 | [diff] [blame] | 314 | f.addStep(ClangTestCommand(name='check-all', |
| 315 | command=[make, "check-all", "VERBOSE=1", |
Daniel Dunbar | 93f828a | 2010-06-23 17:42:14 +0000 | [diff] [blame] | 316 | WithProperties("LIT_ARGS=%s" % llvmTestArgs)], |
David Blaikie | 7e6f8a1 | 2012-08-31 20:46:27 +0000 | [diff] [blame] | 317 | description=["checking"], |
| 318 | descriptionDone=["checked"], |
Daniel Dunbar | 469e8ca | 2010-05-19 21:26:48 +0000 | [diff] [blame] | 319 | workdir=llvm_2_objdir, |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 320 | usePTY=use_pty_in_tests, |
| 321 | env=merged_env)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 322 | |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 323 | # Install clang (stage 2). |
Daniel Dunbar | 9870de3 | 2010-03-28 22:25:31 +0000 | [diff] [blame] | 324 | f.addStep(ShellCommand(name="rm-install.clang.stage2", |
| 325 | command=["rm", "-rf", llvm_2_installdir], |
| 326 | haltOnFailure=True, |
| 327 | description=["rm install dir", "clang"], |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 328 | workdir=".", |
| 329 | env=merged_env)) |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 330 | f.addStep(WarningCountingShellCommand(name="install.clang.stage2", |
| 331 | command = ['nice', '-n', '10', |
| 332 | make, 'install-clang'], |
| 333 | haltOnFailure=True, |
| 334 | description=["install", "clang", |
| 335 | "(stage 2)"], |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 336 | workdir=llvm_2_objdir, |
| 337 | env=merged_env)) |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 338 | |
| 339 | if package_dst: |
| 340 | name = WithProperties( |
| 341 | "%(builddir)s/" + llvm_2_objdir + |
| 342 | "/clang-r%(got_revision)s-b%(buildnumber)s.tgz") |
| 343 | f.addStep(ShellCommand(name='pkg.tar', |
| 344 | description="tar root", |
| 345 | command=["tar", "zcvf", name, "./"], |
| 346 | workdir=llvm_2_installdir, |
| 347 | warnOnFailure=True, |
| 348 | flunkOnFailure=False, |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 349 | haltOnFailure=False, |
| 350 | env=merged_env)) |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 351 | f.addStep(ShellCommand(name='pkg.upload', |
Andrew Trick | 70fa9d2 | 2011-08-25 23:38:51 +0000 | [diff] [blame] | 352 | description="upload root", |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 353 | command=["scp", name, |
| 354 | WithProperties( |
| 355 | package_dst + "/%(buildername)s")], |
| 356 | workdir=".", |
| 357 | warnOnFailure=True, |
| 358 | flunkOnFailure=False, |
Galina Kistanova | f4d7935 | 2011-10-20 20:46:52 +0000 | [diff] [blame] | 359 | haltOnFailure=False, |
| 360 | env=merged_env)) |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 361 | |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 362 | return f |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 363 | |
Daniel Dunbar | c51a59e | 2010-09-23 14:57:45 +0000 | [diff] [blame] | 364 | def getClangMSVCBuildFactory(update=True, clean=True, vcDrive='c', jobs=1, cmake=r"cmake"): |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 365 | f = buildbot.process.factory.BuildFactory() |
| 366 | |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 367 | if update: |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 368 | f.addStep(SVN(name='svn-llvm', |
| 369 | mode='update', baseURL='http://llvm.org/svn/llvm-project/llvm/', |
| 370 | defaultBranch='trunk', |
| 371 | workdir='llvm')) |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 372 | f.addStep(SVN(name='svn-clang', |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 373 | mode='update', baseURL='http://llvm.org/svn/llvm-project/cfe/', |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 374 | defaultBranch='trunk', |
| 375 | workdir='llvm/tools/clang')) |
David Blaikie | 845ae0d | 2012-08-10 00:51:38 +0000 | [diff] [blame] | 376 | f.addStep(SVN(name='svn-clang-tools-extra', |
| 377 | mode='update', baseURL='http://llvm.org/svn/llvm-project/clang-tools-extra/', |
| 378 | defaultBranch='trunk', |
| 379 | workdir='llvm/tools/clang/tools/extra')) |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 380 | |
| 381 | # Full & fast clean. |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 382 | if clean: |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 383 | f.addStep(ShellCommand(name='clean-1', |
| 384 | command=['del','/s/q','build'], |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 385 | warnOnFailure=True, |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 386 | description='cleaning', |
| 387 | descriptionDone='clean', |
| 388 | workdir='llvm')) |
| 389 | f.addStep(ShellCommand(name='clean-2', |
| 390 | command=['rmdir','/s/q','build'], |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 391 | warnOnFailure=True, |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 392 | description='cleaning', |
| 393 | descriptionDone='clean', |
| 394 | workdir='llvm')) |
| 395 | |
| 396 | # Create the project files. |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 397 | |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 398 | # Use batch files instead of ShellCommand directly, Windows quoting is |
| 399 | # borked. FIXME: See buildbot ticket #595 and buildbot ticket #377. |
| 400 | f.addStep(BatchFileDownload(name='cmakegen', |
Daniel Dunbar | 06b20f1 | 2010-04-08 18:29:38 +0000 | [diff] [blame] | 401 | command=[cmake, |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 402 | "-DLLVM_TARGETS_TO_BUILD:=X86", |
Daniel Dunbar | 1ddedce | 2010-09-24 19:57:34 +0000 | [diff] [blame] | 403 | "-DLLVM_INCLUDE_EXAMPLES:=OFF", |
| 404 | "-DLLVM_INCLUDE_TESTS:=OFF", |
| 405 | "-DLLVM_TARGETS_TO_BUILD:=X86", |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 406 | "-G", |
| 407 | "Visual Studio 9 2008", |
| 408 | ".."], |
| 409 | workdir="llvm\\build")) |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 410 | f.addStep(ShellCommand(name='cmake', |
| 411 | command=['cmakegen.bat'], |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 412 | haltOnFailure=True, |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 413 | description='cmake gen', |
| 414 | workdir='llvm\\build')) |
| 415 | |
| 416 | # Build it. |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 417 | f.addStep(BatchFileDownload(name='vcbuild', |
| 418 | command=[vcDrive + r""":\Program Files\Microsoft Visual Studio 9.0\VC\VCPackages\vcbuild.exe""", |
| 419 | "/M%d" % jobs, |
| 420 | "LLVM.sln", |
| 421 | "Debug|Win32"], |
| 422 | workdir="llvm\\build")) |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 423 | f.addStep(WarningCountingShellCommand(name='vcbuild', |
| 424 | command=['vcbuild.bat'], |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 425 | haltOnFailure=True, |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 426 | description='vcbuild', |
| 427 | workdir='llvm\\build', |
| 428 | warningPattern=" warning C.*:")) |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 429 | |
| 430 | # Build clang-test project. |
| 431 | f.addStep(BatchFileDownload(name='vcbuild_test', |
| 432 | command=[vcDrive + r""":\Program Files\Microsoft Visual Studio 9.0\VC\VCPackages\vcbuild.exe""", |
| 433 | "clang-test.vcproj", |
| 434 | "Debug|Win32"], |
| 435 | workdir="llvm\\build\\tools\\clang\\test")) |
| 436 | f.addStep(ClangTestCommand(name='test-clang', |
| 437 | command=["vcbuild_test.bat"], |
| 438 | workdir="llvm\\build\\tools\\clang\\test")) |
| 439 | |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 440 | return f |
Daniel Dunbar | 22d594a | 2010-07-31 05:29:16 +0000 | [diff] [blame] | 441 | |
Galina Kistanova | 2a97a3b | 2012-06-06 20:50:33 +0000 | [diff] [blame] | 442 | # Builds on Windows using CMake, MinGW(32|64), and no Microsoft tools. |
Galina Kistanova | 5e97edf | 2012-06-19 20:10:21 +0000 | [diff] [blame] | 443 | def getClangMinGWBuildFactory(update=True, clean=True, jobs=6, cmake=r"cmake"): |
Galina Kistanova | 2a97a3b | 2012-06-06 20:50:33 +0000 | [diff] [blame] | 444 | f = buildbot.process.factory.BuildFactory() |
| 445 | |
| 446 | if update: |
| 447 | f.addStep(SVN(name='svn-llvm', |
| 448 | mode='update', baseURL='http://llvm.org/svn/llvm-project/llvm/', |
| 449 | defaultBranch='trunk', |
| 450 | workdir='llvm')) |
Galina Kistanova | 2a97a3b | 2012-06-06 20:50:33 +0000 | [diff] [blame] | 451 | f.addStep(SVN(name='svn-clang', |
| 452 | mode='update', baseURL='http://llvm.org/svn/llvm-project/cfe/', |
| 453 | defaultBranch='trunk', |
| 454 | workdir='llvm/tools/clang')) |
David Blaikie | 845ae0d | 2012-08-10 00:51:38 +0000 | [diff] [blame] | 455 | f.addStep(SVN(name='svn-clang-tools-extra', |
| 456 | mode='update', baseURL='http://llvm.org/svn/llvm-project/clang-tools-extra/', |
| 457 | defaultBranch='trunk', |
| 458 | workdir='llvm/tools/clang/tools/extra')) |
Galina Kistanova | 2a97a3b | 2012-06-06 20:50:33 +0000 | [diff] [blame] | 459 | |
| 460 | # Full & fast clean. |
| 461 | if clean: |
| 462 | # note: This command is redundant as the next command removes everything |
| 463 | f.addStep(ShellCommand(name='clean-1', |
| 464 | command=['del','/s/q','build'], |
| 465 | warnOnFailure=True, |
| 466 | description='cleaning', |
| 467 | descriptionDone='clean', |
| 468 | workdir='llvm')) |
| 469 | f.addStep(ShellCommand(name='clean-2', |
| 470 | command=['rmdir','/s/q','build'], |
| 471 | warnOnFailure=True, |
| 472 | description='cleaning', |
| 473 | descriptionDone='clean', |
| 474 | workdir='llvm')) |
| 475 | |
| 476 | # Create the Makefiles. |
| 477 | |
| 478 | # Use batch files instead of ShellCommand directly, Windows quoting is |
| 479 | # borked. FIXME: See buildbot ticket #595 and buildbot ticket #377. |
| 480 | f.addStep(BatchFileDownload(name='cmakegen', |
| 481 | command=[cmake, |
| 482 | "-DLLVM_TARGETS_TO_BUILD:=X86", |
| 483 | "-DLLVM_INCLUDE_EXAMPLES:=OFF", |
| 484 | "-DLLVM_INCLUDE_TESTS:=OFF", |
| 485 | "-DLLVM_TARGETS_TO_BUILD:=X86", |
| 486 | "-G", |
Galina Kistanova | 5e97edf | 2012-06-19 20:10:21 +0000 | [diff] [blame] | 487 | "Ninja", |
Galina Kistanova | 2a97a3b | 2012-06-06 20:50:33 +0000 | [diff] [blame] | 488 | ".."], |
| 489 | workdir="llvm\\build")) |
| 490 | f.addStep(ShellCommand(name='cmake', |
| 491 | command=['cmakegen.bat'], |
| 492 | haltOnFailure=True, |
| 493 | description='cmake gen', |
| 494 | workdir='llvm\\build')) |
| 495 | |
| 496 | # Build it. |
| 497 | f.addStep(BatchFileDownload(name='makeall', |
Galina Kistanova | 5e97edf | 2012-06-19 20:10:21 +0000 | [diff] [blame] | 498 | command=["ninja", "-j", "%d" % jobs], |
Galina Kistanova | 2a97a3b | 2012-06-06 20:50:33 +0000 | [diff] [blame] | 499 | haltOnFailure=True, |
| 500 | workdir='llvm\\build')) |
| 501 | |
| 502 | f.addStep(WarningCountingShellCommand(name='makeall', |
| 503 | command=['makeall.bat'], |
| 504 | haltOnFailure=True, |
| 505 | description='makeall', |
| 506 | workdir='llvm\\build')) |
| 507 | |
Galina Kistanova | 5e97edf | 2012-06-19 20:10:21 +0000 | [diff] [blame] | 508 | # Build global check project (make check) (sources not checked out...). |
| 509 | if 0: |
| 510 | f.addStep(BatchFileDownload(name='makecheck', |
| 511 | command=["ninja", "check"], |
| 512 | workdir='llvm\\build')) |
| 513 | f.addStep(WarningCountingShellCommand(name='check', |
| 514 | command=['makecheck.bat'], |
| 515 | description='make check', |
| 516 | workdir='llvm\\build')) |
Galina Kistanova | 049d76c | 2012-06-09 00:56:05 +0000 | [diff] [blame] | 517 | |
| 518 | # Build clang-test project (make clang-test). |
Galina Kistanova | 2a97a3b | 2012-06-06 20:50:33 +0000 | [diff] [blame] | 519 | f.addStep(BatchFileDownload(name='maketest', |
Galina Kistanova | 5e97edf | 2012-06-19 20:10:21 +0000 | [diff] [blame] | 520 | command=["ninja", "clang-test"], |
Galina Kistanova | 049d76c | 2012-06-09 00:56:05 +0000 | [diff] [blame] | 521 | workdir="llvm\\build")) |
| 522 | f.addStep(ClangTestCommand(name='clang-test', |
Galina Kistanova | 2a97a3b | 2012-06-06 20:50:33 +0000 | [diff] [blame] | 523 | command=["maketest.bat"], |
Galina Kistanova | 049d76c | 2012-06-09 00:56:05 +0000 | [diff] [blame] | 524 | workdir="llvm\\build")) |
Galina Kistanova | 2a97a3b | 2012-06-06 20:50:33 +0000 | [diff] [blame] | 525 | |
| 526 | return f |
| 527 | |
Daniel Dunbar | 7363d03 | 2011-02-27 03:22:35 +0000 | [diff] [blame] | 528 | def addClangGCCTests(f, ignores={}, install_prefix="%(builddir)s/llvm.install", |
| 529 | languages = ('gcc', 'g++', 'objc', 'obj-c++')): |
Daniel Dunbar | 22d594a | 2010-07-31 05:29:16 +0000 | [diff] [blame] | 530 | make_vars = [WithProperties( |
Daniel Dunbar | 2b67e8f | 2011-02-11 21:03:41 +0000 | [diff] [blame] | 531 | 'CC_UNDER_TEST=%s/bin/clang' % install_prefix), |
Daniel Dunbar | 22d594a | 2010-07-31 05:29:16 +0000 | [diff] [blame] | 532 | WithProperties( |
Daniel Dunbar | 2b67e8f | 2011-02-11 21:03:41 +0000 | [diff] [blame] | 533 | 'CXX_UNDER_TEST=%s/bin/clang++' % install_prefix)] |
Daniel Dunbar | 22d594a | 2010-07-31 05:29:16 +0000 | [diff] [blame] | 534 | f.addStep(SVN(name='svn-clang-tests', mode='update', |
| 535 | baseURL='http://llvm.org/svn/llvm-project/clang-tests/', |
| 536 | defaultBranch='trunk', workdir='clang-tests')) |
| 537 | gcc_dg_ignores = ignores.get('gcc-4_2-testsuite', {}) |
Daniel Dunbar | 2b67e8f | 2011-02-11 21:03:41 +0000 | [diff] [blame] | 538 | for lang in languages: |
Daniel Dunbar | 22d594a | 2010-07-31 05:29:16 +0000 | [diff] [blame] | 539 | f.addStep(DejaGNUCommand.DejaGNUCommand( |
| 540 | name='test-gcc-4_2-testsuite-%s' % lang, |
| 541 | command=["make", "-k", "check-%s" % lang] + make_vars, |
| 542 | description="gcc-4_2-testsuite (%s)" % lang, |
| 543 | workdir='clang-tests/gcc-4_2-testsuite', |
David Dean | 2bd0c3a | 2011-10-18 16:36:28 +0000 | [diff] [blame] | 544 | logfiles={ 'dg.sum' : 'obj/%s/%s.sum' % (lang, lang), |
| 545 | '%s.log' % lang : 'obj/%s/%s.log' % (lang, lang)}, |
Daniel Dunbar | 22d594a | 2010-07-31 05:29:16 +0000 | [diff] [blame] | 546 | ignore=gcc_dg_ignores.get(lang, []))) |
Daniel Dunbar | 2b67e8f | 2011-02-11 21:03:41 +0000 | [diff] [blame] | 547 | |
Daniel Dunbar | 7363d03 | 2011-02-27 03:22:35 +0000 | [diff] [blame] | 548 | def addClangGDBTests(f, ignores={}, install_prefix="%(builddir)s/llvm.install"): |
| 549 | make_vars = [WithProperties( |
| 550 | 'CC_UNDER_TEST=%s/bin/clang' % install_prefix), |
| 551 | WithProperties( |
| 552 | 'CXX_UNDER_TEST=%s/bin/clang++' % install_prefix)] |
| 553 | f.addStep(SVN(name='svn-clang-tests', mode='update', |
| 554 | baseURL='http://llvm.org/svn/llvm-project/clang-tests/', |
| 555 | defaultBranch='trunk', workdir='clang-tests')) |
Daniel Dunbar | 7363d03 | 2011-02-27 03:22:35 +0000 | [diff] [blame] | 556 | f.addStep(DejaGNUCommand.DejaGNUCommand( |
| 557 | name='test-gdb-1472-testsuite', |
| 558 | command=["make", "-k", "check"] + make_vars, |
| 559 | description="gdb-1472-testsuite", |
| 560 | workdir='clang-tests/gdb-1472-testsuite', |
David Blaikie | 7ec695f | 2012-10-09 22:17:09 +0000 | [diff] [blame] | 561 | logfiles={ 'dg.sum' : 'obj/filtered.gdb.sum', |
David Blaikie | 624f439 | 2012-11-05 22:34:35 +0000 | [diff] [blame] | 562 | 'gdb.log' : 'obj/gdb.log' })) |
Daniel Dunbar | 7363d03 | 2011-02-27 03:22:35 +0000 | [diff] [blame] | 563 | |
David Blaikie | 54d498b | 2012-12-04 21:02:38 +0000 | [diff] [blame] | 564 | def addModernClangGDBTests(f, jobs, install_prefix, baseline): |
| 565 | # strangely, we want to put CC_FOR_TARGET, CXX_FOR_TARGET, etc. inside the |
| 566 | # RUNTESTFLAGS value, not as separate parameters to make |
| 567 | suppress_baseline = '' |
| 568 | if not baseline: |
| 569 | suppress_baseline = 'SUPPRESS_CLANG_BASELINE=1' |
| 570 | make_vars = [WithProperties('RUNTESTFLAGS=CC_FOR_TARGET="{0}/bin/clang" ' |
| 571 | 'CXX_FOR_TARGET="{0}/bin/clang++" ' |
David Blaikie | c5c009d | 2012-12-04 21:06:26 +0000 | [diff] [blame] | 572 | 'CFLAGS_FOR_TARGET="-w -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer" ' |
David Blaikie | 54d498b | 2012-12-04 21:02:38 +0000 | [diff] [blame] | 573 | '{1}'.format(install_prefix, suppress_baseline)), |
David Blaikie | dad03d5 | 2012-11-16 22:37:12 +0000 | [diff] [blame] | 574 | "FORCE_PARALLEL=1"] |
| 575 | f.addStep(SVN(name='svn-clang-tests', mode='update', |
David Blaikie | f3f300b | 2012-11-17 01:13:41 +0000 | [diff] [blame] | 576 | svnurl='http://llvm.org/svn/llvm-project/clang-tests-external/trunk/gdb/7.5', |
David Blaikie | dad03d5 | 2012-11-16 22:37:12 +0000 | [diff] [blame] | 577 | workdir='clang-tests/src')) |
David Blaikie | b83bfdf | 2012-12-05 04:33:42 +0000 | [diff] [blame^] | 578 | f.addStep(Configure(command='../src/configure', |
David Blaikie | f3f300b | 2012-11-17 01:13:41 +0000 | [diff] [blame] | 579 | workdir='clang-tests/build/')) |
David Blaikie | b83bfdf | 2012-12-05 04:33:42 +0000 | [diff] [blame^] | 580 | f.addStep(WarningCountingShellCommand(name='gdb-75-build', |
| 581 | command=['make', WithProperties('-j%s' % jobs)], |
| 582 | haltOnFailure=True, |
| 583 | workdir='clang-tests/build')) |
David Blaikie | dad03d5 | 2012-11-16 22:37:12 +0000 | [diff] [blame] | 584 | f.addStep(DejaGNUCommand.DejaGNUCommand( |
| 585 | name='gdb-75-check', |
David Blaikie | b83bfdf | 2012-12-05 04:33:42 +0000 | [diff] [blame^] | 586 | command=['make', '-k', WithProperties('-j%s' % jobs), 'check'] + make_vars, |
David Blaikie | dad03d5 | 2012-11-16 22:37:12 +0000 | [diff] [blame] | 587 | workdir='clang-tests/build', |
David Blaikie | 2c412a7 | 2012-11-21 00:47:15 +0000 | [diff] [blame] | 588 | logfiles={'dg.sum':'gdb.sum', |
David Blaikie | dad03d5 | 2012-11-16 22:37:12 +0000 | [diff] [blame] | 589 | 'gdb.log':'gdb.log'})) |
| 590 | |
| 591 | |
| 592 | |
Daniel Dunbar | 7363d03 | 2011-02-27 03:22:35 +0000 | [diff] [blame] | 593 | # FIXME: Deprecated. |
| 594 | addClangTests = addClangGCCTests |
| 595 | |
Daniel Dunbar | 2b67e8f | 2011-02-11 21:03:41 +0000 | [diff] [blame] | 596 | def getClangTestsIgnoresFromPath(path, key): |
| 597 | def readList(path): |
| 598 | if not os.path.exists(path): |
| 599 | return [] |
| 600 | |
| 601 | f = open(path) |
| 602 | lines = [ln.strip() for ln in f] |
| 603 | f.close() |
| 604 | return lines |
| 605 | |
| 606 | ignores = {} |
| 607 | |
| 608 | gcc_dg_ignores = {} |
| 609 | for lang in ('gcc', 'g++', 'objc', 'obj-c++'): |
| 610 | lang_path = os.path.join(path, 'gcc-4_2-testsuite', 'expected_results', |
| 611 | key, lang) |
| 612 | gcc_dg_ignores[lang] = ( |
| 613 | readList(os.path.join(lang_path, 'FAIL.txt')) + |
| 614 | readList(os.path.join(lang_path, 'UNRESOLVED.txt')) + |
| 615 | readList(os.path.join(lang_path, 'XPASS.txt'))) |
| 616 | ignores['gcc-4_2-testsuite' ] = gcc_dg_ignores |
| 617 | |
Daniel Dunbar | 7363d03 | 2011-02-27 03:22:35 +0000 | [diff] [blame] | 618 | ignores_path = os.path.join(path, 'gdb-1472-testsuite', 'expected_results', |
| 619 | key) |
| 620 | gdb_dg_ignores = ( |
| 621 | readList(os.path.join(ignores_path, 'FAIL.txt')) + |
| 622 | readList(os.path.join(ignores_path, 'UNRESOLVED.txt')) + |
| 623 | readList(os.path.join(ignores_path, 'XPASS.txt'))) |
| 624 | ignores['gdb-1472-testsuite' ] = gdb_dg_ignores |
| 625 | |
Daniel Dunbar | 2b67e8f | 2011-02-11 21:03:41 +0000 | [diff] [blame] | 626 | return ignores |