Text file src/nacltest.bash

Documentation: Index

     1#!/usr/bin/env 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
    13set -e
    14ulimit -c 0
    15
    16. ./naclmake.bash "$@"
    17
    18# Check GOARCH.
    19case "$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	;;
    32arm)
    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
    41esac
    42
    43if ! 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
    48export PATH=$(pwd)/../bin:$(pwd)/../misc/nacl:$PATH
    49GOROOT=$(../bin/go env GOROOT)
    50GOOS=nacl GOARCH=$naclGOARCH go tool dist test --no-rebuild
    51
    52rm -f syscall/fstest_nacl.go

View as plain text