~fwereade/pyjuju/go-fix-deploy-doc

« back to all changes in this revision

Viewing changes to cmd/juju/main_test.go

cmd/juju{c,d,}: fix testing issues by using package main

This issue has been biting roger and I for a while. After spending 
some time on it today and looking at other examples from the std lib
of testing main packages, it looks like when testing main (ie, from cmd/go)
all the tests run in package main. Our use of main_test appears unique.

R=fwereade, niemeyer
CC=
https://codereview.appspot.com/6260054

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
package main_test
 
1
package main
2
2
 
3
3
import (
4
4
        "flag"
5
5
        "fmt"
6
6
        "io/ioutil"
7
7
        . "launchpad.net/gocheck"
8
 
        main "launchpad.net/juju/go/cmd/juju"
9
8
        "os"
10
9
        "os/exec"
11
10
        "path/filepath"
26
25
// tool itself.
27
26
func TestRunMain(t *testing.T) {
28
27
        if *flagRunMain {
29
 
                main.Main(flag.Args())
 
28
                Main(flag.Args())
30
29
        }
31
30
}
32
31