예제 #1
0
파일: main.go 프로젝트: jacobsa/aws
func main() {
	flag.Parse()

	if *g_keyId == "" {
		fmt.Println("You must set the -key_id flag.")
		fmt.Println("Find a key ID here:")
		fmt.Println("    https://portal.aws.amazon.com/gp/aws/securityCredentials")
		os.Exit(1)
	}

	if *g_bucketName == "" {
		fmt.Println("You must set the -bucket flag.")
		fmt.Println("Manage your buckets here:")
		fmt.Println("    https://console.aws.amazon.com/s3/")
		os.Exit(1)
	}

	if *g_region == "" {
		fmt.Println("You must set the -region flag. See region.go.")
		os.Exit(1)
	}

	// Read in the access key.
	g_accessKey.Id = *g_keyId
	g_accessKey.Secret = readPassword("Access key secret: ")

	// Run the tests.
	matchString := func(pat, str string) (bool, error) {
		re, err := regexp.Compile(pat)
		if err != nil {
			return false, err
		}

		return re.MatchString(str), nil
	}

	testing.Main(
		matchString,
		[]testing.InternalTest{
			testing.InternalTest{
				Name: "IntegrationTest",
				F:    func(t *testing.T) { ogletest.RunTests(t) },
			},
		},
		[]testing.InternalBenchmark{},
		[]testing.InternalExample{},
	)
}
예제 #2
0
func TestBucket(t *testing.T) { ogletest.RunTests(t) }