aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-04-11 12:04:52 +0200
committerAleksandr Nogikh <nogikh@google.com>2024-04-11 10:15:10 +0000
commit478efa7f2f5af720ac23b860a65d458f3db39b0c (patch)
tree8d7acbc48aba74d547100094f62e01e7b9d6b3b1 /pkg
parent3023abf07c73c9a0a063e98c300cadf64631d98f (diff)
pkg/cover: fix riscv tests
The TestReportGenerator/linux-riscv64/good-pie-relocs is broken due to some misinteroperability between gcc riscv cross-compiler and llvm-addr2line. Run the test only with clang.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/cover/report_test.go21
1 files changed, 18 insertions, 3 deletions
diff --git a/pkg/cover/report_test.go b/pkg/cover/report_test.go
index ab0be490b..7d5fa00c3 100644
--- a/pkg/cover/report_test.go
+++ b/pkg/cover/report_test.go
@@ -111,9 +111,24 @@ func TestReportGenerator(t *testing.T) {
LDFlags: []string{"-pie", "-Wl,--section-start=.text=0x33300000,--emit-relocs"},
DebugInfo: true,
Supports: func(target *targets.Target) bool {
- return target.OS == targets.Fuchsia ||
- target.OS == targets.Linux && target.Arch != targets.ARM64 &&
- target.Arch != targets.ARM && target.Arch != targets.I386
+ if target.OS == targets.Fuchsia {
+ return true
+ }
+ if target.OS == targets.Linux {
+ if target.Arch == targets.RiscV64 {
+ // When the binary is compiled with gcc and parsed with
+ // llvm-addr2line, we get an invalid "func_name", which
+ // breaks our tests.
+ fmt.Printf("target.CCompiler=%s", target.CCompiler)
+ return target.CCompiler == "clang"
+ }
+ if target.Arch == targets.ARM64 || target.Arch == targets.ARM ||
+ target.Arch == targets.I386 {
+ return false
+ }
+ return true
+ }
+ return false
},
},
}