Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 set -o xtrace | 6 set -o xtrace |
| 7 set -o nounset | 7 set -o nounset |
| 8 set -o errexit | 8 set -o errexit |
| 9 | 9 |
| 10 ###################################################################### | 10 ###################################################################### |
| 11 # SCRIPT CONFIG | 11 # SCRIPT CONFIG |
| 12 ###################################################################### | 12 ###################################################################### |
| 13 | 13 |
| 14 CLOBBER=${CLOBBER:-yes} | 14 readonly CLOBBER=${CLOBBER:-yes} |
| 15 SCONS_TRUSTED="./scons --mode=opt-host -j8" | 15 readonly SCONS_TRUSTED="./scons --mode=opt-host -j8" |
| 16 SCONS_NACL="./scons --mode=opt-host,nacl -j8" | 16 readonly SCONS_NACL="./scons --mode=opt-host,nacl -j8" |
| 17 SPEC_HARNESS=${SPEC_HARNESS:-${HOME}/cpu2000-redhat64-ia32}/ | 17 readonly SPEC_HARNESS=${SPEC_HARNESS:-${HOME}/cpu2000-redhat64-ia32}/ |
| 18 | 18 |
| 19 TRYBOT_TESTS="176.gcc 179.art 181.mcf 197.parser 252.eon 254.gap" | 19 readonly TRYBOT_TESTS="176.gcc 179.art 181.mcf 197.parser 252.eon 254.gap" |
| 20 TRYBOT_TRANSLATOR_TESTS="176.gcc" | 20 readonly TRYBOT_TRANSLATOR_TESTS="176.gcc" |
| 21 TRYBOT_X86_64_ZERO_BASED_SANDBOX_TESTS="176.gcc" | 21 readonly TRYBOT_X86_64_ZERO_BASED_SANDBOX_TESTS="176.gcc" |
| 22 | 22 |
| 23 readonly BUILDBOT_PNACL="buildbot/buildbot_pnacl.sh" | 23 readonly BUILDBOT_PNACL="buildbot/buildbot_pnacl.sh" |
| 24 readonly UP_DOWN_LOAD="buildbot/file_up_down_load.sh" | 24 readonly UP_DOWN_LOAD="buildbot/file_up_down_load.sh" |
| 25 | 25 |
| 26 SPEC_BASE="tests/spec2k" | 26 readonly SPEC_BASE="tests/spec2k" |
| 27 readonly ARCHIVE_NAME=$(${SPEC_BASE}/run_all.sh GetTestArchiveName) | 27 readonly ARCHIVE_NAME=$(${SPEC_BASE}/run_all.sh GetTestArchiveName) |
| 28 | 28 |
| 29 readonly NAME_ARM_TRY_UPLOAD=$(${BUILDBOT_PNACL} NAME_ARM_TRY_UPLOAD) | 29 readonly NAME_ARM_TRY_UPLOAD=$(${BUILDBOT_PNACL} NAME_ARM_TRY_UPLOAD) |
| 30 readonly NAME_ARM_TRY_DOWNLOAD=$(${BUILDBOT_PNACL} NAME_ARM_TRY_DOWNLOAD) | 30 readonly NAME_ARM_TRY_DOWNLOAD=$(${BUILDBOT_PNACL} NAME_ARM_TRY_DOWNLOAD) |
| 31 readonly NAME_ARM_UPLOAD=$(${BUILDBOT_PNACL} NAME_ARM_UPLOAD) | 31 readonly NAME_ARM_UPLOAD=$(${BUILDBOT_PNACL} NAME_ARM_UPLOAD) |
| 32 readonly NAME_ARM_DOWNLOAD=$(${BUILDBOT_PNACL} NAME_ARM_DOWNLOAD) | 32 readonly NAME_ARM_DOWNLOAD=$(${BUILDBOT_PNACL} NAME_ARM_DOWNLOAD) |
| 33 | 33 |
| 34 readonly QEMU_TOOL="$(pwd)/toolchain/linux_arm-trusted/run_under_qemu_arm" | |
| 35 | |
| 34 # If true, terminate script when first error is encountered. | 36 # If true, terminate script when first error is encountered. |
| 35 FAIL_FAST=${FAIL_FAST:-false} | 37 readonly FAIL_FAST=${FAIL_FAST:-false} |
| 36 RETCODE=0 | 38 RETCODE=0 |
| 37 | 39 |
| 38 # Print the number of tests being run for the buildbot status output | 40 # Print the number of tests being run for the buildbot status output |
| 39 testcount() { | 41 testcount() { |
| 40 local tests="$1" | 42 local tests="$1" |
| 41 if [[ ${tests} == "all" ]]; then | 43 if [[ ${tests} == "all" ]]; then |
| 42 echo "all" | 44 echo "all" |
| 43 else | 45 else |
| 44 echo ${tests} | wc -w | 46 echo ${tests} | wc -w |
| 45 fi | 47 fi |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 else | 146 else |
| 145 ${UP_DOWN_LOAD} DownloadArmBinariesForHWBots ${NAME_ARM_DOWNLOAD} \ | 147 ${UP_DOWN_LOAD} DownloadArmBinariesForHWBots ${NAME_ARM_DOWNLOAD} \ |
| 146 ${ARCHIVE_NAME} | 148 ${ARCHIVE_NAME} |
| 147 fi | 149 fi |
| 148 echo "@@@BUILD_STEP spec2k untar@@@" | 150 echo "@@@BUILD_STEP spec2k untar@@@" |
| 149 pushd ${SPEC_BASE} | 151 pushd ${SPEC_BASE} |
| 150 ./run_all.sh UnpackArmBinaries | 152 ./run_all.sh UnpackArmBinaries |
| 151 popd | 153 popd |
| 152 } | 154 } |
| 153 | 155 |
| 156 download-validator-test-nexes() { | |
| 157 local arch="$1" | |
| 158 echo "@@@BUILD_STEP validator test download@@@" | |
| 159 ${UP_DOWN_LOAD} DownloadArchivedNexes 1000 "${arch}_giant" giant_nexe.tar.bz2 | |
| 160 # This generates "CannedNexes/" in the current directory | |
| 161 rm -rf CannedNexes | |
|
jvoung - send to chromium...
2012/11/14 18:45:30
Indentation is a bit inconsistent in these couple
Robert Muth (chromium)
2012/11/15 05:25:35
Done.
| |
| 162 tar jxf giant_nexe.tar.bz2 | |
| 163 } | |
| 164 | |
| 165 get-validator() { | |
| 166 local arch="$1" | |
| 167 if [[ ${arch} == "x86-32" ]] ; then | |
| 168 echo "$(pwd)/scons-out/opt-linux-x86-32/staging/ncval" | |
| 169 elif [[ ${arch} == "x86-64" ]] ; then | |
| 170 echo "$(pwd)/scons-out/opt-linux-x86-64/staging/ncval" | |
| 171 elif [[ ${arch} == "arm" ]] ; then | |
| 172 echo "$(pwd)/scons-out/opt-linux-arm/staging/arm-ncval-core" | |
| 173 else | |
| 174 echo "ERROR: unknown arch" | |
| 175 fi | |
| 176 } | |
| 177 | |
| 178 measure-validator-speed() { | |
| 179 local arch="$1" | |
| 180 local validator=$(get-validator ${arch}) | |
| 181 echo "@@@BUILD_STEP validator speed test@@@" | |
| 182 if [[ ! -e ${validator} ]] ; then | |
| 183 echo "ERROR: missing validator executable: ${validator}" | |
| 184 handle-error | |
| 185 return | |
| 186 fi | |
| 187 | |
| 188 if [[ $(uname -p) != arm* ]] ; then | |
| 189 validator="${QEMU_TOOL} ${validator}" | |
| 190 fi | |
| 191 | |
| 192 for b in CannedNexes/*nexe ; do | |
| 193 /usr//bin/time ${validator} $b | |
|
jvoung - send to chromium...
2012/11/14 18:45:30
extra slash
/usr//bin
Robert Muth (chromium)
2012/11/15 05:25:35
Done.
| |
| 194 done | |
| 195 } | |
| 196 | |
| 154 ###################################################################### | 197 ###################################################################### |
| 155 # NOTE: trybots only runs a subset of the the spec2k tests | 198 # NOTE: trybots only runs a subset of the the spec2k tests |
| 156 # TODO: elminate this long running bot in favor per arch sharded bots | 199 # TODO: elminate this long running bot in favor per arch sharded bots |
| 157 pnacl-trybot-arm-qemu() { | 200 pnacl-trybot-arm-qemu() { |
| 158 clobber | 201 clobber |
| 159 build-prerequisites "arm" "bitcode" | 202 build-prerequisites "arm" "bitcode" |
| 160 build-tests SetupPnaclArmOpt "${TRYBOT_TESTS}" 0 1 | 203 build-tests SetupPnaclArmOpt "${TRYBOT_TESTS}" 0 1 |
| 161 run-tests SetupPnaclArmOpt "${TRYBOT_TESTS}" 0 1 | 204 run-tests SetupPnaclArmOpt "${TRYBOT_TESTS}" 0 1 |
| 162 } | 205 } |
| 163 | 206 |
| 164 pnacl-trybot-arm-buildonly() { | 207 pnacl-trybot-arm-buildonly() { |
| 165 clobber | 208 clobber |
| 166 build-prerequisites "arm" "bitcode" "arm-ncval-core" | 209 build-prerequisites "arm" "bitcode" "arm-ncval-core" |
| 167 ${BUILDBOT_PNACL} archive-for-hw-bots "${NAME_ARM_TRY_UPLOAD}" try | 210 ${BUILDBOT_PNACL} archive-for-hw-bots "${NAME_ARM_TRY_UPLOAD}" try |
| 168 build-tests SetupPnaclPexeOpt "${TRYBOT_TESTS}" 0 1 | 211 build-tests SetupPnaclPexeOpt "${TRYBOT_TESTS}" 0 1 |
| 169 upload-test-binaries "${TRYBOT_TESTS}" try | 212 upload-test-binaries "${TRYBOT_TESTS}" try |
| 170 } | 213 } |
| 171 | 214 |
| 172 pnacl-trybot-arm-hw() { | 215 pnacl-trybot-arm-hw() { |
| 173 clobber | 216 clobber |
| 174 ${BUILDBOT_PNACL} unarchive-for-hw-bots "${NAME_ARM_TRY_DOWNLOAD}" try | 217 ${BUILDBOT_PNACL} unarchive-for-hw-bots "${NAME_ARM_TRY_DOWNLOAD}" try |
| 175 download-test-binaries try | 218 download-test-binaries try |
| 176 build-tests SetupPnaclTranslatorArmOptHW "${TRYBOT_TESTS}" 0 1 | 219 build-tests SetupPnaclTranslatorArmOptHW "${TRYBOT_TESTS}" 0 1 |
| 177 run-tests SetupPnaclTranslatorArmOptHW "${TRYBOT_TESTS}" 0 1 | 220 run-tests SetupPnaclTranslatorArmOptHW "${TRYBOT_TESTS}" 0 1 |
| 178 pushd ${SPEC_BASE}; | 221 pushd ${SPEC_BASE}; |
| 179 ./run_all.sh TimeValidation SetupPnaclTranslatorArmOptHW "${TRYBOT_TESTS}" ||\ | 222 ./run_all.sh TimeValidation SetupPnaclTranslatorArmOptHW "${TRYBOT_TESTS}" ||\ |
|
jvoung - send to chromium...
2012/11/14 18:45:30
Can you merge the measure-validator-speed mechanis
| |
| 180 handle-error | 223 handle-error |
| 181 popd | 224 popd |
| 182 } | 225 } |
| 183 | 226 |
| 184 pnacl-trybot-x8632() { | 227 pnacl-trybot-x8632() { |
| 185 clobber | 228 clobber |
| 186 build-prerequisites "x86-32" "bitcode" | 229 build-prerequisites "x86-32" "bitcode" |
| 187 build-tests SetupPnaclX8632Opt "${TRYBOT_TESTS}" 0 1 | 230 build-tests SetupPnaclX8632Opt "${TRYBOT_TESTS}" 0 1 |
| 188 run-tests SetupPnaclX8632Opt "${TRYBOT_TESTS}" 0 1 | 231 run-tests SetupPnaclX8632Opt "${TRYBOT_TESTS}" 0 1 |
| 189 build-tests SetupPnaclTranslatorX8632Opt "${TRYBOT_TRANSLATOR_TESTS}" 0 1 | 232 build-tests SetupPnaclTranslatorX8632Opt "${TRYBOT_TRANSLATOR_TESTS}" 0 1 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 239 pnacl-x8664() { | 282 pnacl-x8664() { |
| 240 clobber | 283 clobber |
| 241 build-prerequisites "x86-64" "bitcode" | 284 build-prerequisites "x86-64" "bitcode" |
| 242 local setups="SetupPnaclX8664 \ | 285 local setups="SetupPnaclX8664 \ |
| 243 SetupPnaclX8664Opt \ | 286 SetupPnaclX8664Opt \ |
| 244 SetupPnaclTranslatorX8664 \ | 287 SetupPnaclTranslatorX8664 \ |
| 245 SetupPnaclTranslatorX8664Opt" | 288 SetupPnaclTranslatorX8664Opt" |
| 246 build-tests "${setups}" all 1 3 | 289 build-tests "${setups}" all 1 3 |
| 247 run-tests "${setups}" all 1 3 | 290 run-tests "${setups}" all 1 3 |
| 248 pnacl-x86-64-zero-based-sandbox | 291 pnacl-x86-64-zero-based-sandbox |
| 292 measure-validator-speed x86-64 | |
| 249 } | 293 } |
| 250 | 294 |
| 251 pnacl-x8632() { | 295 pnacl-x8632() { |
| 252 clobber | 296 clobber |
| 253 build-prerequisites "x86-32" "bitcode" | 297 build-prerequisites "x86-32" "bitcode" |
| 254 local setups="SetupPnaclX8632 \ | 298 local setups="SetupPnaclX8632 \ |
| 255 SetupPnaclX8632Opt \ | 299 SetupPnaclX8632Opt \ |
| 256 SetupPnaclTranslatorX8632 \ | 300 SetupPnaclTranslatorX8632 \ |
| 257 SetupPnaclTranslatorX8632Opt" | 301 SetupPnaclTranslatorX8632Opt" |
| 258 build-tests "${setups}" all 1 3 | 302 build-tests "${setups}" all 1 3 |
| 259 run-tests "${setups}" all 1 3 | 303 run-tests "${setups}" all 1 3 |
| 304 measure-validator-speed x86-32 | |
| 260 } | 305 } |
| 261 | 306 |
| 262 nacl-x8632() { | 307 nacl-x8632() { |
| 263 clobber | 308 clobber |
| 264 build-prerequisites "x86-32" "" | 309 build-prerequisites "x86-32" "" |
| 265 local setups="SetupNaclX8632 \ | 310 local setups="SetupNaclX8632 \ |
| 266 SetupNaclX8632Opt" | 311 SetupNaclX8632Opt" |
| 267 build-tests "${setups}" all 1 3 | 312 build-tests "${setups}" all 1 3 |
| 268 run-tests "${setups}" all 1 3 | 313 run-tests "${setups}" all 1 3 |
| 314 measure-validator-speed x86-32 | |
| 269 } | 315 } |
| 270 | 316 |
| 271 nacl-x8664() { | 317 nacl-x8664() { |
| 272 clobber | 318 clobber |
| 273 build-prerequisites "x86-64" "" | 319 build-prerequisites "x86-64" "" |
| 274 local setups="SetupNaclX8664 \ | 320 local setups="SetupNaclX8664 \ |
| 275 SetupNaclX8664Opt" | 321 SetupNaclX8664Opt" |
| 276 build-tests "${setups}" all 1 3 | 322 build-tests "${setups}" all 1 3 |
| 277 run-tests "${setups}" all 1 3 | 323 run-tests "${setups}" all 1 3 |
| 324 measure-validator-speed x86-64 | |
| 278 } | 325 } |
| 279 | 326 |
| 280 | 327 |
| 281 ###################################################################### | 328 ###################################################################### |
| 282 # Script assumed to be run in native_client/ | 329 # Script assumed to be run in native_client/ |
| 283 if [[ $(pwd) != */native_client ]]; then | 330 if [[ $(pwd) != */native_client ]]; then |
| 284 echo "ERROR: must be run in native_client!" | 331 echo "ERROR: must be run in native_client!" |
| 285 exit 1 | 332 exit 1 |
| 286 fi | 333 fi |
| 287 | 334 |
| 288 | 335 |
| 289 if [[ $# -eq 0 ]] ; then | 336 if [[ $# -eq 0 ]] ; then |
| 290 echo "you must specify a mode on the commandline:" | 337 echo "you must specify a mode on the commandline:" |
| 291 exit 1 | 338 exit 1 |
| 292 fi | 339 fi |
| 293 | 340 |
| 294 if [ "$(type -t $1)" != "function" ]; then | 341 if [ "$(type -t $1)" != "function" ]; then |
| 295 Usage | 342 Usage |
| 296 echo "ERROR: unknown mode '$1'." >&2 | 343 echo "ERROR: unknown mode '$1'." >&2 |
| 297 exit 1 | 344 exit 1 |
| 298 fi | 345 fi |
| 299 | 346 |
| 300 "$@" | 347 "$@" |
| 301 | 348 |
| 302 if [[ ${RETCODE} != 0 ]]; then | 349 if [[ ${RETCODE} != 0 ]]; then |
| 303 echo "@@@BUILD_STEP summary@@@" | 350 echo "@@@BUILD_STEP summary@@@" |
| 304 echo There were failed stages. | 351 echo There were failed stages. |
| 305 exit ${RETCODE} | 352 exit ${RETCODE} |
| 306 fi | 353 fi |
| OLD | NEW |