Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(32)

Issue 5495055: code review 5495055: go: implement test command (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 3 months ago by rsc
Modified:
13 years, 3 months ago
Reviewers:
CC:
golang-dev, r
Visibility:
Public.

Description

go: implement test command 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 $

Patch Set 1 #

Patch Set 2 : diff -r 56842d9b23d2 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r f49ead115cf9 https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r f49ead115cf9 https://go.googlecode.com/hg/ #

Total comments: 1

Patch Set 5 : diff -r e4e0c7c99d9d https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+486 lines, -59 lines) Patch
M src/cmd/go/Makefile View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/cmd/go/build.go View 1 9 chunks +35 lines, -22 lines 0 comments Download
M src/cmd/go/main.go View 1 3 chunks +12 lines, -2 lines 0 comments Download
M src/cmd/go/pkg.go View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/cmd/go/test.go View 1 2 3 2 chunks +405 lines, -6 lines 0 comments Download
M src/cmd/go/testflag.go View 1 2 3 4 7 chunks +32 lines, -29 lines 0 comments Download

Messages

Total messages: 3
rsc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 3 months ago (2011-12-15 23:57:10 UTC) #1
r
LGTM nice http://codereview.appspot.com/5495055/diff/5/src/cmd/go/testflag.go File src/cmd/go/testflag.go (right): http://codereview.appspot.com/5495055/diff/5/src/cmd/go/testflag.go#newcode21 src/cmd/go/testflag.go:21: -file=file_test.go: specify file to use for tests ...
13 years, 3 months ago (2011-12-16 00:35:41 UTC) #2
rsc
13 years, 3 months ago (2011-12-16 04:51:08 UTC) #3
*** Submitted as http://code.google.com/p/go/source/detail?r=4bd43e05039c ***

go: implement test command

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
http://codereview.appspot.com/5495055
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b