summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-09-22 16:56:28 -0700
committerRuss Cox <rsc@golang.org>2009-09-22 16:56:28 -0700
commitce588e89e47cb1904209c6258f259ff7dec0212d (patch)
tree871dd0057038663f376fbcd0f6464e88f741fca1 /src
parentbc8441544b2566ad0d133d95ab94b9355588c602 (diff)
downloadgolang-ce588e89e47cb1904209c6258f259ff7dec0212d.tar.gz
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
Diffstat (limited to 'src')
-rw-r--r--src/all-nacl.bash19
-rwxr-xr-xsrc/cmd/gotest/gotest8
-rw-r--r--src/pkg/syscall/asm_nacl_386.s3
-rw-r--r--src/pkg/syscall/syscall_nacl.go2
4 files changed, 29 insertions, 3 deletions
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;
)