github.com/mwhudson/juju@v0.0.0-20160512215208-90ff01f3497f/cmd/juju/commands/package_test.go (about)

     1  // Copyright 2014 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package commands
     5  
     6  import (
     7  	"flag"
     8  	"os"
     9  	"runtime"
    10  	stdtesting "testing"
    11  
    12  	gittesting "github.com/juju/testing"
    13  
    14  	cmdtesting "github.com/juju/juju/cmd/testing"
    15  	_ "github.com/juju/juju/provider/dummy"
    16  	"github.com/juju/juju/testing"
    17  )
    18  
    19  func TestPackage(t *stdtesting.T) {
    20  	if runtime.GOARCH == "386" {
    21  		t.Skipf("skipping package for %v/%v, see http://pad.lv/1425569", runtime.GOOS, runtime.GOARCH)
    22  	}
    23  	if gittesting.RaceEnabled {
    24  		t.Skip("skipping test in -race mode, see LP 1518810")
    25  	}
    26  	testing.MgoTestPackage(t)
    27  }
    28  
    29  // Reentrancy point for testing (something as close as possible to) the juju
    30  // tool itself.
    31  func TestRunMain(t *stdtesting.T) {
    32  	if *cmdtesting.FlagRunMain {
    33  		os.Exit(Main(flag.Args()))
    34  	}
    35  }