From 4ac1cf8c54dd56d935bce8dc0b1863ff347345f4 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Mon, 21 Dec 2020 04:26:02 -0500
Subject: [PATCH 2/3] Only run native Linux tests on their own GOARCH.
We don't have the cross-compiled C libraries to do this. Even 386 builds
on koji do not work for this because it does not support multilib.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
main_test.go | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/main_test.go b/main_test.go
index 662fca66..aa2073fb 100644
--- a/main_test.go
+++ b/main_test.go
@@ -85,15 +85,24 @@ func TestCompiler(t *testing.T) {
}
if runtime.GOOS == "linux" {
- t.Run("X86Linux", func(t *testing.T) {
- runPlatTests("i386--linux-gnu", tests, t)
- })
- t.Run("ARMLinux", func(t *testing.T) {
- runPlatTests("arm--linux-gnueabihf", tests, t)
- })
- t.Run("ARM64Linux", func(t *testing.T) {
- runPlatTests("aarch64--linux-gnu", tests, t)
- })
+ switch runtime.GOARCH {
+ case "386":
+ t.Run("X86Linux", func(t *testing.T) {
+ runPlatTests("i386--linux-gnu", tests, t)
+ })
+ case "amd64":
+ t.Run("AMD64Linux", func(t *testing.T) {
+ runPlatTests("amd64--linux-gnu", tests, t)
+ })
+ case "arm":
+ t.Run("ARMLinux", func(t *testing.T) {
+ runPlatTests("arm--linux-gnueabihf", tests, t)
+ })
+ case "arm64":
+ t.Run("ARM64Linux", func(t *testing.T) {
+ runPlatTests("aarch64--linux-gnu", tests, t)
+ })
+ }
goVersion, err := goenv.GorootVersionString(goenv.Get("GOROOT"))
if err != nil {
t.Error("could not get Go version:", err)
--
2.31.1