Gotest tries to build things, for which it invokes make,
and it was too hard to coordinate go invoking gotest
invoking go to build the test binary, so put all the code
here instead. Gotest will be deleted once we switch.
The only code that really made sense to copy verbatim
was the flag parsing.
This remains a work in progress. There are still plenty
of things to clean up and make better, but this is a good
checkpoint. It can run all the tests in the tree (except
runtime, which it can't build yet).
$ go test all -short
ok archive/tar
ok archive/zip
ok bufio
? builtin [no test files]
ok bytes
ok compress/bzip2
ok compress/flate
ok compress/gzip
ok compress/lzw
ok compress/zlib
ok container/heap
ok container/list
ok container/ring
? crypto [no test files]
ok crypto/aes
ok crypto/bcrypt
ok crypto/blowfish
ok crypto/cast5
ok crypto/cipher
ok crypto/des
ok crypto/dsa
ok crypto/ecdsa
ok crypto/elliptic
ok crypto/hmac
ok crypto/md4
ok crypto/md5
ok crypto/ocsp
ok crypto/openpgp
ok crypto/openpgp/armor
ok crypto/openpgp/elgamal
? crypto/openpgp/error [no test files]
ok crypto/openpgp/packet
ok crypto/openpgp/s2k
ok crypto/rand
ok crypto/rc4
ok crypto/ripemd160
ok crypto/rsa
ok crypto/sha1
ok crypto/sha256
ok crypto/sha512
ok crypto/subtle
ok crypto/tls
ok crypto/twofish
ok crypto/x509
? crypto/x509/pkix [no test files]
ok crypto/xtea
ok debug/dwarf
ok debug/elf
ok debug/gosym
ok debug/macho
ok debug/pe
ok encoding/ascii85
ok encoding/asn1
ok encoding/base32
ok encoding/base64
ok encoding/binary
ok encoding/csv
ok encoding/git85
ok encoding/gob
ok encoding/hex
ok encoding/json
ok encoding/pem
ok encoding/xml
ok errors
ok exp/ebnf
? exp/ebnflint [no test files]
ok exp/gotype
ok exp/norm
ok exp/spdy
ok exp/sql
ok exp/sql/driver
ok exp/ssh
ok exp/types
ok expvar
ok flag
ok fmt
ok go/ast
ok go/build
ok go/doc
ok go/parser
ok go/printer
ok go/scanner
ok go/token
? hash [no test files]
ok hash/adler32
ok hash/crc32
ok hash/crc64
ok hash/fnv
ok html
ok html/template
ok image
? image/bmp [no test files]
? image/color [no test files]
ok image/draw
? image/gif [no test files]
ok image/jpeg
ok image/png
ok image/tiff
ok image/ycbcr
ok index/suffixarray
ok io
ok io/ioutil
ok log
ok log/syslog
ok math
ok math/big
ok math/cmplx
ok math/rand
ok mime
ok mime/multipart
ok net
? net/dict [no test files]
ok net/http
ok net/http/cgi
ok net/http/fcgi
? net/http/httptest [no test files]
ok net/http/httputil
? net/http/pprof [no test files]
ok net/mail
ok net/rpc
ok net/rpc/jsonrpc
ok net/smtp
ok net/textproto
ok net/url
ok old/netchan
ok old/regexp
ok old/template
ok os
ok os/exec
ok os/signal
ok os/user
ok patch
ok path
ok path/filepath
ok reflect
ok regexp
ok regexp/syntax
# cd /Users/rsc/g/go/src/pkg/runtime; 6g -o /var/folders/mw/qfnx8hhd1_s9mm9wtbng0hw80000gn/T/go-build874847916/runtime_test/_obj/_go_.6 -p runtime_test -I /var/folders/mw/qfnx8hhd1_s9mm9wtbng0hw80000gn/T/go-build874847916 append_test.go chan_test.go closure_test.go gc_test.go mfinal_test.go proc_test.go sema_test.go softfloat64_test.go symtab_test.go
proc_test.go:87: undefined: runtime.Entersyscall
proc_test.go:88: undefined: runtime.Exitsyscall
proc_test.go:111: undefined: runtime.Entersyscall
proc_test.go:116: undefined: runtime.Exitsyscall
softfloat64_test.go:79: undefined: Fadd64
softfloat64_test.go:80: undefined: Fsub64
softfloat64_test.go:82: undefined: Fmul64
softfloat64_test.go:83: undefined: Fdiv64
softfloat64_test.go:94: undefined: F64to32
softfloat64_test.go:99: undefined: F32to64
softfloat64_test.go:99: too many errors
exit status 1
FAIL runtime [build failed]
? runtime/cgo [no test files]
ok runtime/debug
ok runtime/pprof
ok sort
ok strconv
ok strings
ok sync
ok sync/atomic
? syscall [no test files]
? testing [no test files]
? testing/iotest [no test files]
ok testing/quick
ok testing/script
ok text/scanner
ok text/tabwriter
ok text/template
ok text/template/parse
ok time
ok unicode
ok unicode/utf16
ok unicode/utf8
? unsafe [no test files]
ok websocket
$
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5495055
In 'go test' I deleted the leading package. prefix
from all the test names, since it contained no actual
information. Adjust the -test.run argument accordingly.
This will still work with the current gotest too, since
the argument is an unanchored pattern.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5491058
An example for a method M() of type T can be written as
func ExampleT_M() { ... }.
To differentiate between multiple examples for one function, type or
method a suffix with a lowercase start may be appended to the name
of the example function, e.g. ExampleFoo_basicUsage.
Fixes#2465.
R=golang-dev, adg, r, rsc, duperray.olivier, r
CC=golang-dev
https://golang.org/cl/5440100
I'm not 100% sure I get all the corner cases right, for end tags, but
I'll let the test suite smoke it out.
Pass tests10.dat, test 1:
<!DOCTYPE html><svg></svg><![CDATA[a]]>
| <!DOCTYPE html>
| <html>
| <head>
| <body>
| <svg svg>
| <!-- [CDATA[a]] -->
Also pass tests through test 5:
<!DOCTYPE html><body><table><svg></svg></table>
R=andybalholm
CC=golang-dev
https://golang.org/cl/5495044
In some rare cases, gofmt would accept more than the maximum
number of empty lines (1) between source code snippets.
The actual change is in printer.go, lines 773-775; the rest
is some minor restructuring.
Applied gofmt -w src misc .
Fixes#2387.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5496047
If a Pipe method is called, return the underlying
reader/writer from session.clientChan, bypassing the
io.Copy and io.Pipe harness.
StdoutPipe and StderrPipe now return an io.Reader not
an io.ReadCloser as SSH cannot signal the close of the
local reader to the remote process.
R=rsc, agl, gustav.paul, cw
CC=golang-dev
https://golang.org/cl/5493047
Just a rearrangement except for a couple of new functions
and names so govet.go can have all the generic walk routines.
R=rsc
CC=golang-dev
https://golang.org/cl/5489058
%g down to two mallocs from four. Also a mild speedup.
fmt_test.BenchmarkSprintfFloat 3016 2703 -10.38%
Fixes#2557.
R=rsc
CC=golang-dev
https://golang.org/cl/5491054
Before/after, best of 3:
json.BenchmarkCodeEncoder 10 183495300 ns/op 10.58 MB/s
->
json.BenchmarkCodeEncoder 10 133025100 ns/op 14.59 MB/s
But don't get too excited about this. These benchmarks, while
stable at any point of time, fluctuate wildly with any line of
code added or removed anywhere in the path due to stack splitting
issues.
It's currently much faster, though, and this is the API that
doesn't allocate so should always be faster in theory.
R=golang-dev, dsymonds, rsc, r, gri
CC=golang-dev
https://golang.org/cl/5411052
The plan is to make 'go test' replace gotest entirely, so it
cannot refer to gotest's godoc. Instead, copy gotest's
documentation in as three different help messages:
'go help test', 'go help testflag', and 'go help testfunc'.
R=r
CC=golang-dev
https://golang.org/cl/5491048
Several places mentioned tokens spanning "multiple lines"
which is not a well-defined term in the spec; newline is.
R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/5490046
It is probably a mistake to have these here at all -
os is supposed to be portable - but this only fixes
the build issue.
R=golang-dev, r, r, iant
CC=golang-dev
https://golang.org/cl/5487073
I have included a few important microbenchmarks,
but the overall intent is to have mostly end-to-end
benchmarks timing real world operations.
The jsondata.go file is a summary of agl's
activity in various open source repositories.
It gets used as test data for many of the benchmarks.
Everything links into one binary (even the test data)
so that it is easy to run the benchmarks on many
computers: there is just one file to copy around.
R=golang-dev, r, bradfitz, adg, r
CC=golang-dev
https://golang.org/cl/5484071
This avoids degraded performance caused by extra labels
emitted by inlining (breaking strconv ftoa alloc count unittest) and is better in any case.
R=rsc
CC=golang-dev
https://golang.org/cl/5483071
This change guarantees that whether the line ending convention
when the source is created includes carriage returns is irrelevant
to the value of the string. See issue 680.
The compilers do not yet implement this.
R=golang-dev, adg, r, gri, rsc, iant
CC=golang-dev
https://golang.org/cl/5491043
clean is gone; all the intermediate files are created
in a temporary tree that is wiped when the command ends.
Not using go/build's Script because it is not well aligned
with this API. The various builder methods are copied from
go/build and adapted. Probably once we delete goinstall
we can delete the Script API too.
R=rogpeppe, adg, adg
CC=golang-dev
https://golang.org/cl/5483069
Pass tests6.dat, test 26:
foo<col>
| <col>
Also pass tests through test 35:
<table><tr><div><td>
R=nigeltao
CC=golang-dev
https://golang.org/cl/5482074
I realize I didn't send the tests in last time. Anyway, I added
a test that knows too much about the package's internal structure,
and I'm not sure whether it's the right thing to do.
Vadik.
R=bradfitz, rsc, go.peter.90
CC=golang-dev
https://golang.org/cl/5450073
This redefinition means that the public signature of html/template
does not refer to text/template.
Fixes#2546.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5487083