Russ Cox | 0c2a727 | 2014-05-20 12:10:19 -0400 | [diff] [blame] | 1 | #!/bin/bash |
Emmanuel Odeke | 53fd522 | 2016-04-10 14:32:26 -0700 | [diff] [blame] | 2 | # Copyright 2014 The Go Authors. All rights reserved. |
Russ Cox | 0c2a727 | 2014-05-20 12:10:19 -0400 | [diff] [blame] | 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 | # |
Shenghou Ma | 3ad9df0 | 2014-06-10 20:20:49 -0400 | [diff] [blame] | 10 | # Assumes that sel_ldr binaries and go_nacl_$GOARCH_exec scripts are in $PATH; |
| 11 | # see ../misc/nacl/README. |
Russ Cox | 0c2a727 | 2014-05-20 12:10:19 -0400 | [diff] [blame] | 12 | |
| 13 | set -e |
| 14 | ulimit -c 0 |
| 15 | |
Brad Fitzpatrick | e569b10 | 2016-04-12 00:09:05 +0000 | [diff] [blame] | 16 | . ./naclmake.bash |
Shenghou Ma | 99e2a56 | 2014-07-10 15:15:41 -0400 | [diff] [blame] | 17 | |
Russ Cox | 0c2a727 | 2014-05-20 12:10:19 -0400 | [diff] [blame] | 18 | # Check GOARCH. |
Russ Cox | 0c2a727 | 2014-05-20 12:10:19 -0400 | [diff] [blame] | 19 | case "$naclGOARCH" in |
| 20 | amd64p32) |
| 21 | if ! which sel_ldr_x86_64 >/dev/null; then |
| 22 | echo 'cannot find sel_ldr_x86_64' 1>&2 |
| 23 | exit 1 |
| 24 | fi |
| 25 | ;; |
| 26 | 386) |
| 27 | if ! which sel_ldr_x86_32 >/dev/null; then |
| 28 | echo 'cannot find sel_ldr_x86_32' 1>&2 |
| 29 | exit 1 |
| 30 | fi |
| 31 | ;; |
Shenghou Ma | 99e2a56 | 2014-07-10 15:15:41 -0400 | [diff] [blame] | 32 | arm) |
| 33 | if ! which sel_ldr_arm >/dev/null; then |
| 34 | echo 'cannot find sel_ldr_arm' 1>&2 |
| 35 | exit 1 |
| 36 | fi |
| 37 | ;; |
Russ Cox | 0c2a727 | 2014-05-20 12:10:19 -0400 | [diff] [blame] | 38 | *) |
| 39 | echo 'unsupported $GOARCH for nacl: '"$naclGOARCH" 1>&2 |
| 40 | exit 1 |
| 41 | esac |
| 42 | |
Shenghou Ma | 3ad9df0 | 2014-06-10 20:20:49 -0400 | [diff] [blame] | 43 | if ! which go_nacl_${naclGOARCH}_exec >/dev/null; then |
| 44 | echo "cannot find go_nacl_${naclGOARCH}_exec, see ../misc/nacl/README." 1>&2 |
| 45 | exit 1 |
| 46 | fi |
| 47 | |
Brad Fitzpatrick | e569b10 | 2016-04-12 00:09:05 +0000 | [diff] [blame] | 48 | export PATH=$(pwd)/../bin:$(pwd)/../misc/nacl:$PATH |
| 49 | GOROOT=$(../bin/go env GOROOT) |
| 50 | GOOS=nacl GOARCH=$naclGOARCH go tool dist test --no-rebuild |
Shenghou Ma | fbb4c74 | 2015-05-01 21:56:28 -0400 | [diff] [blame] | 51 | |
| 52 | rm -f syscall/fstest_nacl.go |