diff options
Diffstat (limited to 'libgo/go/syslog')
-rw-r--r-- | libgo/go/syslog/syslog.go | 5 | ||||
-rw-r--r-- | libgo/go/syslog/syslog_test.go | 18 |
2 files changed, 20 insertions, 3 deletions
diff --git a/libgo/go/syslog/syslog.go b/libgo/go/syslog/syslog.go index 4ada113..6933372 100644 --- a/libgo/go/syslog/syslog.go +++ b/libgo/go/syslog/syslog.go @@ -2,9 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// The syslog package provides a simple interface to -// the system log service. It can send messages to the -// syslog daemon using UNIX domain sockets, UDP, or +// Package syslog provides a simple interface to the system log service. It +// can send messages to the syslog daemon using UNIX domain sockets, UDP, or // TCP connections. package syslog diff --git a/libgo/go/syslog/syslog_test.go b/libgo/go/syslog/syslog_test.go index 2958bcb..5c0b3e0 100644 --- a/libgo/go/syslog/syslog_test.go +++ b/libgo/go/syslog/syslog_test.go @@ -35,7 +35,19 @@ func startServer(done chan<- string) { go runSyslog(c, done) } +func skipNetTest(t *testing.T) bool { + if testing.Short() { + // Depends on syslog daemon running, and sometimes it's not. + t.Logf("skipping syslog test during -short") + return true + } + return false +} + func TestNew(t *testing.T) { + if skipNetTest(t) { + return + } s, err := New(LOG_INFO, "") if err != nil { t.Fatalf("New() failed: %s", err) @@ -45,6 +57,9 @@ func TestNew(t *testing.T) { } func TestNewLogger(t *testing.T) { + if skipNetTest(t) { + return + } f := NewLogger(LOG_INFO, 0) if f == nil { t.Error("NewLogger() failed") @@ -52,6 +67,9 @@ func TestNewLogger(t *testing.T) { } func TestDial(t *testing.T) { + if skipNetTest(t) { + return + } l, err := Dial("", "", LOG_ERR, "syslog_test") if err != nil { t.Fatalf("Dial() failed: %s", err) |