Skip to content

Commit

Permalink
test: enable buildinfo tests for arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
Zxilly committed Feb 11, 2024
1 parent f98fa22 commit e4ddf41
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions modinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ func TestBuildInfo(t *testing.T) {
t.Run("extracting build info for "+test, func(t *testing.T) {
r := require.New(t)

// TODO: Remove this check when arm support has been added.
if strings.Contains(test, "arm64") {
t.Skip("ARM currently not supported")
}

fp, err := getTestResourcePath("gold/" + test)
r.NoError(err, "Failed to get path to resource")

Expand All @@ -65,17 +60,35 @@ func TestBuildInfo(t *testing.T) {
if GoVersionCompare(ver.Name, "go1.16") >= 0 {
// The mod info is not always available in Go versions earlier than 1.16.

if GoVersionCompare(ver.Name, "go1.19beta1") >= 0 {
//if GoVersionCompare(ver.Name, "go1.19beta1") >= 0 {
// r.Equal("github.com/goretk/gore/gold", f.BuildInfo.ModInfo.Path)
//} else {
// r.Equal("command-line-arguments", f.BuildInfo.ModInfo.Path)
//}
switch {
case GoVersionCompare(ver.Name, "go1.19beta1") >= 0:
r.Equal("github.com/goretk/gore/gold", f.BuildInfo.ModInfo.Path)
} else {
case GoVersionCompare(ver.Name, "go1.16.0") >= 0 && strings.Contains(test, "darwin-arm64"):
r.Equal("github.com/goretk/gore/gold", f.BuildInfo.ModInfo.Path)
default:
r.Equal("command-line-arguments", f.BuildInfo.ModInfo.Path)
}

if GoVersionCompare(ver.Name, "go1.19beta1") >= 0 {
//if GoVersionCompare(ver.Name, "go1.19beta1") >= 0 {
// r.Equal("(devel)", f.BuildInfo.ModInfo.Main.Version)
//} else if GoVersionCompare(ver.Name, "go1.18beta1") >= 0 {
// r.Equal("", f.BuildInfo.ModInfo.Main.Version)
//} else {
// r.Equal("(devel)", f.BuildInfo.ModInfo.Main.Version)
//}
switch {
case GoVersionCompare(ver.Name, "go1.19beta1") >= 0:
r.Equal("(devel)", f.BuildInfo.ModInfo.Main.Version)
case GoVersionCompare(ver.Name, "go1.18beta1") >= 0 && strings.Contains(test, "darwin-arm64"):
r.Equal("(devel)", f.BuildInfo.ModInfo.Main.Version)
} else if GoVersionCompare(ver.Name, "go1.18beta1") >= 0 {
case GoVersionCompare(ver.Name, "go1.18beta1") >= 0:
r.Equal("", f.BuildInfo.ModInfo.Main.Version)
} else {
default:
r.Equal("(devel)", f.BuildInfo.ModInfo.Main.Version)
}
}
Expand Down

0 comments on commit e4ddf41

Please sign in to comment.