aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/csource_test.go
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2025-10-17 15:10:52 +0200
committerAlexander Potapenko <glider@google.com>2025-10-17 13:30:07 +0000
commit1c8c8cd830af4deee250ad11f1613d1d9a62ca0b (patch)
tree94150cb17ef443966a10139b5f6e67dacff49f09 /pkg/csource/csource_test.go
parent9b7c3903875ea246fda1aeac2cf62d7bb74b157b (diff)
pkg/csource: run testPseudoSyscalls() for all targets
Previously in the -short configuration testPseudoSyscalls() was only executed for the first supported target, which in most cases ended up being linux/386 (the least popular configuration). As a result, platform-specific pseudo-syscalls were never executed on the CI. Fix this by testing the pseudo-syscalls on all available platforms. This increases the execution time of TestGenerate from 18s to 36s, but also helps to discover bugs in pseudo-syscalls quicker. As a result of this change, 3 distinct latent bugs were found on amd64, arm64 and ppc64.
Diffstat (limited to 'pkg/csource/csource_test.go')
-rw-r--r--pkg/csource/csource_test.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/pkg/csource/csource_test.go b/pkg/csource/csource_test.go
index e48f197c3..f4cfe40a4 100644
--- a/pkg/csource/csource_test.go
+++ b/pkg/csource/csource_test.go
@@ -44,15 +44,14 @@ func TestGenerate(t *testing.T) {
}
t.Run(target.OS+"/"+target.Arch, func(t *testing.T) {
full := !checked[target.OS]
- if !full && testing.Short() {
- return
+ if full || !testing.Short() {
+ if err := sysTarget.BrokenCompiler; err != "" {
+ t.Skipf("target compiler is broken: %v", err)
+ }
+ checked[target.OS] = true
+ t.Parallel()
+ testTarget(t, target, full)
}
- if err := sysTarget.BrokenCompiler; err != "" {
- t.Skipf("target compiler is broken: %v", err)
- }
- checked[target.OS] = true
- t.Parallel()
- testTarget(t, target, full)
testPseudoSyscalls(t, target)
})
}