detached 5da5389

.github/workflows: add a native Windows/arm64 test target (#471)

Add windows-11-arm to the test matrix so the Windows/arm64 ABI is
exercised on real hardware (Go 1.25.x and 1.26.x).

The runner has no C toolchain that targets Windows arm64 (its bundled
gcc is an x86_64 mingw build and MSYS2 is omitted), so the tests that
compile a C shared library are skipped on windows/arm64, as they already
are on windows/386. The skip lives in buildSharedLib, so every test that
builds a C library inherits it. The remaining tests still cover the Go
callback and syscall paths on the platform.

Also skip the Windows steps that do not apply to arm64: the MSYS2 setup,
the Cgo variant of the 386 test, and the race detector, which Go does
not support on windows/arm64.

Closes #468

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
commit
5da538943ca77dfb42802ec46a21876c5874b8ee
author
Hajime Hoshi · · 2026-06-28 03:25 UTC
committer
GitHub · · 2026-06-28 03:25 UTC
parent
80e859b
signature
GPG UnverifiedB5690EEEBB952194 The key is unknown
7 files · +36 -24
M .github/workflows/test.yml +8 -3
@@ -9,7 +9,7 @@ jobs:
99 test:
1010 strategy:
1111 matrix:
12- os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest]
12+ os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest, windows-11-arm]
1313 go: ['1.25.x', '1.26.x']
1414 name: Test with Go ${{ matrix.go }} on ${{ matrix.os }}
1515 runs-on: ${{ matrix.os }}
@@ -31,8 +31,8 @@ jobs:
3131 with:
3232 go-version: ${{ matrix.go }}
3333
34- - name: Set up the prerequisites
35- if: runner.os == 'Windows'
34+ - name: Set up Msys2
35+ if: runner.os == 'Windows' && runner.arch != 'ARM64'
3636 uses: msys2/setup-msys2@v2
3737
3838 - name: go vet
@@ -127,6 +127,10 @@ jobs:
127127 if: runner.os == 'Windows'
128128 run: |
129129 env CGO_ENABLED=0 GOARCH=386 go test -shuffle=on -v -count=10 ./...
130+
131+ - name: go test (Windows 386, Cgo)
132+ if: runner.os == 'Windows' && runner.arch != 'ARM64'
133+ run: |
130134 env CGO_ENABLED=1 GOARCH=386 go test -shuffle=on -v -count=10 ./...
131135
132136 - name: go test (Linux 386)
@@ -180,6 +184,7 @@ jobs:
180184 env CGO_ENABLED=0 go test -race -shuffle=on -v -count=10 ./...
181185
182186 - name: go test race (Cgo)
187+ if: ${{ !(runner.os == 'Windows' && runner.arch == 'ARM64') }}
183188 run: |
184189 env CGO_ENABLED=1 go test -race -shuffle=on -v -count=10 ./...
185190
@@ -9,7 +9,7 @@ jobs:
9 test:9 test:
10 strategy:10 strategy:
11 matrix:11 matrix:
12- os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest]12+ os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest, windows-11-arm]
13 go: ['1.25.x', '1.26.x']13 go: ['1.25.x', '1.26.x']
14 name: Test with Go ${{ matrix.go }} on ${{ matrix.os }}14 name: Test with Go ${{ matrix.go }} on ${{ matrix.os }}
15 runs-on: ${{ matrix.os }}15 runs-on: ${{ matrix.os }}
@@ -31,8 +31,8 @@ jobs:
31 with:31 with:
32 go-version: ${{ matrix.go }}32 go-version: ${{ matrix.go }}
33 33
34- - name: Set up the prerequisites34+ - name: Set up Msys2
35- if: runner.os == 'Windows'35+ if: runner.os == 'Windows' && runner.arch != 'ARM64'
36 uses: msys2/setup-msys2@v236 uses: msys2/setup-msys2@v2
37 37
38 - name: go vet38 - name: go vet
@@ -127,6 +127,10 @@ jobs:
127 if: runner.os == 'Windows'127 if: runner.os == 'Windows'
128 run: |128 run: |
129 env CGO_ENABLED=0 GOARCH=386 go test -shuffle=on -v -count=10 ./...129 env CGO_ENABLED=0 GOARCH=386 go test -shuffle=on -v -count=10 ./...
130+
131+ - name: go test (Windows 386, Cgo)
132+ if: runner.os == 'Windows' && runner.arch != 'ARM64'
133+ run: |
130 env CGO_ENABLED=1 GOARCH=386 go test -shuffle=on -v -count=10 ./...134 env CGO_ENABLED=1 GOARCH=386 go test -shuffle=on -v -count=10 ./...
131 135
132 - name: go test (Linux 386)136 - name: go test (Linux 386)
@@ -180,6 +184,7 @@ jobs:
180 env CGO_ENABLED=0 go test -race -shuffle=on -v -count=10 ./...184 env CGO_ENABLED=0 go test -race -shuffle=on -v -count=10 ./...
181 185
182 - name: go test race (Cgo)186 - name: go test race (Cgo)
187+ if: ${{ !(runner.os == 'Windows' && runner.arch == 'ARM64') }}
183 run: |188 run: |
184 env CGO_ENABLED=1 go test -race -shuffle=on -v -count=10 ./...189 env CGO_ENABLED=1 go test -race -shuffle=on -v -count=10 ./...
185 190
M callback_test.go +7 -7
@@ -22,7 +22,7 @@ func TestCallGoFromSharedLib(t *testing.T) {
2222 libFileName := filepath.Join(t.TempDir(), "libcbtest.so")
2323 t.Logf("Build %v", libFileName)
2424
25- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_test.c")); err != nil {
25+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_test.c")); err != nil {
2626 t.Fatal(err)
2727 }
2828 defer os.Remove(libFileName)
@@ -186,7 +186,7 @@ func TestCallbackInt32Packing(t *testing.T) {
186186 }
187187
188188 libFileName := filepath.Join(t.TempDir(), "libcbtest_packing.so")
189- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {
189+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {
190190 t.Fatal(err)
191191 }
192192 defer os.Remove(libFileName)
@@ -218,7 +218,7 @@ func TestCallbackMixedStackPacking(t *testing.T) {
218218 }
219219
220220 libFileName := filepath.Join(t.TempDir(), "libcbtest_packing.so")
221- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {
221+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {
222222 t.Fatal(err)
223223 }
224224 defer os.Remove(libFileName)
@@ -251,7 +251,7 @@ func TestCallbackSmallTypesPacking(t *testing.T) {
251251 }
252252
253253 libFileName := filepath.Join(t.TempDir(), "libcbtest_packing.so")
254- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {
254+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {
255255 t.Fatal(err)
256256 }
257257 defer os.Remove(libFileName)
@@ -319,7 +319,7 @@ func TestCallback10Int32Packing(t *testing.T) {
319319 }
320320
321321 libFileName := filepath.Join(t.TempDir(), "libcbtest_packing.so")
322- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {
322+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {
323323 t.Fatal(err)
324324 }
325325 defer os.Remove(libFileName)
@@ -350,7 +350,7 @@ func TestCallbackFloat64StackPacking(t *testing.T) {
350350 }
351351
352352 libFileName := filepath.Join(t.TempDir(), "libcbtest_packing.so")
353- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {
353+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {
354354 t.Fatal(err)
355355 }
356356 defer os.Remove(libFileName)
@@ -384,7 +384,7 @@ func TestCallbackFloat32StackPacking(t *testing.T) {
384384 }
385385
386386 libFileName := filepath.Join(t.TempDir(), "libcbtest_packing.so")
387- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {
387+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {
388388 t.Fatal(err)
389389 }
390390 defer os.Remove(libFileName)
@@ -22,7 +22,7 @@ func TestCallGoFromSharedLib(t *testing.T) {
22 libFileName := filepath.Join(t.TempDir(), "libcbtest.so")22 libFileName := filepath.Join(t.TempDir(), "libcbtest.so")
23 t.Logf("Build %v", libFileName)23 t.Logf("Build %v", libFileName)
24 24
25- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_test.c")); err != nil {25+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_test.c")); err != nil {
26 t.Fatal(err)26 t.Fatal(err)
27 }27 }
28 defer os.Remove(libFileName)28 defer os.Remove(libFileName)
@@ -186,7 +186,7 @@ func TestCallbackInt32Packing(t *testing.T) {
186 }186 }
187 187
188 libFileName := filepath.Join(t.TempDir(), "libcbtest_packing.so")188 libFileName := filepath.Join(t.TempDir(), "libcbtest_packing.so")
189- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {189+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {
190 t.Fatal(err)190 t.Fatal(err)
191 }191 }
192 defer os.Remove(libFileName)192 defer os.Remove(libFileName)
@@ -218,7 +218,7 @@ func TestCallbackMixedStackPacking(t *testing.T) {
218 }218 }
219 219
220 libFileName := filepath.Join(t.TempDir(), "libcbtest_packing.so")220 libFileName := filepath.Join(t.TempDir(), "libcbtest_packing.so")
221- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {221+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {
222 t.Fatal(err)222 t.Fatal(err)
223 }223 }
224 defer os.Remove(libFileName)224 defer os.Remove(libFileName)
@@ -251,7 +251,7 @@ func TestCallbackSmallTypesPacking(t *testing.T) {
251 }251 }
252 252
253 libFileName := filepath.Join(t.TempDir(), "libcbtest_packing.so")253 libFileName := filepath.Join(t.TempDir(), "libcbtest_packing.so")
254- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {254+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {
255 t.Fatal(err)255 t.Fatal(err)
256 }256 }
257 defer os.Remove(libFileName)257 defer os.Remove(libFileName)
@@ -319,7 +319,7 @@ func TestCallback10Int32Packing(t *testing.T) {
319 }319 }
320 320
321 libFileName := filepath.Join(t.TempDir(), "libcbtest_packing.so")321 libFileName := filepath.Join(t.TempDir(), "libcbtest_packing.so")
322- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {322+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {
323 t.Fatal(err)323 t.Fatal(err)
324 }324 }
325 defer os.Remove(libFileName)325 defer os.Remove(libFileName)
@@ -350,7 +350,7 @@ func TestCallbackFloat64StackPacking(t *testing.T) {
350 }350 }
351 351
352 libFileName := filepath.Join(t.TempDir(), "libcbtest_packing.so")352 libFileName := filepath.Join(t.TempDir(), "libcbtest_packing.so")
353- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {353+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {
354 t.Fatal(err)354 t.Fatal(err)
355 }355 }
356 defer os.Remove(libFileName)356 defer os.Remove(libFileName)
@@ -384,7 +384,7 @@ func TestCallbackFloat32StackPacking(t *testing.T) {
384 }384 }
385 385
386 libFileName := filepath.Join(t.TempDir(), "libcbtest_packing.so")386 libFileName := filepath.Join(t.TempDir(), "libcbtest_packing.so")
387- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {387+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_packing_test.c")); err != nil {
388 t.Fatal(err)388 t.Fatal(err)
389 }389 }
390 defer os.Remove(libFileName)390 defer os.Remove(libFileName)
M dlfcn_test.go +1 -1
@@ -24,7 +24,7 @@ func TestNestedDlopenCall(t *testing.T) {
2424 libFileName := filepath.Join(t.TempDir(), "libdlnested.so")
2525 t.Logf("Build %v", libFileName)
2626
27- if err := buildSharedLib("CXX", libFileName, filepath.Join("testdata", "libdlnested", "nested_test.cpp")); err != nil {
27+ if err := buildSharedLib(t, "CXX", libFileName, filepath.Join("testdata", "libdlnested", "nested_test.cpp")); err != nil {
2828 t.Fatal(err)
2929 }
3030 defer os.Remove(libFileName)
@@ -24,7 +24,7 @@ func TestNestedDlopenCall(t *testing.T) {
24 libFileName := filepath.Join(t.TempDir(), "libdlnested.so")24 libFileName := filepath.Join(t.TempDir(), "libdlnested.so")
25 t.Logf("Build %v", libFileName)25 t.Logf("Build %v", libFileName)
26 26
27- if err := buildSharedLib("CXX", libFileName, filepath.Join("testdata", "libdlnested", "nested_test.cpp")); err != nil {27+ if err := buildSharedLib(t, "CXX", libFileName, filepath.Join("testdata", "libdlnested", "nested_test.cpp")); err != nil {
28 t.Fatal(err)28 t.Fatal(err)
29 }29 }
30 defer os.Remove(libFileName)30 defer os.Remove(libFileName)
M func_test.go +16 -9
@@ -178,13 +178,10 @@ func TestRegisterLibFunc_Bool(t *testing.T) {
178178 }
179179
180180 func TestABI(t *testing.T) {
181- if runtime.GOOS == "windows" && runtime.GOARCH == "386" {
182- t.Skip("need a 32bit gcc to run this test") // TODO: find 32bit gcc for test
183- }
184181 libFileName := filepath.Join(t.TempDir(), "abitest.so")
185182 t.Logf("Build %v", libFileName)
186183
187- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "abitest", "abi_test.c")); err != nil {
184+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "abitest", "abi_test.c")); err != nil {
188185 t.Fatal(err)
189186 }
190187
@@ -242,11 +239,8 @@ func TestABI(t *testing.T) {
242239 }
243240
244241 func TestABI_ArgumentPassing(t *testing.T) {
245- if runtime.GOOS == "windows" && runtime.GOARCH == "386" {
246- t.Skip("need a 32bit gcc to run this test") // TODO: find 32bit gcc for test
247- }
248242 libFileName := filepath.Join(t.TempDir(), "abitest.so")
249- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "abitest", "abi_test.c")); err != nil {
243+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "abitest", "abi_test.c")); err != nil {
250244 t.Fatal(err)
251245 }
252246 lib, err := load.OpenLibrary(libFileName)
@@ -603,7 +597,8 @@ func TestABI_TooManyArguments(t *testing.T) {
603597 })
604598 }
605599
606-func buildSharedLib(compilerEnv, libFile string, sources ...string) error {
600+func buildSharedLib(tb testing.TB, compilerEnv, libFile string, sources ...string) error {
601+ tb.Helper()
607602 // When PUREGO_TEST_PREBUILT_LIBDIR is set, the shared library has been
608603 // cross-compiled ahead of time and placed in that directory under the
609604 // base name of libFile. This allows running the tests on a target that
@@ -619,6 +614,18 @@ func buildSharedLib(compilerEnv, libFile string, sources ...string) error {
619614 return nil
620615 }
621616
617+ // Compiling the library needs a C toolchain targeting GOARCH. CI has none
618+ // for Windows on 386 or arm64, so skip those (the prebuilt path above
619+ // avoids the toolchain).
620+ if runtime.GOOS == "windows" {
621+ switch runtime.GOARCH {
622+ case "386":
623+ tb.Skip("need a 386 C toolchain to run this test") // TODO: find a 386 C toolchain for test
624+ case "arm64":
625+ tb.Skip("need an arm64 C toolchain to run this test")
626+ }
627+ }
628+
622629 out, err := exec.Command("go", "env", compilerEnv).Output()
623630 if err != nil {
624631 return fmt.Errorf("go env %s error: %w", compilerEnv, err)
@@ -178,13 +178,10 @@ func TestRegisterLibFunc_Bool(t *testing.T) {
178 }178 }
179 179
180 func TestABI(t *testing.T) {180 func TestABI(t *testing.T) {
181- if runtime.GOOS == "windows" && runtime.GOARCH == "386" {
182- t.Skip("need a 32bit gcc to run this test") // TODO: find 32bit gcc for test
183- }
184 libFileName := filepath.Join(t.TempDir(), "abitest.so")181 libFileName := filepath.Join(t.TempDir(), "abitest.so")
185 t.Logf("Build %v", libFileName)182 t.Logf("Build %v", libFileName)
186 183
187- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "abitest", "abi_test.c")); err != nil {184+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "abitest", "abi_test.c")); err != nil {
188 t.Fatal(err)185 t.Fatal(err)
189 }186 }
190 187
@@ -242,11 +239,8 @@ func TestABI(t *testing.T) {
242 }239 }
243 240
244 func TestABI_ArgumentPassing(t *testing.T) {241 func TestABI_ArgumentPassing(t *testing.T) {
245- if runtime.GOOS == "windows" && runtime.GOARCH == "386" {
246- t.Skip("need a 32bit gcc to run this test") // TODO: find 32bit gcc for test
247- }
248 libFileName := filepath.Join(t.TempDir(), "abitest.so")242 libFileName := filepath.Join(t.TempDir(), "abitest.so")
249- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "abitest", "abi_test.c")); err != nil {243+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "abitest", "abi_test.c")); err != nil {
250 t.Fatal(err)244 t.Fatal(err)
251 }245 }
252 lib, err := load.OpenLibrary(libFileName)246 lib, err := load.OpenLibrary(libFileName)
@@ -603,7 +597,8 @@ func TestABI_TooManyArguments(t *testing.T) {
603 })597 })
604 }598 }
605 599
606-func buildSharedLib(compilerEnv, libFile string, sources ...string) error {600+func buildSharedLib(tb testing.TB, compilerEnv, libFile string, sources ...string) error {
601+ tb.Helper()
607 // When PUREGO_TEST_PREBUILT_LIBDIR is set, the shared library has been602 // When PUREGO_TEST_PREBUILT_LIBDIR is set, the shared library has been
608 // cross-compiled ahead of time and placed in that directory under the603 // cross-compiled ahead of time and placed in that directory under the
609 // base name of libFile. This allows running the tests on a target that604 // base name of libFile. This allows running the tests on a target that
@@ -619,6 +614,18 @@ func buildSharedLib(compilerEnv, libFile string, sources ...string) error {
619 return nil614 return nil
620 }615 }
621 616
617+ // Compiling the library needs a C toolchain targeting GOARCH. CI has none
618+ // for Windows on 386 or arm64, so skip those (the prebuilt path above
619+ // avoids the toolchain).
620+ if runtime.GOOS == "windows" {
621+ switch runtime.GOARCH {
622+ case "386":
623+ tb.Skip("need a 386 C toolchain to run this test") // TODO: find a 386 C toolchain for test
624+ case "arm64":
625+ tb.Skip("need an arm64 C toolchain to run this test")
626+ }
627+ }
628+
622 out, err := exec.Command("go", "env", compilerEnv).Output()629 out, err := exec.Command("go", "env", compilerEnv).Output()
623 if err != nil {630 if err != nil {
624 return fmt.Errorf("go env %s error: %w", compilerEnv, err)631 return fmt.Errorf("go env %s error: %w", compilerEnv, err)
M struct_test.go +2 -2
@@ -24,7 +24,7 @@ func TestRegisterFunc_structArgs(t *testing.T) {
2424 libFileName := filepath.Join(t.TempDir(), "structtest.so")
2525 t.Logf("Build %v", libFileName)
2626
27- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "structtest", "struct_test.c")); err != nil {
27+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "structtest", "struct_test.c")); err != nil {
2828 t.Fatal(err)
2929 }
3030 defer os.Remove(libFileName)
@@ -859,7 +859,7 @@ func TestRegisterFunc_structReturns(t *testing.T) {
859859 libFileName := filepath.Join(t.TempDir(), "structreturntest.so")
860860 t.Logf("Build %v", libFileName)
861861
862- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "structtest", "structreturn_test.c")); err != nil {
862+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "structtest", "structreturn_test.c")); err != nil {
863863 t.Fatal(err)
864864 }
865865 defer os.Remove(libFileName)
@@ -24,7 +24,7 @@ func TestRegisterFunc_structArgs(t *testing.T) {
24 libFileName := filepath.Join(t.TempDir(), "structtest.so")24 libFileName := filepath.Join(t.TempDir(), "structtest.so")
25 t.Logf("Build %v", libFileName)25 t.Logf("Build %v", libFileName)
26 26
27- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "structtest", "struct_test.c")); err != nil {27+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "structtest", "struct_test.c")); err != nil {
28 t.Fatal(err)28 t.Fatal(err)
29 }29 }
30 defer os.Remove(libFileName)30 defer os.Remove(libFileName)
@@ -859,7 +859,7 @@ func TestRegisterFunc_structReturns(t *testing.T) {
859 libFileName := filepath.Join(t.TempDir(), "structreturntest.so")859 libFileName := filepath.Join(t.TempDir(), "structreturntest.so")
860 t.Logf("Build %v", libFileName)860 t.Logf("Build %v", libFileName)
861 861
862- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "structtest", "structreturn_test.c")); err != nil {862+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "structtest", "structreturn_test.c")); err != nil {
863 t.Fatal(err)863 t.Fatal(err)
864 }864 }
865 defer os.Remove(libFileName)865 defer os.Remove(libFileName)
M syscall_bench_test.go +1 -1
@@ -37,7 +37,7 @@ func BenchmarkCallingMethods(b *testing.B) {
3737
3838 // Build C library for benchmarking
3939 libFileName := filepath.Join(b.TempDir(), "libbenchmark.so")
40- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "benchmarktest", "benchmark.c")); err != nil {
40+ if err := buildSharedLib(b, "CC", libFileName, filepath.Join("testdata", "benchmarktest", "benchmark.c")); err != nil {
4141 b.Fatalf("Failed to build C library: %v", err)
4242 }
4343 b.Cleanup(func() {
@@ -37,7 +37,7 @@ func BenchmarkCallingMethods(b *testing.B) {
37 37
38 // Build C library for benchmarking38 // Build C library for benchmarking
39 libFileName := filepath.Join(b.TempDir(), "libbenchmark.so")39 libFileName := filepath.Join(b.TempDir(), "libbenchmark.so")
40- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "benchmarktest", "benchmark.c")); err != nil {40+ if err := buildSharedLib(b, "CC", libFileName, filepath.Join("testdata", "benchmarktest", "benchmark.c")); err != nil {
41 b.Fatalf("Failed to build C library: %v", err)41 b.Fatalf("Failed to build C library: %v", err)
42 }42 }
43 b.Cleanup(func() {43 b.Cleanup(func() {
M syscall_linux_test.go +1 -1
@@ -173,7 +173,7 @@ func compareStatus(filter, expect string) error {
173173 func TestDlopenThenAllThreadsSyscall(t *testing.T) {
174174 // Step 1: Build and load a shared C library that calls back into Go.
175175 libFileName := filepath.Join(t.TempDir(), "libcbtest.so")
176- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_test.c")); err != nil {
176+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_test.c")); err != nil {
177177 t.Fatal(err)
178178 }
179179 defer os.Remove(libFileName)
@@ -173,7 +173,7 @@ func compareStatus(filter, expect string) error {
173 func TestDlopenThenAllThreadsSyscall(t *testing.T) {173 func TestDlopenThenAllThreadsSyscall(t *testing.T) {
174 // Step 1: Build and load a shared C library that calls back into Go.174 // Step 1: Build and load a shared C library that calls back into Go.
175 libFileName := filepath.Join(t.TempDir(), "libcbtest.so")175 libFileName := filepath.Join(t.TempDir(), "libcbtest.so")
176- if err := buildSharedLib("CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_test.c")); err != nil {176+ if err := buildSharedLib(t, "CC", libFileName, filepath.Join("testdata", "libcbtest", "callback_test.c")); err != nil {
177 t.Fatal(err)177 t.Fatal(err)
178 }178 }
179 defer os.Remove(libFileName)179 defer os.Remove(libFileName)

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close