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