main_test.go 700 B

12345678910111213141516171819202122232425262728293031
  1. // Copyright 2013 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 e2e
  5. import (
  6. "flag"
  7. "os"
  8. "runtime"
  9. "testing"
  10. "github.com/coreos/etcd/pkg/testutil"
  11. )
  12. var binDir string
  13. var certDir string
  14. func TestMain(m *testing.M) {
  15. os.Setenv("ETCD_UNSUPPORTED_ARCH", runtime.GOARCH)
  16. flag.StringVar(&binDir, "bin-dir", "../bin", "The directory for store etcd and etcdctl binaries.")
  17. flag.StringVar(&certDir, "cert-dir", "../integration/fixtures", "The directory for store certificate files.")
  18. flag.Parse()
  19. v := m.Run()
  20. if v == 0 && testutil.CheckLeakedGoroutine() {
  21. os.Exit(1)
  22. }
  23. os.Exit(v)
  24. }