aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-04-22 17:52:22 -0700
committerRuss Cox <rsc@golang.org>2010-04-22 17:52:22 -0700
commitc6138efbcb3c69eb22be0e09740b4e74e6eff552 (patch)
tree517171909ef7be7d91fcb865e558266aac65cc6d /test
parent6e80a01ab748e16428f5911523a1ad153b220fb0 (diff)
downloadgo-c6138efbcb3c69eb22be0e09740b4e74e6eff552.tar.xz
runtime: closures, defer bug fix for Native Client
Enable package tests for Native Client build. R=r CC=golang-dev https://golang.org/cl/957042
Diffstat (limited to 'test')
-rw-r--r--test/env.go1
-rw-r--r--test/fixedbugs/bug243.go1
-rw-r--r--test/nacl-pass.txt355
-rw-r--r--test/nilptr/arrayindex.go1
-rw-r--r--test/nilptr/arrayindex1.go1
-rw-r--r--test/nilptr/arraytoslice.go1
-rw-r--r--test/nilptr/arraytoslice1.go1
-rw-r--r--test/nilptr/arraytoslice2.go1
-rw-r--r--test/nilptr/slicearray.go1
-rw-r--r--test/nilptr/structfield.go1
-rw-r--r--test/nilptr/structfield1.go1
-rw-r--r--test/nilptr/structfield2.go1
-rw-r--r--test/nilptr/structfieldaddr.go1
-rw-r--r--test/nul1.go1
-rw-r--r--test/recover3.go1
-rwxr-xr-xtest/run2
-rwxr-xr-xtest/run-nacl84
-rw-r--r--test/sigchld.go1
-rw-r--r--test/stack.go2
19 files changed, 17 insertions, 441 deletions
diff --git a/test/env.go b/test/env.go
index 2cf9ddf381..b12a72973b 100644
--- a/test/env.go
+++ b/test/env.go
@@ -1,3 +1,4 @@
+// [ $GOOS != nacl ] || exit 0 # NaCl runner does not expose environment
// $G $F.go && $L $F.$A && ./$A.out
// Copyright 2009 The Go Authors. All rights reserved.
diff --git a/test/fixedbugs/bug243.go b/test/fixedbugs/bug243.go
index 01112dae73..837b91035f 100644
--- a/test/fixedbugs/bug243.go
+++ b/test/fixedbugs/bug243.go
@@ -1,3 +1,4 @@
+// [ $GOOS != nacl ] || exit 0 # no network
// $G $D/$F.go && $L $F.$A && ./$A.out
// Copyright 2010 The Go Authors. All rights reserved.
diff --git a/test/nacl-pass.txt b/test/nacl-pass.txt
deleted file mode 100644
index 91a9cc8df9..0000000000
--- a/test/nacl-pass.txt
+++ /dev/null
@@ -1,355 +0,0 @@
-./64bit.go
-./args.go
-./assign.go
-./bigalg.go
-./blank.go
-./blank1.go
-./chancap.go
-./char_lit.go
-./closedchan.go
-./cmp1.go
-./complit.go
-./compos.go
-./const.go
-./const1.go
-./const2.go
-./const3.go
-./convert.go
-./convert3.go
-./convlit.go
-./convlit1.go
-./copy.go
-./ddd1.go
-./ddd2.go
-./ddd3.go
-./decl.go
-./declbad.go
-./defer.go
-./empty.go
-./escape.go
-./escape1.go
-./float_lit.go
-./floatcmp.go
-./for.go
-./func.go
-./func1.go
-./func2.go
-./func3.go
-./func4.go
-./gc.go
-./gc1.go
-./hashmap.go
-./hilbert.go
-./if.go
-./if1.go
-./import.go
-./import1.go
-./import2.go
-./import3.go
-./indirect.go
-./indirect1.go
-./initcomma.go
-./initialize.go
-./initializerr.go
-./initsyscall.go
-./int_lit.go
-./intcvt.go
-./iota.go
-./literal.go
-./map.go
-./method.go
-./method1.go
-./method2.go
-./method3.go
-./named.go
-./named1.go
-./nil.go
-./parentype.go
-./range.go
-./rename.go
-./rename1.go
-./runtime.go
-./sieve.go
-./simassign.go
-./string_lit.go
-./stringrange.go
-./switch.go
-./switch1.go
-./test0.go
-./typeswitch.go
-./typeswitch1.go
-./typeswitch2.go
-./utf.go
-./varinit.go
-./vectors.go
-ken/array.go
-ken/chan.go
-ken/chan1.go
-ken/complit.go
-ken/divconst.go
-ken/divmod.go
-ken/embed.go
-ken/for.go
-ken/interbasic.go
-ken/interfun.go
-ken/mfunc.go
-ken/modconst.go
-ken/ptrfun.go
-ken/ptrvar.go
-ken/range.go
-ken/robfor.go
-ken/robfunc.go
-ken/robif.go
-ken/shift.go
-ken/simparray.go
-ken/simpbool.go
-ken/simpconv.go
-ken/simpfun.go
-ken/simpvar.go
-ken/slicearray.go
-ken/sliceslice.go
-ken/strvar.go
-chan/fifo.go
-chan/perm.go
-chan/select.go
-chan/sieve.go
-interface/bigdata.go
-interface/convert.go
-interface/convert1.go
-interface/convert2.go
-interface/embed.go
-interface/embed0.go
-interface/embed1.go
-interface/explicit.go
-interface/fake.go
-interface/pointer.go
-interface/receiver.go
-interface/receiver1.go
-interface/recursive.go
-interface/struct.go
-syntax/forvar.go
-syntax/import.go
-syntax/interface.go
-syntax/semi1.go
-syntax/semi2.go
-syntax/semi3.go
-syntax/semi4.go
-syntax/semi5.go
-syntax/semi6.go
-syntax/semi7.go
-syntax/slice.go
-fixedbugs/bug000.go
-fixedbugs/bug001.go
-fixedbugs/bug002.go
-fixedbugs/bug003.go
-fixedbugs/bug004.go
-fixedbugs/bug005.go
-fixedbugs/bug006.go
-fixedbugs/bug007.go
-fixedbugs/bug008.go
-fixedbugs/bug009.go
-fixedbugs/bug010.go
-fixedbugs/bug011.go
-fixedbugs/bug012.go
-fixedbugs/bug013.go
-fixedbugs/bug014.go
-fixedbugs/bug015.go
-fixedbugs/bug017.go
-fixedbugs/bug020.go
-fixedbugs/bug021.go
-fixedbugs/bug022.go
-fixedbugs/bug023.go
-fixedbugs/bug024.go
-fixedbugs/bug026.go
-fixedbugs/bug028.go
-fixedbugs/bug030.go
-fixedbugs/bug031.go
-fixedbugs/bug035.go
-fixedbugs/bug036.go
-fixedbugs/bug037.go
-fixedbugs/bug038.go
-fixedbugs/bug039.go
-fixedbugs/bug040.go
-fixedbugs/bug045.go
-fixedbugs/bug046.go
-fixedbugs/bug047.go
-fixedbugs/bug048.go
-fixedbugs/bug049.go
-fixedbugs/bug050.go
-fixedbugs/bug051.go
-fixedbugs/bug052.go
-fixedbugs/bug053.go
-fixedbugs/bug054.go
-fixedbugs/bug055.go
-fixedbugs/bug056.go
-fixedbugs/bug057.go
-fixedbugs/bug058.go
-fixedbugs/bug059.go
-fixedbugs/bug060.go
-fixedbugs/bug061.go
-fixedbugs/bug062.go
-fixedbugs/bug063.go
-fixedbugs/bug064.go
-fixedbugs/bug065.go
-fixedbugs/bug066.go
-fixedbugs/bug068.go
-fixedbugs/bug069.go
-fixedbugs/bug071.go
-fixedbugs/bug072.go
-fixedbugs/bug073.go
-fixedbugs/bug074.go
-fixedbugs/bug075.go
-fixedbugs/bug076.go
-fixedbugs/bug077.go
-fixedbugs/bug078.go
-fixedbugs/bug080.go
-fixedbugs/bug082.go
-fixedbugs/bug083.go
-fixedbugs/bug084.go
-fixedbugs/bug085.go
-fixedbugs/bug086.go
-fixedbugs/bug087.go
-fixedbugs/bug088.go
-fixedbugs/bug089.go
-fixedbugs/bug090.go
-fixedbugs/bug091.go
-fixedbugs/bug092.go
-fixedbugs/bug094.go
-fixedbugs/bug096.go
-fixedbugs/bug097.go
-fixedbugs/bug098.go
-fixedbugs/bug099.go
-fixedbugs/bug101.go
-fixedbugs/bug102.go
-fixedbugs/bug103.go
-fixedbugs/bug104.go
-fixedbugs/bug106.go
-fixedbugs/bug107.go
-fixedbugs/bug108.go
-fixedbugs/bug109.go
-fixedbugs/bug110.go
-fixedbugs/bug111.go
-fixedbugs/bug112.go
-fixedbugs/bug114.go
-fixedbugs/bug115.go
-fixedbugs/bug116.go
-fixedbugs/bug117.go
-fixedbugs/bug118.go
-fixedbugs/bug119.go
-fixedbugs/bug120.go
-fixedbugs/bug121.go
-fixedbugs/bug122.go
-fixedbugs/bug123.go
-fixedbugs/bug126.go
-fixedbugs/bug127.go
-fixedbugs/bug128.go
-fixedbugs/bug129.go
-fixedbugs/bug130.go
-fixedbugs/bug131.go
-fixedbugs/bug132.go
-fixedbugs/bug133.go
-fixedbugs/bug135.go
-fixedbugs/bug136.go
-fixedbugs/bug137.go
-fixedbugs/bug139.go
-fixedbugs/bug140.go
-fixedbugs/bug141.go
-fixedbugs/bug142.go
-fixedbugs/bug143.go
-fixedbugs/bug144.go
-fixedbugs/bug145.go
-fixedbugs/bug146.go
-fixedbugs/bug149.go
-fixedbugs/bug150.go
-fixedbugs/bug151.go
-fixedbugs/bug152.go
-fixedbugs/bug153.go
-fixedbugs/bug154.go
-fixedbugs/bug155.go
-fixedbugs/bug156.go
-fixedbugs/bug157.go
-fixedbugs/bug158.go
-fixedbugs/bug160.go
-fixedbugs/bug161.go
-fixedbugs/bug163.go
-fixedbugs/bug164.go
-fixedbugs/bug165.go
-fixedbugs/bug167.go
-fixedbugs/bug168.go
-fixedbugs/bug169.go
-fixedbugs/bug170.go
-fixedbugs/bug171.go
-fixedbugs/bug172.go
-fixedbugs/bug173.go
-fixedbugs/bug174.go
-fixedbugs/bug175.go
-fixedbugs/bug176.go
-fixedbugs/bug177.go
-fixedbugs/bug178.go
-fixedbugs/bug179.go
-fixedbugs/bug180.go
-fixedbugs/bug181.go
-fixedbugs/bug182.go
-fixedbugs/bug183.go
-fixedbugs/bug184.go
-fixedbugs/bug185.go
-fixedbugs/bug186.go
-fixedbugs/bug187.go
-fixedbugs/bug188.go
-fixedbugs/bug189.go
-fixedbugs/bug190.go
-fixedbugs/bug191.go
-fixedbugs/bug192.go
-fixedbugs/bug193.go
-fixedbugs/bug194.go
-fixedbugs/bug195.go
-fixedbugs/bug196.go
-fixedbugs/bug197.go
-fixedbugs/bug198.go
-fixedbugs/bug199.go
-fixedbugs/bug200.go
-fixedbugs/bug201.go
-fixedbugs/bug202.go
-fixedbugs/bug203.go
-fixedbugs/bug204.go
-fixedbugs/bug205.go
-fixedbugs/bug206.go
-fixedbugs/bug207.go
-fixedbugs/bug208.go
-fixedbugs/bug209.go
-fixedbugs/bug211.go
-fixedbugs/bug212.go
-fixedbugs/bug213.go
-fixedbugs/bug214.go
-fixedbugs/bug215.go
-fixedbugs/bug216.go
-fixedbugs/bug217.go
-fixedbugs/bug218.go
-fixedbugs/bug219.go
-fixedbugs/bug220.go
-fixedbugs/bug221.go
-fixedbugs/bug222.go
-fixedbugs/bug223.go
-fixedbugs/bug224.go
-fixedbugs/bug225.go
-fixedbugs/bug226.go
-fixedbugs/bug227.go
-fixedbugs/bug228.go
-fixedbugs/bug229.go
-fixedbugs/bug230.go
-fixedbugs/bug231.go
-fixedbugs/bug232.go
-fixedbugs/bug233.go
-fixedbugs/bug234.go
-fixedbugs/bug235.go
-fixedbugs/bug236.go
-fixedbugs/bug237.go
-fixedbugs/bug238.go
-fixedbugs/bug239.go
-fixedbugs/bug240.go
-fixedbugs/bug241.go
-fixedbugs/bug244.go
-fixedbugs/bug245.go
-fixedbugs/bug247.go
-fixedbugs/bug248.go
-fixedbugs/bug249.go
diff --git a/test/nilptr/arrayindex.go b/test/nilptr/arrayindex.go
index c42dedee81..1767acc275 100644
--- a/test/nilptr/arrayindex.go
+++ b/test/nilptr/arrayindex.go
@@ -1,3 +1,4 @@
+// [ $GOOS != nacl ] || exit 0 # do not bother on NaCl
// $G $D/$F.go && $L $F.$A &&
// ((! sh -c ./$A.out) >/dev/null 2>&1 || echo BUG: should fail)
diff --git a/test/nilptr/arrayindex1.go b/test/nilptr/arrayindex1.go
index 59126f82d5..c16cac4053 100644
--- a/test/nilptr/arrayindex1.go
+++ b/test/nilptr/arrayindex1.go
@@ -1,3 +1,4 @@
+// [ $GOOS != nacl ] || exit 0 # do not bother on NaCl
// $G $D/$F.go && $L $F.$A &&
// ((! sh -c ./$A.out) >/dev/null 2>&1 || echo BUG: should fail)
diff --git a/test/nilptr/arraytoslice.go b/test/nilptr/arraytoslice.go
index 4864d68552..65b2f8a765 100644
--- a/test/nilptr/arraytoslice.go
+++ b/test/nilptr/arraytoslice.go
@@ -1,3 +1,4 @@
+// [ $GOOS != nacl ] || exit 0 # do not bother on NaCl
// $G $D/$F.go && $L $F.$A &&
// ((! sh -c ./$A.out) >/dev/null 2>&1 || echo BUG: should fail)
diff --git a/test/nilptr/arraytoslice1.go b/test/nilptr/arraytoslice1.go
index 1a479dcdb2..b5240a803a 100644
--- a/test/nilptr/arraytoslice1.go
+++ b/test/nilptr/arraytoslice1.go
@@ -1,3 +1,4 @@
+// [ $GOOS != nacl ] || exit 0 # do not bother on NaCl
// $G $D/$F.go && $L $F.$A &&
// ((! sh -c ./$A.out) >/dev/null 2>&1 || echo BUG: should fail)
diff --git a/test/nilptr/arraytoslice2.go b/test/nilptr/arraytoslice2.go
index 0990b899dd..38e1a5cb28 100644
--- a/test/nilptr/arraytoslice2.go
+++ b/test/nilptr/arraytoslice2.go
@@ -1,3 +1,4 @@
+// [ $GOOS != nacl ] || exit 0 # do not bother on NaCl
// $G $D/$F.go && $L $F.$A &&
// ((! sh -c ./$A.out) >/dev/null 2>&1 || echo BUG: should fail)
diff --git a/test/nilptr/slicearray.go b/test/nilptr/slicearray.go
index 7a156b5e64..5f88010df8 100644
--- a/test/nilptr/slicearray.go
+++ b/test/nilptr/slicearray.go
@@ -1,3 +1,4 @@
+// [ $GOOS != nacl ] || exit 0 # do not bother on NaCl
// $G $D/$F.go && $L $F.$A &&
// ((! sh -c ./$A.out) >/dev/null 2>&1 || echo BUG: should fail)
diff --git a/test/nilptr/structfield.go b/test/nilptr/structfield.go
index 22db500d7d..9f70ecc70f 100644
--- a/test/nilptr/structfield.go
+++ b/test/nilptr/structfield.go
@@ -1,3 +1,4 @@
+// [ $GOOS != nacl ] || exit 0 # do not bother on NaCl
// $G $D/$F.go && $L $F.$A &&
// ((! sh -c ./$A.out) >/dev/null 2>&1 || echo BUG: should fail)
diff --git a/test/nilptr/structfield1.go b/test/nilptr/structfield1.go
index 520136805f..1a120890a0 100644
--- a/test/nilptr/structfield1.go
+++ b/test/nilptr/structfield1.go
@@ -1,3 +1,4 @@
+// [ $GOOS != nacl ] || exit 0 # do not bother on NaCl
// $G $D/$F.go && $L $F.$A &&
// ((! sh -c ./$A.out) >/dev/null 2>&1 || echo BUG: should fail)
diff --git a/test/nilptr/structfield2.go b/test/nilptr/structfield2.go
index a0a552c933..25ea8f665c 100644
--- a/test/nilptr/structfield2.go
+++ b/test/nilptr/structfield2.go
@@ -1,3 +1,4 @@
+// [ $GOOS != nacl ] || exit 0 # do not bother on NaCl
// $G $D/$F.go && $L $F.$A &&
// ((! sh -c ./$A.out) >/dev/null 2>&1 || echo BUG: should fail)
diff --git a/test/nilptr/structfieldaddr.go b/test/nilptr/structfieldaddr.go
index 32e9f79315..b5d370ca8b 100644
--- a/test/nilptr/structfieldaddr.go
+++ b/test/nilptr/structfieldaddr.go
@@ -1,3 +1,4 @@
+// [ $GOOS != nacl ] || exit 0 # do not bother on NaCl
// $G $D/$F.go && $L $F.$A &&
// ((! sh -c ./$A.out) >/dev/null 2>&1 || echo BUG: should fail)
diff --git a/test/nul1.go b/test/nul1.go
index 026d397544..5e45963312 100644
--- a/test/nul1.go
+++ b/test/nul1.go
@@ -1,3 +1,4 @@
+// [ $GOOS != nacl ] || exit 0 # NaCl runner elides NUL in output
// $G $D/$F.go && $L $F.$A && ./$A.out >tmp.go &&
// errchk $G -e tmp.go
// rm -f tmp.go
diff --git a/test/recover3.go b/test/recover3.go
index f719b0ced1..b982ec8fa5 100644
--- a/test/recover3.go
+++ b/test/recover3.go
@@ -1,3 +1,4 @@
+// [ $GOOS != nacl ] || exit 0 # NaCl cannot recover from signals
// $G $D/$F.go && $L $F.$A && ./$A.out
// Copyright 2010 The Go Authors. All rights reserved.
diff --git a/test/run b/test/run
index 78014c867f..b3f54f12f2 100755
--- a/test/run
+++ b/test/run
@@ -22,7 +22,7 @@ esac
case X"$GOOS" in
Xnacl)
- export E="nacl"
+ export E=${GORUN:-$GOROOT/misc/nacl/naclrun}
esac
export G=${A}g
diff --git a/test/run-nacl b/test/run-nacl
deleted file mode 100755
index 2f5b7ba26f..0000000000
--- a/test/run-nacl
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/bin/sh
-# 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.
-
-case X"$GOARCH" in
-X386)
- # After downloading the Native Client binary distribution,
- # copy build/native_client/scons-out/opt-*/obj/src/trusted/service_runtime/sel_ldr
- # into your path as "nacl". You might need to wrap it to get rid of the
- # 'Exit syscall handler' print. To do that, install the binary as nacl.bin and
- # make this script nacl:
- # #!/bin/sh
- # nacl.bin "$@" 2>&1 | grep -v 'Exit syscall handler: 0'
- # exit 0
- export A=8
- export E=nacl
- ;;
-*)
- echo 1>&2 run: unsupported '$GOARCH'
- exit 1
-esac
-
-export G=${A}g
-export L=${A}l
-export GOTRACEBACK=0
-
-failed=0
-
-export PATH=/bin:/usr/bin:/usr/local/bin:${GOBIN:-$HOME/bin}:$HOME/bin:$(pwd)
-
-RUNFILE=/tmp/gorun-$$-$USER
-TMP1FILE=/tmp/gotest1-$$-$USER
-TMP2FILE=/tmp/gotest2-$$-$USER
-
-# don't run the machine out of memory: limit individual processes to 4GB.
-# on thresher, 3GB suffices to run the tests; with 2GB, peano fails.
-ulimit -v 4000000
-
-for i in $(cat nacl-pass.txt)
-do
- export F=$(basename $i .go)
- dir=$(dirname $i)
- export D=$dir
- sed '/^\/\//!q; s|//||g; s|./\$A.out|$E &|' $i >$RUNFILE
- if ! sh $RUNFILE >$TMP1FILE 2>$TMP2FILE
- then
- echo
- echo "===========" $i
- cat $TMP1FILE
- cat $TMP2FILE
- echo >&2 fail: $i
- elif test -s $TMP1FILE || test -s $TMP2FILE
- then
- echo
- echo "===========" $i
- cat $TMP1FILE
- cat $TMP2FILE
- elif [ $dir = "bugs" ]
- then
- echo $i succeeded with no output.
- fi
-done | # clean up some stack noise
- egrep -v '^(r[0-9a-z]+|[cfg]s) +0x' |
- sed '/tmp.*Bus error/s/.*Bus/Bus/; /tmp.*Trace.BPT/s/.*Trace/Trace/
- s!'$RUNFILE'!$RUNFILE!g
- s/ PC=0x[0-9a-f]*/ PC=xxx/
- s/^pc: 0x[0-9a-f]*/pc: xxx/
- /^Trace\/breakpoint trap/d
- /^Trace\/BPT trap/d
- /RUNFILE/ s/line 1: *[0-9][0-9]* /line 1: PID /
- /^\$RUNFILE: line 1: PID Trace\/breakpoint trap/d
- /^qemu: uncaught target signal 11 (Segmentation fault) - exiting/d' > run.out
-
-case $failed in
-0)
- echo PASS
- ;;
-1)
- echo FAIL
-esac
-rm -f $RUNFILE $TMP1FILE $TMP2FILE *.$A $A.out
-
-exit $failed
diff --git a/test/sigchld.go b/test/sigchld.go
index 5b95314df6..3887e2d024 100644
--- a/test/sigchld.go
+++ b/test/sigchld.go
@@ -1,3 +1,4 @@
+// if [ $GOOS == nacl ]; then echo survived SIGCHLD; exit 0; fi # NaCl has no signals.
// $G $D/$F.go && $L $F.$A && ./$A.out
// Copyright 2009 The Go Authors. All rights reserved.
diff --git a/test/stack.go b/test/stack.go
index 168830f70a..816b555a4c 100644
--- a/test/stack.go
+++ b/test/stack.go
@@ -68,5 +68,5 @@ func main() {
for i := 0; i < len(t); i++ {
t[i] = 1
}
- recur(10000)
+ recur(8000)
}