main_test.go 728 B

1234567891011121314151617181920212223242526272829303132
  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. os.Unsetenv("ETCDCTL_API")
  17. flag.StringVar(&binDir, "bin-dir", "../bin", "The directory for store etcd and etcdctl binaries.")
  18. flag.StringVar(&certDir, "cert-dir", "../integration/fixtures", "The directory for store certificate files.")
  19. flag.Parse()
  20. v := m.Run()
  21. if v == 0 && testutil.CheckLeakedGoroutine() {
  22. os.Exit(1)
  23. }
  24. os.Exit(v)
  25. }