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 | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 15 | from Util import getConfigArgs |
| 16 | |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 17 | def getClangBuildFactory(triple=None, clean=True, test=True, package_dst=None, |
| 18 | run_cxx_tests=False, examples=False, valgrind=False, |
Daniel Dunbar | a1bebce | 2010-03-21 01:24:00 +0000 | [diff] [blame] | 19 | valgrindLeakCheck=False, outOfDir=False, useTwoStage=False, |
Daniel Dunbar | 06b20f1 | 2010-04-08 18:29:38 +0000 | [diff] [blame] | 20 | completely_clean=False, always_install=False, |
| 21 | make='make', jobs="%(jobs)s", |
Daniel Dunbar | 7e33e04 | 2010-07-14 20:34:16 +0000 | [diff] [blame] | 22 | stage1_config='Debug+Asserts', |
| 23 | stage2_config='Release+Asserts', |
Daniel Dunbar | 469e8ca | 2010-05-19 21:26:48 +0000 | [diff] [blame] | 24 | extra_configure_args=[], use_pty_in_tests=False): |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 25 | # Don't use in-dir builds with a two stage build process. |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 26 | inDir = not outOfDir and not useTwoStage |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 27 | if inDir: |
| 28 | llvm_srcdir = "llvm" |
| 29 | llvm_1_objdir = "llvm" |
Daniel Dunbar | 9870de3 | 2010-03-28 22:25:31 +0000 | [diff] [blame] | 30 | if always_install: |
| 31 | llvm_1_installdir = "llvm.install" |
| 32 | else: |
| 33 | llvm_1_installdir = None |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 34 | else: |
| 35 | llvm_srcdir = "llvm.src" |
| 36 | llvm_1_objdir = "llvm.obj" |
| 37 | llvm_1_installdir = "llvm.install.1" |
| 38 | llvm_2_objdir = "llvm.obj.2" |
Daniel Dunbar | 22d594a | 2010-07-31 05:29:16 +0000 | [diff] [blame^] | 39 | llvm_2_installdir = "llvm.install" |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 40 | |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 41 | f = buildbot.process.factory.BuildFactory() |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 42 | |
| 43 | # Determine the build directory. |
| 44 | f.addStep(buildbot.steps.shell.SetProperty(name="get_builddir", |
| 45 | command=["pwd"], |
| 46 | property="builddir", |
| 47 | description="set build dir", |
| 48 | workdir=".")) |
| 49 | |
Daniel Dunbar | 06b20f1 | 2010-04-08 18:29:38 +0000 | [diff] [blame] | 50 | # Blow away completely, if requested. |
| 51 | if completely_clean: |
| 52 | f.addStep(ShellCommand(name="rm-llvm.src", |
| 53 | command=["rm", "-rf", llvm_srcdir], |
| 54 | haltOnFailure=True, |
| 55 | description=["rm src dir", "llvm"], |
| 56 | workdir=".")) |
| 57 | |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 58 | # Checkout sources. |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 59 | f.addStep(SVN(name='svn-llvm', |
| 60 | mode='update', baseURL='http://llvm.org/svn/llvm-project/llvm/', |
| 61 | defaultBranch='trunk', |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 62 | workdir=llvm_srcdir)) |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 63 | f.addStep(SVN(name='svn-clang', |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 64 | mode='update', baseURL='http://llvm.org/svn/llvm-project/cfe/', |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 65 | defaultBranch='trunk', |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 66 | workdir='%s/tools/clang' % llvm_srcdir)) |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 67 | |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 68 | # Clean up llvm (stage 1); unless in-dir. |
| 69 | if clean and llvm_srcdir != llvm_1_objdir: |
| 70 | f.addStep(ShellCommand(name="rm-llvm.obj.stage1", |
| 71 | command=["rm", "-rf", llvm_1_objdir], |
| 72 | haltOnFailure=True, |
| 73 | description=["rm build dir", "llvm"], |
| 74 | workdir=".")) |
| 75 | |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 76 | # 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] | 77 | base_configure_args = [WithProperties("%%(builddir)s/%s/configure" % llvm_srcdir), |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 78 | '--disable-bindings'] |
| 79 | base_configure_args += extra_configure_args |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 80 | if triple: |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 81 | base_configure_args += ['--build=%s' % triple, |
| 82 | '--host=%s' % triple, |
| 83 | '--target=%s' % triple] |
| 84 | args = base_configure_args + ["--without-llvmgcc", "--without-llvmgxx"] |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 85 | args.append(WithProperties("--prefix=%%(builddir)s/%s" % llvm_1_installdir)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 86 | args += getConfigArgs(stage1_config) |
| 87 | f.addStep(Configure(command=args, |
| 88 | workdir=llvm_1_objdir, |
| 89 | description=['configuring',stage1_config], |
| 90 | descriptionDone=['configure',stage1_config])) |
| 91 | |
| 92 | # Make clean if using in-dir builds. |
| 93 | if clean and llvm_srcdir == llvm_1_objdir: |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 94 | f.addStep(WarningCountingShellCommand(name="clean-llvm", |
Daniel Dunbar | d20468a | 2009-11-24 18:27:23 +0000 | [diff] [blame] | 95 | command=[make, "clean"], |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 96 | haltOnFailure=True, |
| 97 | description="cleaning llvm", |
| 98 | descriptionDone="clean llvm", |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 99 | workdir=llvm_1_objdir)) |
| 100 | |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 101 | f.addStep(WarningCountingShellCommand(name="compile", |
Daniel Dunbar | d20468a | 2009-11-24 18:27:23 +0000 | [diff] [blame] | 102 | command=['nice', '-n', '10', |
| 103 | make, WithProperties("-j%s" % jobs)], |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 104 | haltOnFailure=True, |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 105 | description=["compiling", stage1_config], |
| 106 | descriptionDone=["compile", stage1_config], |
| 107 | workdir=llvm_1_objdir)) |
Daniel Dunbar | 256fed4 | 2009-11-25 21:11:08 +0000 | [diff] [blame] | 108 | |
| 109 | if examples: |
| 110 | f.addStep(WarningCountingShellCommand(name="compile.examples", |
| 111 | command=['nice', '-n', '10', |
| 112 | make, WithProperties("-j%s" % jobs), |
| 113 | "BUILD_EXAMPLES=1"], |
| 114 | haltOnFailure=True, |
| 115 | description=["compilinge", stage1_config, "examples"], |
| 116 | descriptionDone=["compile", stage1_config, "examples"], |
| 117 | workdir=llvm_1_objdir)) |
| 118 | |
Daniel Dunbar | 93f828a | 2010-06-23 17:42:14 +0000 | [diff] [blame] | 119 | clangTestArgs = llvmTestArgs = '-v -j %s' % jobs |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 120 | if valgrind: |
Daniel Dunbar | 89184b9 | 2010-04-18 19:09:32 +0000 | [diff] [blame] | 121 | clangTestArgs += ' --vg' |
Daniel Dunbar | a1bebce | 2010-03-21 01:24:00 +0000 | [diff] [blame] | 122 | if valgrindLeakCheck: |
| 123 | clangTestArgs += ' --vg-leak' |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 124 | clangTestArgs += ' --vg-arg --suppressions=%(builddir)s/llvm/tools/clang/utils/valgrind/x86_64-pc-linux-gnu_gcc-4.3.3.supp' |
| 125 | extraTestDirs = '' |
| 126 | if run_cxx_tests: |
| 127 | extraTestDirs += '%(builddir)s/llvm/tools/clang/utils/C++Tests' |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 128 | if test: |
| 129 | f.addStep(ClangTestCommand(name='test-llvm', |
Daniel Dunbar | 93f828a | 2010-06-23 17:42:14 +0000 | [diff] [blame] | 130 | command=[make, "check-lit", "VERBOSE=1", |
| 131 | WithProperties("LIT_ARGS=%s" % llvmTestArgs)], |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 132 | description=["testing", "llvm"], |
| 133 | descriptionDone=["test", "llvm"], |
Daniel Dunbar | 469e8ca | 2010-05-19 21:26:48 +0000 | [diff] [blame] | 134 | workdir=llvm_1_objdir, |
| 135 | usePTY=use_pty_in_tests)) |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 136 | f.addStep(ClangTestCommand(name='test-clang', |
Daniel Dunbar | d20468a | 2009-11-24 18:27:23 +0000 | [diff] [blame] | 137 | command=[make, 'test', WithProperties('TESTARGS=%s' % clangTestArgs), |
Daniel Dunbar | fa0e022 | 2009-11-09 06:08:28 +0000 | [diff] [blame] | 138 | WithProperties('EXTRA_TESTDIRS=%s' % extraTestDirs)], |
Daniel Dunbar | 469e8ca | 2010-05-19 21:26:48 +0000 | [diff] [blame] | 139 | workdir='%s/tools/clang' % llvm_1_objdir, |
| 140 | usePTY=use_pty_in_tests)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 141 | |
| 142 | # Install llvm and clang. |
| 143 | if llvm_1_installdir: |
Daniel Dunbar | 9870de3 | 2010-03-28 22:25:31 +0000 | [diff] [blame] | 144 | f.addStep(ShellCommand(name="rm-install.clang.stage1", |
| 145 | command=["rm", "-rf", llvm_1_installdir], |
| 146 | haltOnFailure=True, |
| 147 | description=["rm install dir", "clang"], |
| 148 | workdir=".")) |
| 149 | f.addStep(WarningCountingShellCommand(name="install.clang.stage1", |
| 150 | command = ['nice', '-n', '10', |
| 151 | make, 'install-clang'], |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 152 | haltOnFailure=True, |
Daniel Dunbar | 9870de3 | 2010-03-28 22:25:31 +0000 | [diff] [blame] | 153 | description=["install", "clang", |
| 154 | stage1_config], |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 155 | workdir=llvm_1_objdir)) |
| 156 | |
| 157 | if not useTwoStage: |
| 158 | return f |
| 159 | |
| 160 | # Clean up llvm (stage 2). |
| 161 | if clean: |
| 162 | f.addStep(ShellCommand(name="rm-llvm.obj.stage2", |
| 163 | command=["rm", "-rf", llvm_2_objdir], |
| 164 | haltOnFailure=True, |
| 165 | description=["rm build dir", "llvm", "(stage 2)"], |
| 166 | workdir=".")) |
| 167 | |
| 168 | # Configure llvm (stage 2). |
| 169 | args = base_configure_args + ["--without-llvmgcc", "--without-llvmgxx"] |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 170 | args.append(WithProperties("--prefix=%(builddir)s/" + llvm_2_installdir)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 171 | args += getConfigArgs(stage2_config) |
| 172 | f.addStep(Configure(name="configure.llvm.stage2", |
| 173 | command=args, |
| 174 | env={'CC' : WithProperties("%%(builddir)s/%s/bin/clang" % llvm_1_installdir), |
| 175 | 'CXX' : WithProperties("%%(builddir)s/%s/bin/clang++" % llvm_1_installdir),}, |
| 176 | haltOnFailure=True, |
| 177 | workdir=llvm_2_objdir, |
| 178 | description=["configure", "llvm", "(stage 2)", |
| 179 | stage2_config])) |
| 180 | |
| 181 | # Build llvm (stage 2). |
| 182 | f.addStep(WarningCountingShellCommand(name="compile.llvm.stage2", |
| 183 | command=['nice', '-n', '10', |
| 184 | make, WithProperties("-j%s" % jobs)], |
| 185 | haltOnFailure=True, |
| 186 | description=["compiling", "(stage 2)", |
| 187 | stage2_config], |
| 188 | descriptionDone=["compile", "(stage 2)", |
| 189 | stage2_config], |
| 190 | workdir=llvm_2_objdir)) |
| 191 | |
| 192 | if test: |
| 193 | f.addStep(ClangTestCommand(name='test-llvm', |
Daniel Dunbar | 93f828a | 2010-06-23 17:42:14 +0000 | [diff] [blame] | 194 | command=[make, "check-lit", "VERBOSE=1", |
| 195 | WithProperties("LIT_ARGS=%s" % llvmTestArgs)], |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 196 | description=["testing", "llvm"], |
| 197 | descriptionDone=["test", "llvm"], |
Daniel Dunbar | 469e8ca | 2010-05-19 21:26:48 +0000 | [diff] [blame] | 198 | workdir=llvm_2_objdir, |
| 199 | usePTY=use_pty_in_tests)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 200 | f.addStep(ClangTestCommand(name='test-clang', |
| 201 | command=[make, 'test', WithProperties('TESTARGS=%s' % clangTestArgs), |
| 202 | WithProperties('EXTRA_TESTDIRS=%s' % extraTestDirs)], |
Daniel Dunbar | 469e8ca | 2010-05-19 21:26:48 +0000 | [diff] [blame] | 203 | workdir='%s/tools/clang' % llvm_2_objdir, |
| 204 | usePTY=use_pty_in_tests)) |
Daniel Dunbar | 8a89a6f | 2009-11-25 04:27:32 +0000 | [diff] [blame] | 205 | |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 206 | # Install clang (stage 2). |
Daniel Dunbar | 9870de3 | 2010-03-28 22:25:31 +0000 | [diff] [blame] | 207 | f.addStep(ShellCommand(name="rm-install.clang.stage2", |
| 208 | command=["rm", "-rf", llvm_2_installdir], |
| 209 | haltOnFailure=True, |
| 210 | description=["rm install dir", "clang"], |
| 211 | workdir=".")) |
Daniel Dunbar | 3efb782 | 2010-02-26 19:20:00 +0000 | [diff] [blame] | 212 | f.addStep(WarningCountingShellCommand(name="install.clang.stage2", |
| 213 | command = ['nice', '-n', '10', |
| 214 | make, 'install-clang'], |
| 215 | haltOnFailure=True, |
| 216 | description=["install", "clang", |
| 217 | "(stage 2)"], |
| 218 | workdir=llvm_2_objdir)) |
| 219 | |
| 220 | if package_dst: |
| 221 | name = WithProperties( |
| 222 | "%(builddir)s/" + llvm_2_objdir + |
| 223 | "/clang-r%(got_revision)s-b%(buildnumber)s.tgz") |
| 224 | f.addStep(ShellCommand(name='pkg.tar', |
| 225 | description="tar root", |
| 226 | command=["tar", "zcvf", name, "./"], |
| 227 | workdir=llvm_2_installdir, |
| 228 | warnOnFailure=True, |
| 229 | flunkOnFailure=False, |
| 230 | haltOnFailure=False)) |
| 231 | f.addStep(ShellCommand(name='pkg.upload', |
| 232 | description="upload root", |
| 233 | command=["scp", name, |
| 234 | WithProperties( |
| 235 | package_dst + "/%(buildername)s")], |
| 236 | workdir=".", |
| 237 | warnOnFailure=True, |
| 238 | flunkOnFailure=False, |
| 239 | haltOnFailure=False)) |
| 240 | |
Daniel Dunbar | 235aa41 | 2009-07-18 07:16:15 +0000 | [diff] [blame] | 241 | return f |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 242 | |
Daniel Dunbar | 06b20f1 | 2010-04-08 18:29:38 +0000 | [diff] [blame] | 243 | def getClangMSVCBuildFactory(update=True, clean=True, vcDrive='c', jobs=1, |
| 244 | cmake=r"c:\Program Files\CMake 2.6\bin\cmake"): |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 245 | f = buildbot.process.factory.BuildFactory() |
| 246 | |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 247 | if update: |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 248 | f.addStep(SVN(name='svn-llvm', |
| 249 | mode='update', baseURL='http://llvm.org/svn/llvm-project/llvm/', |
| 250 | defaultBranch='trunk', |
| 251 | workdir='llvm')) |
| 252 | |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 253 | if update: |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 254 | f.addStep(SVN(name='svn-clang', |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 255 | mode='update', baseURL='http://llvm.org/svn/llvm-project/cfe/', |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 256 | defaultBranch='trunk', |
| 257 | workdir='llvm/tools/clang')) |
| 258 | |
| 259 | # Full & fast clean. |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 260 | if clean: |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 261 | f.addStep(ShellCommand(name='clean-1', |
| 262 | command=['del','/s/q','build'], |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 263 | warnOnFailure=True, |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 264 | description='cleaning', |
| 265 | descriptionDone='clean', |
| 266 | workdir='llvm')) |
| 267 | f.addStep(ShellCommand(name='clean-2', |
| 268 | command=['rmdir','/s/q','build'], |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 269 | warnOnFailure=True, |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 270 | description='cleaning', |
| 271 | descriptionDone='clean', |
| 272 | workdir='llvm')) |
| 273 | |
| 274 | # Create the project files. |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 275 | |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 276 | # Use batch files instead of ShellCommand directly, Windows quoting is |
| 277 | # borked. FIXME: See buildbot ticket #595 and buildbot ticket #377. |
| 278 | f.addStep(BatchFileDownload(name='cmakegen', |
Daniel Dunbar | 06b20f1 | 2010-04-08 18:29:38 +0000 | [diff] [blame] | 279 | command=[cmake, |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 280 | "-DLLVM_TARGETS_TO_BUILD:=X86", |
| 281 | "-G", |
| 282 | "Visual Studio 9 2008", |
| 283 | ".."], |
| 284 | workdir="llvm\\build")) |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 285 | f.addStep(ShellCommand(name='cmake', |
| 286 | command=['cmakegen.bat'], |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 287 | haltOnFailure=True, |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 288 | description='cmake gen', |
| 289 | workdir='llvm\\build')) |
| 290 | |
| 291 | # Build it. |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 292 | f.addStep(BatchFileDownload(name='vcbuild', |
| 293 | command=[vcDrive + r""":\Program Files\Microsoft Visual Studio 9.0\VC\VCPackages\vcbuild.exe""", |
| 294 | "/M%d" % jobs, |
| 295 | "LLVM.sln", |
| 296 | "Debug|Win32"], |
| 297 | workdir="llvm\\build")) |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 298 | f.addStep(WarningCountingShellCommand(name='vcbuild', |
| 299 | command=['vcbuild.bat'], |
Daniel Dunbar | 7e959c8 | 2009-09-28 04:01:19 +0000 | [diff] [blame] | 300 | haltOnFailure=True, |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 301 | description='vcbuild', |
| 302 | workdir='llvm\\build', |
| 303 | warningPattern=" warning C.*:")) |
Daniel Dunbar | b51f6ab | 2009-11-09 03:09:23 +0000 | [diff] [blame] | 304 | |
| 305 | # Build clang-test project. |
| 306 | f.addStep(BatchFileDownload(name='vcbuild_test', |
| 307 | command=[vcDrive + r""":\Program Files\Microsoft Visual Studio 9.0\VC\VCPackages\vcbuild.exe""", |
| 308 | "clang-test.vcproj", |
| 309 | "Debug|Win32"], |
| 310 | workdir="llvm\\build\\tools\\clang\\test")) |
| 311 | f.addStep(ClangTestCommand(name='test-clang', |
| 312 | command=["vcbuild_test.bat"], |
| 313 | workdir="llvm\\build\\tools\\clang\\test")) |
| 314 | |
Daniel Dunbar | 44abe74 | 2009-07-19 01:59:03 +0000 | [diff] [blame] | 315 | return f |
Daniel Dunbar | 22d594a | 2010-07-31 05:29:16 +0000 | [diff] [blame^] | 316 | |
| 317 | def addClangTests(f, ignores={}): |
| 318 | make_vars = [WithProperties( |
| 319 | 'CC_UNDER_TEST=%(builddir)s/llvm.install/bin/clang'), |
| 320 | WithProperties( |
| 321 | 'CXX_UNDER_TEST=%(builddir)s/llvm.install/bin/clang++')] |
| 322 | f.addStep(SVN(name='svn-clang-tests', mode='update', |
| 323 | baseURL='http://llvm.org/svn/llvm-project/clang-tests/', |
| 324 | defaultBranch='trunk', workdir='clang-tests')) |
| 325 | gcc_dg_ignores = ignores.get('gcc-4_2-testsuite', {}) |
| 326 | for lang in ('gcc', 'g++', 'objc', 'obj-c++'): |
| 327 | f.addStep(DejaGNUCommand.DejaGNUCommand( |
| 328 | name='test-gcc-4_2-testsuite-%s' % lang, |
| 329 | command=["make", "-k", "check-%s" % lang] + make_vars, |
| 330 | description="gcc-4_2-testsuite (%s)" % lang, |
| 331 | workdir='clang-tests/gcc-4_2-testsuite', |
| 332 | logfiles={ 'dg.sum' : 'obj/%s/%s.sum' % (lang, lang) }, |
| 333 | ignore=gcc_dg_ignores.get(lang, []))) |