blob: 7bbd6601aec2de7a85b797c796827fa68a42008a [file] [log] [blame]
Russ Cox0c2a7272014-05-20 12:10:19 -04001#!/bin/bash
Emmanuel Odeke53fd5222016-04-10 14:32:26 -07002# Copyright 2014 The Go Authors. All rights reserved.
Russ Cox0c2a7272014-05-20 12:10:19 -04003# 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 Ma3ad9df02014-06-10 20:20:49 -040010# Assumes that sel_ldr binaries and go_nacl_$GOARCH_exec scripts are in $PATH;
11# see ../misc/nacl/README.
Russ Cox0c2a7272014-05-20 12:10:19 -040012
13set -e
14ulimit -c 0
15
Brad Fitzpatricke569b102016-04-12 00:09:05 +000016. ./naclmake.bash
Shenghou Ma99e2a562014-07-10 15:15:41 -040017
Russ Cox0c2a7272014-05-20 12:10:19 -040018# Check GOARCH.
Russ Cox0c2a7272014-05-20 12:10:19 -040019case "$naclGOARCH" in
20amd64p32)
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 ;;
26386)
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 Ma99e2a562014-07-10 15:15:41 -040032arm)
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 Cox0c2a7272014-05-20 12:10:19 -040038*)
39 echo 'unsupported $GOARCH for nacl: '"$naclGOARCH" 1>&2
40 exit 1
41esac
42
Shenghou Ma3ad9df02014-06-10 20:20:49 -040043if ! 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
46fi
47
Brad Fitzpatricke569b102016-04-12 00:09:05 +000048export PATH=$(pwd)/../bin:$(pwd)/../misc/nacl:$PATH
49GOROOT=$(../bin/go env GOROOT)
50GOOS=nacl GOARCH=$naclGOARCH go tool dist test --no-rebuild
Shenghou Mafbb4c742015-05-01 21:56:28 -040051
52rm -f syscall/fstest_nacl.go