File: nacltest.bash

package info (click to toggle)
golang 2%3A1.3.3-1~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 48,928 kB
  • sloc: ansic: 154,852; asm: 21,595; yacc: 4,966; perl: 4,860; sh: 2,320; xml: 1,084; lisp: 990; python: 273; makefile: 223; awk: 106; cpp: 22
file content (57 lines) | stat: -rwxr-xr-x 1,547 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
# Copyright 2014 The Go Authors.  All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

# For testing Native Client on builders or locally.
# Builds a test file system and embeds it into package syscall
# in every generated binary.
#
# Assumes that sel_ldr binaries and go_nacl_$GOARCH_exec scripts are in $PATH;
# see ../misc/nacl/README.

set -e
ulimit -c 0

# Check GOARCH.
naclGOARCH=${GOARCH:-386}
case "$naclGOARCH" in
amd64p32)
	if ! which sel_ldr_x86_64 >/dev/null; then
		echo 'cannot find sel_ldr_x86_64' 1>&2
		exit 1
	fi
	;;
386)
	if ! which sel_ldr_x86_32 >/dev/null; then
		echo 'cannot find sel_ldr_x86_32' 1>&2
		exit 1
	fi
	;;
*)
	echo 'unsupported $GOARCH for nacl: '"$naclGOARCH" 1>&2
	exit 1
esac

if ! which go_nacl_${naclGOARCH}_exec >/dev/null; then
	echo "cannot find go_nacl_${naclGOARCH}_exec, see ../misc/nacl/README." 1>&2
	exit 1
fi

# Run host build to get toolchain for running zip generator.
unset GOOS GOARCH
if [ ! -f make.bash ]; then
	echo 'nacl.bash must be run from $GOROOT/src' 1>&2
	exit 1
fi
GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH ./make.bash
unset GOROOT

# Build zip file embedded in package syscall.
gobin=${GOBIN:-$(pwd)/../bin}
rm -f pkg/syscall/fstest_nacl.go
GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH $gobin/go run ../misc/nacl/mkzip.go -p syscall -r .. ../misc/nacl/testzip.proto pkg/syscall/fstest_nacl.go

# Run standard build and tests.
export PATH=$(pwd)/../misc/nacl:$PATH
GOOS=nacl GOARCH=$naclGOARCH ./all.bash --no-clean