mirror of
https://github.com/golang/go
synced 2024-11-21 19:34:46 -07:00
doc/progs: use test/run.go for testing on Windows
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
This commit is contained in:
parent
a96c2b8c1a
commit
5b7562dd6f
@ -25,3 +25,8 @@ all: $(RAWHTML)
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(RAWHTML)
|
rm -f $(RAWHTML)
|
||||||
|
|
||||||
|
compare:
|
||||||
|
for i in $(RAWHTML); do \
|
||||||
|
godoc -url /doc/$${i/.rawhtml/.html} | diff -u $$i -; \
|
||||||
|
done
|
||||||
|
@ -2973,7 +2973,7 @@ for instance, a URL, saving you typing the URL into the phone's tiny keyboard.
|
|||||||
Here's the complete program.
|
Here's the complete program.
|
||||||
An explanation follows.
|
An explanation follows.
|
||||||
</p>
|
</p>
|
||||||
{{code "/doc/progs/eff_qr.go"}}
|
{{code "/doc/progs/eff_qr.go" `/package/` `$`}}
|
||||||
<p>
|
<p>
|
||||||
The pieces up to <code>main</code> should be easy to follow.
|
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
|
The one flag sets a default HTTP port for our server. The template
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// skip
|
||||||
|
|
||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// skip
|
||||||
|
|
||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// skip
|
||||||
|
|
||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// skip
|
||||||
|
|
||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// cmpout
|
||||||
|
|
||||||
// Copyright 2011 The Go Authors. All rights reserved.
|
// Copyright 2011 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
3
doc/progs/defer.out
Normal file
3
doc/progs/defer.out
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
0
|
||||||
|
3210
|
||||||
|
2
|
@ -1,3 +1,5 @@
|
|||||||
|
// cmpout
|
||||||
|
|
||||||
// Copyright 2011 The Go Authors. All rights reserved.
|
// Copyright 2011 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
12
doc/progs/defer2.out
Normal file
12
doc/progs/defer2.out
Normal file
@ -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.
|
@ -1,3 +1,5 @@
|
|||||||
|
// cmpout
|
||||||
|
|
||||||
// Copyright 2009 The Go Authors. All rights reserved.
|
// Copyright 2009 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
1
doc/progs/eff_bytesize.out
Normal file
1
doc/progs/eff_bytesize.out
Normal file
@ -0,0 +1 @@
|
|||||||
|
1.00YB 9.09TB
|
@ -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
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// cmpout
|
||||||
|
|
||||||
// Copyright 2009 The Go Authors. All rights reserved.
|
// Copyright 2009 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
1
doc/progs/eff_sequence.out
Normal file
1
doc/progs/eff_sequence.out
Normal file
@ -0,0 +1 @@
|
|||||||
|
[-1 2 6 16 44]
|
@ -1,3 +1,5 @@
|
|||||||
|
// compile
|
||||||
|
|
||||||
// Copyright 2011 The Go Authors. All rights reserved.
|
// Copyright 2011 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// compile
|
||||||
|
|
||||||
// Copyright 2011 The Go Authors. All rights reserved.
|
// Copyright 2011 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// compile
|
||||||
|
|
||||||
// Copyright 2011 The Go Authors. All rights reserved.
|
// Copyright 2011 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// compile
|
||||||
|
|
||||||
// Copyright 2011 The Go Authors. All rights reserved.
|
// Copyright 2011 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE 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.
|
// Copyright 2011 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// compile
|
||||||
|
|
||||||
// Copyright 2011 The Go Authors. All rights reserved.
|
// Copyright 2011 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// compile
|
||||||
|
|
||||||
// Copyright 2011 The Go Authors. All rights reserved.
|
// Copyright 2011 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// compile
|
||||||
|
|
||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// cmpout
|
||||||
|
|
||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
1
doc/progs/image_package1.out
Normal file
1
doc/progs/image_package1.out
Normal file
@ -0,0 +1 @@
|
|||||||
|
X is 2 Y is 1
|
@ -1,3 +1,5 @@
|
|||||||
|
// cmpout
|
||||||
|
|
||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
1
doc/progs/image_package2.out
Normal file
1
doc/progs/image_package2.out
Normal file
@ -0,0 +1 @@
|
|||||||
|
3 4 false
|
@ -1,3 +1,5 @@
|
|||||||
|
// cmpout
|
||||||
|
|
||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
1
doc/progs/image_package3.out
Normal file
1
doc/progs/image_package3.out
Normal file
@ -0,0 +1 @@
|
|||||||
|
3 4 true
|
@ -1,3 +1,5 @@
|
|||||||
|
// cmpout
|
||||||
|
|
||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
1
doc/progs/image_package4.out
Normal file
1
doc/progs/image_package4.out
Normal file
@ -0,0 +1 @@
|
|||||||
|
image.Point{X:2, Y:1}
|
@ -1,3 +1,5 @@
|
|||||||
|
// cmpout
|
||||||
|
|
||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
1
doc/progs/image_package5.out
Normal file
1
doc/progs/image_package5.out
Normal file
@ -0,0 +1 @@
|
|||||||
|
{255 0 0 255}
|
@ -1,3 +1,5 @@
|
|||||||
|
// cmpout
|
||||||
|
|
||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
2
doc/progs/image_package6.out
Normal file
2
doc/progs/image_package6.out
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
8 4
|
||||||
|
true
|
@ -1,3 +1,5 @@
|
|||||||
|
// compile
|
||||||
|
|
||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// cmpout
|
||||||
|
|
||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
1
doc/progs/interface2.out
Normal file
1
doc/progs/interface2.out
Normal file
@ -0,0 +1 @@
|
|||||||
|
type: float64
|
@ -1,3 +1,5 @@
|
|||||||
|
// run
|
||||||
|
|
||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// cmpout
|
||||||
|
|
||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
2
doc/progs/json2.out
Normal file
2
doc/progs/json2.out
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
the circle's area 24.227111172875365
|
||||||
|
the reciprocal of i is 0.3601008282319049
|
@ -1,3 +1,5 @@
|
|||||||
|
// compile
|
||||||
|
|
||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// run
|
||||||
|
|
||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// compile
|
||||||
|
|
||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// compile
|
||||||
|
|
||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// compile
|
||||||
|
|
||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// compile
|
||||||
|
|
||||||
// Copyright 2012 The Go Authors. All rights reserved.
|
// Copyright 2012 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
15
doc/progs/update.bash
Executable file
15
doc/progs/update.bash
Executable file
@ -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
|
10
src/run.bat
10
src/run.bat
@ -70,7 +70,10 @@ go run %GOROOT%\test\run.go - ..\misc\cgo\life
|
|||||||
if errorlevel 1 goto fail
|
if errorlevel 1 goto fail
|
||||||
echo.
|
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.
|
:: 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
|
::echo # ..\misc\cgo\test
|
||||||
@ -79,6 +82,11 @@ echo.
|
|||||||
::echo.
|
::echo.
|
||||||
:nocgo
|
: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.
|
:: TODO: The other tests in run.bash.
|
||||||
|
|
||||||
echo # test
|
echo # test
|
||||||
|
Loading…
Reference in New Issue
Block a user