summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOsama Abdelkader <osama.abdelkader@gmail.com>2025-09-20 20:27:33 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-09-22 22:09:48 +0100
commitfce945da2d2c73eb076336c79449c937f2044c99 (patch)
treed78303288bf9ad3745ffff40bedd817e1900e387
parentb4c1f355ac9b11ce20341f3f37766e8e61906731 (diff)
downloadpoky-fce945da2d2c73eb076336c79449c937f2044c99.tar.gz
go: remove duplicate arch map in sdk test
ARCH_MAP is duplicating an existing map in meta/lib/oe/go.py use oe.go map_arch instead. (From OE-Core rev: c2ba36f41777d347fd5ffcd9b6862638e5f35a1b) Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/sdk/cases/go.py31
1 files changed, 5 insertions, 26 deletions
diff --git a/meta/lib/oeqa/sdk/cases/go.py b/meta/lib/oeqa/sdk/cases/go.py
index 9c15124f6a..a050df7a9f 100644
--- a/meta/lib/oeqa/sdk/cases/go.py
+++ b/meta/lib/oeqa/sdk/cases/go.py
@@ -12,6 +12,7 @@ from oeqa.core.utils.path import remove_safe
12from oeqa.sdk.case import OESDKTestCase 12from oeqa.sdk.case import OESDKTestCase
13 13
14from oeqa.utils.subprocesstweak import errors_have_output 14from oeqa.utils.subprocesstweak import errors_have_output
15from oe.go import map_arch
15errors_have_output() 16errors_have_output()
16 17
17class GoCompileTest(OESDKTestCase): 18class GoCompileTest(OESDKTestCase):
@@ -55,22 +56,6 @@ class GoCompileTest(OESDKTestCase):
55class GoHostCompileTest(OESDKTestCase): 56class GoHostCompileTest(OESDKTestCase):
56 td_vars = ['MACHINE', 'SDK_SYS', 'TARGET_ARCH'] 57 td_vars = ['MACHINE', 'SDK_SYS', 'TARGET_ARCH']
57 58
58 # Architecture mapping from Yocto/Poky to Go
59 ARCH_MAP = {
60 'aarch64': 'arm64',
61 'cortexa57': 'arm64', # ARM Cortex-A57 is ARM64
62 'cortexa72': 'arm64', # ARM Cortex-A72 is ARM64
63 'cortexa53': 'arm64', # ARM Cortex-A53 is ARM64
64 'x86_64': 'amd64',
65 'i586': '386',
66 'i686': '386',
67 'mips': 'mips',
68 'mipsel': 'mipsle',
69 'powerpc64': 'ppc64',
70 'powerpc64le': 'ppc64le',
71 'riscv64': 'riscv64',
72 }
73
74 @classmethod 59 @classmethod
75 def setUpClass(self): 60 def setUpClass(self):
76 # Copy test.go file to SDK directory (same as GCC test uses files_dir) 61 # Copy test.go file to SDK directory (same as GCC test uses files_dir)
@@ -94,12 +79,8 @@ class GoHostCompileTest(OESDKTestCase):
94 sdksys = self.td.get("SDK_SYS") 79 sdksys = self.td.get("SDK_SYS")
95 arch = sdksys.split('-')[0] 80 arch = sdksys.split('-')[0]
96 81
97 # Handle ARM variants
98 if arch.startswith('arm'):
99 return 'arm'
100
101 # Use mapping for other architectures 82 # Use mapping for other architectures
102 return self.ARCH_MAP.get(arch, arch) 83 return map_arch(arch)
103 84
104 def test_go_cross_compile(self): 85 def test_go_cross_compile(self):
105 """Test Go cross-compilation for target""" 86 """Test Go cross-compilation for target"""
@@ -117,12 +98,10 @@ class GoHostCompileTest(OESDKTestCase):
117 # Clean up files with dynamic architecture names 98 # Clean up files with dynamic architecture names
118 files = [os.path.join(self.tc.sdk_dir, f) \ 99 files = [os.path.join(self.tc.sdk_dir, f) \
119 for f in ['test.go', 'go.mod', 'go.sum']] 100 for f in ['test.go', 'go.mod', 'go.sum']]
120 # Add architecture-specific files using the same mapping 101 # Add common architecture-specific files that might be created
121 for arch in self.ARCH_MAP.values(): 102 common_archs = ['arm64', 'arm', 'amd64', '386', 'mips', 'mipsle', 'ppc64', 'ppc64le', 'riscv64']
103 for arch in common_archs:
122 files.extend([os.path.join(self.tc.sdk_dir, f) \ 104 files.extend([os.path.join(self.tc.sdk_dir, f) \
123 for f in ['test-%s' % arch, 'hello-go-%s' % arch]]) 105 for f in ['test-%s' % arch, 'hello-go-%s' % arch]])
124 # Add 'arm' for ARM variants
125 files.extend([os.path.join(self.tc.sdk_dir, f) \
126 for f in ['test-arm', 'hello-go-arm']])
127 for f in files: 106 for f in files:
128 remove_safe(f) 107 remove_safe(f)