github.com/altoros/juju-vmware@v0.0.0-20150312064031-f19ae857ccca/cmd/juju/package_test.go (about) 1 // Copyright 2014 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package main 5 6 import ( 7 "flag" 8 stdtesting "testing" 9 10 gc "gopkg.in/check.v1" 11 12 cmdtesting "github.com/juju/juju/cmd/testing" 13 _ "github.com/juju/juju/provider/dummy" // XXX Why? 14 "github.com/juju/juju/testing" 15 ) 16 17 func TestPackage(t *stdtesting.T) { 18 testing.MgoTestPackage(t) 19 } 20 21 func badrun(c *gc.C, exit int, args ...string) string { 22 args = append([]string{"juju"}, args...) 23 return cmdtesting.BadRun(c, exit, args...) 24 } 25 26 // Reentrancy point for testing (something as close as possible to) the juju 27 // tool itself. 28 func TestRunMain(t *stdtesting.T) { 29 if *cmdtesting.FlagRunMain { 30 Main(flag.Args()) 31 } 32 }