LEFT | RIGHT |
(no file at all) | |
| 1 #!/bin/bash |
| 2 # Copyright 2014 The Go Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style |
| 4 # license that can be found in the LICENSE file. |
| 5 |
| 6 # For testing Native Client on builders or locally. |
| 7 # Builds a test file system and embeds it into package syscall |
| 8 # in every generated binary. |
| 9 # |
| 10 # Assumes that sel_ldr binaries are in $PATH; see ../misc/nacl/README. |
| 11 |
| 12 set -e |
| 13 ulimit -c 0 |
| 14 |
| 15 # Check GOARCH. |
| 16 naclGOARCH=${GOARCH:-386} |
| 17 case "$naclGOARCH" in |
| 18 amd64p32) |
| 19 if ! which sel_ldr_x86_64 >/dev/null; then |
| 20 echo 'cannot find sel_ldr_x86_64' 1>&2 |
| 21 exit 1 |
| 22 fi |
| 23 ;; |
| 24 386) |
| 25 if ! which sel_ldr_x86_32 >/dev/null; then |
| 26 echo 'cannot find sel_ldr_x86_32' 1>&2 |
| 27 exit 1 |
| 28 fi |
| 29 ;; |
| 30 *) |
| 31 echo 'unsupported $GOARCH for nacl: '"$naclGOARCH" 1>&2 |
| 32 exit 1 |
| 33 esac |
| 34 |
| 35 # Run host build to get toolchain for running zip generator. |
| 36 unset GOOS GOARCH |
| 37 if [ ! -f make.bash ]; then |
| 38 echo 'nacl.bash must be run from $GOROOT/src' 1>&2 |
| 39 exit 1 |
| 40 fi |
| 41 GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH ./make.bash |
| 42 |
| 43 # Build zip file embedded in package syscall. |
| 44 gobin=${GOBIN:-$(pwd)/../bin} |
| 45 rm -f pkg/syscall/fstest_nacl.go |
| 46 GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH $gobin/go run ../misc/nacl/mkzip.go -p syscall
-r .. ../misc/nacl/testzip.proto pkg/syscall/fstest_nacl.go |
| 47 |
| 48 # Run standard build and tests. |
| 49 export PATH=$(pwd)/../misc/nacl:$PATH |
| 50 GOOS=nacl GOARCH=$naclGOARCH ./all.bash --no-clean |
LEFT | RIGHT |