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