Home | History | Annotate | Download | only in src
      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 and go_nacl_$GOARCH_exec scripts are in $PATH;
     11 # see ../misc/nacl/README.
     12 
     13 set -e
     14 ulimit -c 0
     15 
     16 . ./naclmake.bash
     17 
     18 # Check GOARCH.
     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 	;;
     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 	;;
     38 *)
     39 	echo 'unsupported $GOARCH for nacl: '"$naclGOARCH" 1>&2
     40 	exit 1
     41 esac
     42 
     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 
     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
     51 
     52 rm -f syscall/fstest_nacl.go
     53