From ce588e89e47cb1904209c6258f259ff7dec0212d Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 22 Sep 2009 16:56:28 -0700 Subject: nacl - run tests under emulator. special all-nacl.bash and test/run-nacl that run just the tests known to work under nacl. the rest requires closures. fix another bug or two in syscall. R=r DELTA=420 (410 added, 8 deleted, 2 changed) OCL=34882 CL=34907 --- src/all-nacl.bash | 19 +++++++++++++++++++ src/cmd/gotest/gotest | 8 +++++++- src/pkg/syscall/asm_nacl_386.s | 3 +-- src/pkg/syscall/syscall_nacl.go | 2 ++ 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 src/all-nacl.bash (limited to 'src') diff --git a/src/all-nacl.bash b/src/all-nacl.bash new file mode 100644 index 000000000..6a1a206c1 --- /dev/null +++ b/src/all-nacl.bash @@ -0,0 +1,19 @@ +#!/bin/bash +# Copyright 2009 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. + +# TODO(rsc): delete in favor of all.bash once nacl support is complete + +set -e +bash make.bash + +xcd() { + echo + echo --- cd $1 + builtin cd $1 +} + +(xcd ../test +./run-nacl +) || exit $? diff --git a/src/cmd/gotest/gotest b/src/cmd/gotest/gotest index 5ee3eb0a8..c4c8e1a9e 100755 --- a/src/cmd/gotest/gotest +++ b/src/cmd/gotest/gotest @@ -16,6 +16,12 @@ if [ -z "$O" ]; then exit 1 fi +E="" +case "$GOOS" in +nacl) + E="nacl" +esac + # Allow overrides GC=${_GC:-$GC} GL=${GL:-$LD} @@ -124,4 +130,4 @@ importpath=$(make -s importpath) $GC _testmain.go $GL _testmain.$O _test/$importpath.a $xofile -./$O.out "$@" +$E ./$O.out "$@" diff --git a/src/pkg/syscall/asm_nacl_386.s b/src/pkg/syscall/asm_nacl_386.s index 976effb5e..6bd69e071 100644 --- a/src/pkg/syscall/asm_nacl_386.s +++ b/src/pkg/syscall/asm_nacl_386.s @@ -85,8 +85,7 @@ ok6: RET // func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr); -TEXT syscall·RawSyscall(SB),7,$0 -TEXT syscall·Syscall(SB),7,$20 +TEXT syscall·RawSyscall(SB),7,$20 MOVL trap+0(FP), AX // syscall entry MOVL a1+4(FP), BX MOVL a2+8(FP), CX diff --git a/src/pkg/syscall/syscall_nacl.go b/src/pkg/syscall/syscall_nacl.go index 4466f028a..ae3ed850e 100644 --- a/src/pkg/syscall/syscall_nacl.go +++ b/src/pkg/syscall/syscall_nacl.go @@ -219,6 +219,8 @@ const ( SO_REUSEADDR; SO_SNDBUF; TCP_NODELAY; + WNOHANG; + WSTOPPED; _PTRACE_TRACEME; ) -- cgit v1.2.3