main_test.go 619 B

123456789101112131415161718192021222324252627
  1. // Copyright 2016 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package ipv6_test
  5. import (
  6. "flag"
  7. "fmt"
  8. "os"
  9. "os/exec"
  10. "runtime"
  11. "strings"
  12. "testing"
  13. )
  14. func TestMain(m *testing.M) {
  15. flag.Parse()
  16. if runtime.GOOS == "darwin" {
  17. vers, _ := exec.Command("sw_vers", "-productVersion").Output()
  18. if string(vers) == "10.8" || strings.HasPrefix(string(vers), "10.8.") {
  19. fmt.Fprintf(os.Stderr, "# skipping tests on OS X 10.8 to avoid kernel panics; golang.org/issue/17015\n")
  20. os.Exit(0)
  21. }
  22. }
  23. os.Exit(m.Run())
  24. }