]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/asm/internal/asm: run riscv64 end-to-end tests for each profile
authorJoel Sing <joel@sing.id.au>
Sun, 21 Dec 2025 03:48:18 +0000 (14:48 +1100)
committerGopher Robot <gobot@golang.org>
Tue, 23 Dec 2025 18:45:48 +0000 (10:45 -0800)
Currently, the end-to-end tests are only run for the profile set
via GORISCV64. Run each of the end-to-end tests for each profile,
increasing test coverage. Also rename tests to be RISCV64 specific,
rather than RISCV.

Change-Id: I15a70939064122c79ec5f2edcda1fa2a47c8cc95
Reviewed-on: https://go-review.googlesource.com/c/go/+/731921
Auto-Submit: Joel Sing <joel@sing.id.au>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Mark Ryan <markdryan@rivosinc.com>
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
src/cmd/asm/internal/asm/endtoend_test.go

index 0610a2d192910b6b63b588aa7ca8f03fd05a068b..28dce50d6096b9233353a048db3b1bf2555ae479 100644 (file)
@@ -491,16 +491,35 @@ func TestPPC64EndToEnd(t *testing.T) {
        }
 }
 
-func TestRISCVEndToEnd(t *testing.T) {
-       testEndToEnd(t, "riscv64", "riscv64")
+func testRISCV64AllProfiles(t *testing.T, testFn func(t *testing.T)) {
+       t.Helper()
+
+       defer func(orig int) { buildcfg.GORISCV64 = orig }(buildcfg.GORISCV64)
+
+       for _, goriscv64 := range []int{20, 22, 23} {
+               t.Run(fmt.Sprintf("rva%vu64", goriscv64), func(t *testing.T) {
+                       buildcfg.GORISCV64 = goriscv64
+                       testFn(t)
+               })
+       }
+}
+
+func TestRISCV64EndToEnd(t *testing.T) {
+       testRISCV64AllProfiles(t, func(t *testing.T) {
+               testEndToEnd(t, "riscv64", "riscv64")
+       })
 }
 
-func TestRISCVErrors(t *testing.T) {
-       testErrors(t, "riscv64", "riscv64error")
+func TestRISCV64Errors(t *testing.T) {
+       testRISCV64AllProfiles(t, func(t *testing.T) {
+               testErrors(t, "riscv64", "riscv64error")
+       })
 }
 
-func TestRISCVValidation(t *testing.T) {
-       testErrors(t, "riscv64", "riscv64validation")
+func TestRISCV64Validation(t *testing.T) {
+       testRISCV64AllProfiles(t, func(t *testing.T) {
+               testErrors(t, "riscv64", "riscv64validation")
+       })
 }
 
 func TestS390XEndToEnd(t *testing.T) {