2
0
mirror of synced 2025-02-22 14:28:14 +00:00

cmd/gomobile: skip test if keytool is bad

Looks like the binary is present on OS X even when Java is not
installed, and it returns an error when called.

Change-Id: Icbd42637f718a4fc05e65ea3973a584d1f24850e
Reviewed-on: https://go-review.googlesource.com/12743
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This commit is contained in:
David Crawshaw 2015-07-28 09:27:28 -04:00
parent b3bd3d29aa
commit 23401e249d

View File

@ -61,6 +61,8 @@ func TestSignPKCS7(t *testing.T) {
if keytool, err := exec.LookPath("keytool"); err != nil {
t.Log("command keytool not found, skipping")
} else if err := exec.Command(keytool, "-v").Run(); err != nil {
t.Log("command keytool not functioning: %s, skipping", err)
} else {
cmd := exec.Command(keytool, "-v", "-printcert", "-file", sigPath)
out, err := cmd.CombinedOutput()