]> Cypherpunks repositories - gostls13.git/commitdiff
src: split nacltest.bash into naclmake.bash and keep nacltest.bash
authorBrad Fitzpatrick <bradfitz@golang.org>
Tue, 12 Apr 2016 00:09:05 +0000 (00:09 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 12 Apr 2016 02:03:34 +0000 (02:03 +0000)
Needed by the build system to shard tests. nacl was the last unsharded
builder.

(I considered also adding a -make-only flag to nacltest.bash, but that
wouldn't fail fast when the file didn't exist.)

Updates #15242

Change-Id: I6afc1c1fe4268ab98c0724b5764c67d3784caebe
Reviewed-on: https://go-review.googlesource.com/21851
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/naclmake.bash [new file with mode: 0755]
src/nacltest.bash

diff --git a/src/naclmake.bash b/src/naclmake.bash
new file mode 100755 (executable)
index 0000000..046f50a
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/bash
+# Copyright 2016 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.
+
+# naclmake.bash builds runs make.bash for nacl, but not does run any
+# tests. This is used by the continuous build.
+
+# Assumes that sel_ldr binaries and go_nacl_$GOARCH_exec scripts are in $PATH;
+# see ../misc/nacl/README.
+
+set -e
+ulimit -c 0
+
+# guess GOARCH if not set
+naclGOARCH=$GOARCH
+if [ -z "$naclGOARCH" ]; then
+       case "$(uname -m)" in
+       x86_64)
+               naclGOARCH=amd64p32
+               ;;
+       armv7l) # NativeClient on ARM only supports ARMv7A.
+               naclGOARCH=arm
+               ;;
+       i?86)
+               naclGOARCH=386
+               ;;
+       esac
+fi
+
+unset GOOS GOARCH
+if [ ! -f make.bash ]; then
+       echo 'nacltest.bash must be run from $GOROOT/src' 1>&2
+       exit 1
+fi
+
+# the builder might have set GOROOT_FINAL.
+export GOROOT=$(pwd)/..
+
+# Build zip file embedded in package syscall.
+echo "##### Building fake file system zip for nacl"
+rm -f syscall/fstest_nacl.go
+GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4}
+gobin=$GOROOT_BOOTSTRAP/bin
+GOROOT=$GOROOT_BOOTSTRAP $gobin/go run ../misc/nacl/mkzip.go -p syscall -r .. ../misc/nacl/testzip.proto syscall/fstest_nacl.go
+
+# Run standard build and tests.
+GOOS=nacl GOARCH=$naclGOARCH ./make.bash
index 049aad2ff29f1f0391a9d59e7a0bf2663e465d28..538d6b7e9b3cc5698f97857ea0db6fab5c0ed9ca 100755 (executable)
 set -e
 ulimit -c 0
 
-# guess GOARCH if not set
-naclGOARCH=$GOARCH
-if [ -z "$naclGOARCH" ]; then
-       case "$(uname -m)" in
-       x86_64)
-               naclGOARCH=amd64p32
-               ;;
-       armv7l) # NativeClient on ARM only supports ARMv7A.
-               naclGOARCH=arm
-               ;;
-       i?86)
-               naclGOARCH=386
-               ;;
-       esac
-fi
+. ./naclmake.bash
 
 # Check GOARCH.
 case "$naclGOARCH" in
@@ -59,24 +45,8 @@ if ! which go_nacl_${naclGOARCH}_exec >/dev/null; then
        exit 1
 fi
 
-unset GOOS GOARCH
-if [ ! -f make.bash ]; then
-       echo 'nacltest.bash must be run from $GOROOT/src' 1>&2
-       exit 1
-fi
-
-# the builder might have set GOROOT_FINAL.
-export GOROOT=$(pwd)/..
-
-# Build zip file embedded in package syscall.
-echo "##### Building fake file system zip for nacl"
-rm -f syscall/fstest_nacl.go
-GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4}
-gobin=$GOROOT_BOOTSTRAP/bin
-GOROOT=$GOROOT_BOOTSTRAP $gobin/go run ../misc/nacl/mkzip.go -p syscall -r .. ../misc/nacl/testzip.proto syscall/fstest_nacl.go
-
-# Run standard build and tests.
-export PATH=$(pwd)/../misc/nacl:$PATH
-GOOS=nacl GOARCH=$naclGOARCH ./all.bash
+export PATH=$(pwd)/../bin:$(pwd)/../misc/nacl:$PATH
+GOROOT=$(../bin/go env GOROOT)
+GOOS=nacl GOARCH=$naclGOARCH go tool dist test --no-rebuild
 
 rm -f syscall/fstest_nacl.go