go test -short

Added a bunch a long running test function to the list of skipped
tests when giving -short to go test. Tests are bascially *all*
DNSSEC key generation tests and 1 serving test.

PASS
ok      github.com/miekg/dns    0.782s

Compared to 13+ s, so quite a bit faster.
This commit is contained in:
Miek Gieben 2014-11-12 10:19:20 +00:00
parent f3ed7c2b59
commit 5fc7e36983
4 changed files with 21 additions and 0 deletions

View File

@ -34,6 +34,9 @@ func getSoa() *SOA {
}
func TestGenerateEC(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode.")
}
key := new(DNSKEY)
key.Hdr.Rrtype = TypeDNSKEY
key.Hdr.Name = "miek.nl."
@ -48,6 +51,9 @@ func TestGenerateEC(t *testing.T) {
}
func TestGenerateDSA(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode.")
}
key := new(DNSKEY)
key.Hdr.Rrtype = TypeDNSKEY
key.Hdr.Name = "miek.nl."
@ -62,6 +68,9 @@ func TestGenerateDSA(t *testing.T) {
}
func TestGenerateRSA(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode.")
}
key := new(DNSKEY)
key.Hdr.Rrtype = TypeDNSKEY
key.Hdr.Name = "miek.nl."
@ -283,6 +292,9 @@ func TestTag(t *testing.T) {
}
func TestKeyRSA(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode.")
}
key := new(DNSKEY)
key.Hdr.Name = "miek.nl."
key.Hdr.Rrtype = TypeDNSKEY

View File

@ -1231,6 +1231,9 @@ type algorithm struct {
}
func TestNewPrivateKeyECDSA(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode.")
}
algorithms := []algorithm{
algorithm{ECDSAP256SHA256, 256},
algorithm{ECDSAP384SHA384, 384},

View File

@ -303,6 +303,9 @@ func TestServingLargeResponses(t *testing.T) {
}
func TestServingResponse(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode.")
}
HandleFunc("miek.nl.", HelloServer)
s, addrstr, err := RunLocalUDPServer("127.0.0.1:0")
if err != nil {

View File

@ -6,6 +6,9 @@ import (
)
func TestSIG0(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode.")
}
m := new(Msg)
m.SetQuestion("example.org.", TypeSOA)
for _, alg := range []uint8{DSA, ECDSAP256SHA256, ECDSAP384SHA384, RSASHA1, RSASHA256, RSASHA512} {