]> Cypherpunks repositories - gostls13.git/commitdiff
doc/progs: use test/run.go for testing on Windows
authorShenghou Ma <minux.ma@gmail.com>
Sun, 2 Sep 2012 19:49:03 +0000 (03:49 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Sun, 2 Sep 2012 19:49:03 +0000 (03:49 +0800)
        cgo[1-4].go, go1.go couldn't be tested now
(cgo[1-4].go can only be tested when cgo is enabled, go1.go
contain a list of filenames in the current directory)

R=golang-dev, alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/6218048

49 files changed:
doc/Makefile
doc/effective_go.html
doc/progs/cgo1.go
doc/progs/cgo2.go
doc/progs/cgo3.go
doc/progs/cgo4.go
doc/progs/defer.go
doc/progs/defer.out [new file with mode: 0644]
doc/progs/defer2.go
doc/progs/defer2.out [new file with mode: 0644]
doc/progs/eff_bytesize.go
doc/progs/eff_bytesize.out [new file with mode: 0644]
doc/progs/eff_qr.go
doc/progs/eff_sequence.go
doc/progs/eff_sequence.out [new file with mode: 0644]
doc/progs/error.go
doc/progs/error2.go
doc/progs/error3.go
doc/progs/error4.go
doc/progs/go1.go
doc/progs/gobs1.go
doc/progs/gobs2.go
doc/progs/image_draw.go
doc/progs/image_package1.go
doc/progs/image_package1.out [new file with mode: 0644]
doc/progs/image_package2.go
doc/progs/image_package2.out [new file with mode: 0644]
doc/progs/image_package3.go
doc/progs/image_package3.out [new file with mode: 0644]
doc/progs/image_package4.go
doc/progs/image_package4.out [new file with mode: 0644]
doc/progs/image_package5.go
doc/progs/image_package5.out [new file with mode: 0644]
doc/progs/image_package6.go
doc/progs/image_package6.out [new file with mode: 0644]
doc/progs/interface.go
doc/progs/interface2.go
doc/progs/interface2.out [new file with mode: 0644]
doc/progs/json1.go
doc/progs/json2.go
doc/progs/json2.out [new file with mode: 0644]
doc/progs/json3.go
doc/progs/json4.go
doc/progs/json5.go
doc/progs/slices.go
doc/progs/timeout1.go
doc/progs/timeout2.go
doc/progs/update.bash [new file with mode: 0755]
src/run.bat

index b6e475b84e962a61560b50545b4286d666fd87d0..23262da944d98fde07dfe03a916d8d28065497e7 100644 (file)
@@ -25,3 +25,8 @@ all: $(RAWHTML)
 
 clean:
        rm -f $(RAWHTML)
+
+compare:
+       for i in $(RAWHTML); do \
+               godoc -url /doc/$${i/.rawhtml/.html} | diff -u $$i -; \
+       done
index 6cacac6303a7e24225c82bcf48a637f968f436cd..fc793591b55f8c1e7169f19db4709839cd0e05be 100644 (file)
@@ -2973,7 +2973,7 @@ for instance, a URL, saving you typing the URL into the phone's tiny keyboard.
 Here's the complete program.
 An explanation follows.
 </p>
-{{code "/doc/progs/eff_qr.go"}}
+{{code "/doc/progs/eff_qr.go" `/package/` `$`}}
 <p>
 The pieces up to <code>main</code> should be easy to follow.
 The one flag sets a default HTTP port for our server.  The template
index b79ee368a4660fd063c063b894c716bf83a4b1db..1a2dc6c964d806a1ac5c2b81e51e5f53a4a1b74b 100644 (file)
@@ -1,3 +1,5 @@
+// skip
+
 // Copyright 2012 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.
index f38473b13e539a896238345ffcdb4ff9f29c448c..9999af344b925897358bfdc5ea10211791fbc1b9 100644 (file)
@@ -1,3 +1,5 @@
+// skip
+
 // Copyright 2012 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.
index 435fd0402d4e8ebfb1d6550369f7ea9b8a96476e..c4f4791e8c7e8483746294f782ba32ccd6c443b6 100644 (file)
@@ -1,3 +1,5 @@
+// skip
+
 // Copyright 2012 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.
index 3808d62179ca16a02351d61f87d59eeda83bfc0a..30b8935723c837bfe422991d8c035ab804c5c953 100644 (file)
@@ -1,3 +1,5 @@
+// skip
+
 // Copyright 2012 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.
index 2e11020abf54ce4506afc68e80ee70cdb8db7a91..006a474b5d0b2ee5dae1e14f06925f034ad97c91 100644 (file)
@@ -1,3 +1,5 @@
+// cmpout
+
 // Copyright 2011 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.
diff --git a/doc/progs/defer.out b/doc/progs/defer.out
new file mode 100644 (file)
index 0000000..0cdf53a
--- /dev/null
@@ -0,0 +1,3 @@
+0
+3210
+2
index cad66b0702b3d49c0f338ef0c627fa8940452508..ff7eaf9d890cf4cf8e00a0255f13ea63f236eeda 100644 (file)
@@ -1,3 +1,5 @@
+// cmpout
+
 // Copyright 2011 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.
diff --git a/doc/progs/defer2.out b/doc/progs/defer2.out
new file mode 100644 (file)
index 0000000..6110685
--- /dev/null
@@ -0,0 +1,12 @@
+Calling g.
+Printing in g 0
+Printing in g 1
+Printing in g 2
+Printing in g 3
+Panicking!
+Defer in g 3
+Defer in g 2
+Defer in g 1
+Defer in g 0
+Recovered in f 4
+Returned normally from f.
index b45961114dd3bd81d0d3e2f587bf3ad67561a8df..a0c3d505850a6eaa33a690109b9ff099b9709cb1 100644 (file)
@@ -1,3 +1,5 @@
+// cmpout
+
 // 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.
diff --git a/doc/progs/eff_bytesize.out b/doc/progs/eff_bytesize.out
new file mode 100644 (file)
index 0000000..df763f3
--- /dev/null
@@ -0,0 +1 @@
+1.00YB 9.09TB
index de96a0208f43f0e83b2a2a68f463270bb0d875b9..4ac745c93079c08b31df28047a3ea485ed06f68e 100644 (file)
@@ -1,3 +1,9 @@
+// compile
+
+// 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.
+
 package main
 
 import (
index 11c885abf82a34013248c5246167434f4f8776da..c9b18ba93547740e39a017c97c8607ffb122a681 100644 (file)
@@ -1,3 +1,5 @@
+// cmpout
+
 // 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.
diff --git a/doc/progs/eff_sequence.out b/doc/progs/eff_sequence.out
new file mode 100644 (file)
index 0000000..fd01a7d
--- /dev/null
@@ -0,0 +1 @@
+[-1 2 6 16 44]
index f85a5273a450c6da19fd71428ab6adc210d4e209..f5073266525cafd1899232d02d7048a9fbe44e2a 100644 (file)
@@ -1,3 +1,5 @@
+// compile
+
 // Copyright 2011 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.
index 2b0e0c3563a56d4738ec6deadcb850e2490624a1..aad1dc8e8ef47697f6ef7a5dc4170b03224a2150 100644 (file)
@@ -1,3 +1,5 @@
+// compile
+
 // Copyright 2011 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.
index e4e57e077b52ace4126868985272fe060e5d9b5d..9f1b3007279b98c4a258caf60dc8669333de39e7 100644 (file)
@@ -1,3 +1,5 @@
+// compile
+
 // Copyright 2011 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.
index 8f35cf74bb852e96ec7aac431337ac5aed5f862f..bf234c98f8bb294e137e484df9f2b96182d71249 100644 (file)
@@ -1,3 +1,5 @@
+// compile
+
 // Copyright 2011 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.
index 50fd93441f477e636e4a0274b09448717ceddff5..a4dc64d469668bee636233a6bd0108b24a009b9c 100644 (file)
@@ -1,3 +1,6 @@
+// compile
+// this file will output a list of filenames in cwd, not suitable for cmpout
+
 // Copyright 2011 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.
index 7077ca159f994d78aadd3e516d804403f6dbd9fe..d95f765d811cb13083946e3bfd38520780dbd904 100644 (file)
@@ -1,3 +1,5 @@
+// compile
+
 // Copyright 2011 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.
index 85bb41cdca72f1c357794dc7b46b16b6dbfba274..acd18382f71f4c3d7830097d386f5f85adeddf04 100644 (file)
@@ -1,3 +1,5 @@
+// compile
+
 // Copyright 2011 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.
index bb73c8a714f0fc752d34a12445b91023bf27f0f7..0a1f7acb1a6c62990398e1fc87e42d2942e2c87e 100644 (file)
@@ -1,3 +1,5 @@
+// compile
+
 // Copyright 2012 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.
index c4c401e729e9eab6ea8e77ce7d1edb32d0758b6b..d331834fc6b7e40a17ae85b843c348e9fed71393 100644 (file)
@@ -1,3 +1,5 @@
+// cmpout
+
 // Copyright 2012 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.
diff --git a/doc/progs/image_package1.out b/doc/progs/image_package1.out
new file mode 100644 (file)
index 0000000..809b31b
--- /dev/null
@@ -0,0 +1 @@
+X is 2 Y is 1
index fcb5d9fd039298abb26458b868d95a1b056e8588..e5b78b48521edd6604c8d448c9afc62b72f6d05b 100644 (file)
@@ -1,3 +1,5 @@
+// cmpout
+
 // Copyright 2012 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.
diff --git a/doc/progs/image_package2.out b/doc/progs/image_package2.out
new file mode 100644 (file)
index 0000000..616d307
--- /dev/null
@@ -0,0 +1 @@
+3 4 false
index 13d0f08079c7b361599a864607f9a86488e11547..95d72a0b2e3fae19e134f34faf064d3be8c4e5e3 100644 (file)
@@ -1,3 +1,5 @@
+// cmpout
+
 // Copyright 2012 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.
diff --git a/doc/progs/image_package3.out b/doc/progs/image_package3.out
new file mode 100644 (file)
index 0000000..3fe35de
--- /dev/null
@@ -0,0 +1 @@
+3 4 true
index c46fddf07a1b869239000f31635bcc0a23b68adb..ec0e4613d5da144b08156b128311b49e01e6fe56 100644 (file)
@@ -1,3 +1,5 @@
+// cmpout
+
 // Copyright 2012 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.
diff --git a/doc/progs/image_package4.out b/doc/progs/image_package4.out
new file mode 100644 (file)
index 0000000..cb1b777
--- /dev/null
@@ -0,0 +1 @@
+image.Point{X:2, Y:1}
index 0bb5c7608e1a39801afeac17d522d42e22bdb759..b9e27d6dad523cbd4aa420ef160a25e0599b35f4 100644 (file)
@@ -1,3 +1,5 @@
+// cmpout
+
 // Copyright 2012 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.
diff --git a/doc/progs/image_package5.out b/doc/progs/image_package5.out
new file mode 100644 (file)
index 0000000..2da80c1
--- /dev/null
@@ -0,0 +1 @@
+{255 0 0 255}
index 62eeecdb9230e35dd53711c94eb392169dd26109..5e6eefa04a538d5eb8fd3f317d5ef1ab6b31eaa6 100644 (file)
@@ -1,3 +1,5 @@
+// cmpout
+
 // Copyright 2012 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.
diff --git a/doc/progs/image_package6.out b/doc/progs/image_package6.out
new file mode 100644 (file)
index 0000000..fcd13c0
--- /dev/null
@@ -0,0 +1,2 @@
+8 4
+true
index c2925d590d5659cb3c5a9566a87059f06cd6a484..6972b7287143971d58460837ea637b6ee6c322e0 100644 (file)
@@ -1,3 +1,5 @@
+// compile
+
 // Copyright 2012 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.
index a541d94e4839815564a68e7f5b7848f1809e8c20..85e7d51636494e13542612b8109b032daf940357 100644 (file)
@@ -1,3 +1,5 @@
+// cmpout
+
 // Copyright 2012 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.
diff --git a/doc/progs/interface2.out b/doc/progs/interface2.out
new file mode 100644 (file)
index 0000000..085bd01
--- /dev/null
@@ -0,0 +1 @@
+type: float64
index 9e10f4743df7ffe68a80935fadfb8671cf62f89a..887d7d18307b9645f815880873bbed7024d9277e 100644 (file)
@@ -1,3 +1,5 @@
+// run
+
 // Copyright 2012 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.
index 6089ae6710c80181e4fb80218279046a72bbec0d..f358feaa2991871a1e07c7a123223bb5dfd4ffdc 100644 (file)
@@ -1,3 +1,5 @@
+// cmpout
+
 // Copyright 2012 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.
diff --git a/doc/progs/json2.out b/doc/progs/json2.out
new file mode 100644 (file)
index 0000000..8f2dea5
--- /dev/null
@@ -0,0 +1,2 @@
+the circle's area 24.227111172875365
+the reciprocal of i is 0.3601008282319049
index a04fdfa506a8dfeec2d6057b4cfc6ab464e492cd..41eb3730c51734888a6ce3c6115cbcae0d2a92e3 100644 (file)
@@ -1,3 +1,5 @@
+// compile
+
 // Copyright 2012 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.
index 49263022065fc96b48e86b043377d1ca5ae0d4ba..ee38f31ad968d986a9eb259cd692714202d05aa5 100644 (file)
@@ -1,3 +1,5 @@
+// run
+
 // Copyright 2012 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.
index 6d7a4ca8c47dd3c65638b696c3af8035204ba3ca..9ab972df89a9be4bdab722662dda44b302963dfe 100644 (file)
@@ -1,3 +1,5 @@
+// compile
+
 // Copyright 2012 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.
index 8e440103efcf966a3c8c71f2ebd2994e9da1175d..0461684b705a680ff11d60cbbe28012ee991de9a 100644 (file)
@@ -1,3 +1,5 @@
+// compile
+
 // Copyright 2012 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.
index 5221770ec6b3d8355c19fbd694488f1e8fdf76e8..fbc39caac21e651f8d14c1ef6c411fdcc679bb43 100644 (file)
@@ -1,3 +1,5 @@
+// compile
+
 // Copyright 2012 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.
index 7145bc93e18126b868bd8fb9c6f4947d45fd2010..a12bc2ab1c8c00863fa23ffaa0bcc35de6f542bb 100644 (file)
@@ -1,3 +1,5 @@
+// compile
+
 // Copyright 2012 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.
diff --git a/doc/progs/update.bash b/doc/progs/update.bash
new file mode 100755 (executable)
index 0000000..d4ecfbe
--- /dev/null
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+# Copyright 2012 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.
+
+set -e
+
+rm -f *.out *.rej *.orig [568].out
+
+for i in *.go; do
+       if grep -q '^// cmpout$' $i; then
+               echo $i
+               go run $i &> ${i/.go/.out}
+       fi
+done
index 64398ccc5fabec4728e7b853ddce11fcc46ff308..471192662334dcc9e79156ba02e64b07806babad 100644 (file)
@@ -70,7 +70,10 @@ go run %GOROOT%\test\run.go - ..\misc\cgo\life
 if errorlevel 1 goto fail
 echo.
 
-:: TODO ..\misc\cgo\stdio
+echo # ..\misc\cgo\stdio
+go run %GOROOT%\test\run.go - ..\misc\cgo\stdio
+if errorlevel 1 goto fail
+echo.
 
 :: TODO(brainman): disabled, because it fails with: mkdir C:\Users\ADMINI~1\AppData\Local\Temp\2.....\go\misc\cgo\: The filename or extension is too long.
 ::echo # ..\misc\cgo\test
@@ -79,6 +82,11 @@ echo.
 ::echo.
 :nocgo
 
+echo # ..\doc\progs
+go run %GOROOT%\test\run.go - ..\doc\progs
+if errorlevel 1 goto fail
+echo.
+
 :: TODO: The other tests in run.bash.
 
 echo # test