diff options
Diffstat (limited to 'meta/lib')
| -rw-r--r-- | meta/lib/oeqa/sdk/cases/go.py | 31 |
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 | |||
| 12 | from oeqa.sdk.case import OESDKTestCase | 12 | from oeqa.sdk.case import OESDKTestCase |
| 13 | 13 | ||
| 14 | from oeqa.utils.subprocesstweak import errors_have_output | 14 | from oeqa.utils.subprocesstweak import errors_have_output |
| 15 | from oe.go import map_arch | ||
| 15 | errors_have_output() | 16 | errors_have_output() |
| 16 | 17 | ||
| 17 | class GoCompileTest(OESDKTestCase): | 18 | class GoCompileTest(OESDKTestCase): |
| @@ -55,22 +56,6 @@ class GoCompileTest(OESDKTestCase): | |||
| 55 | class GoHostCompileTest(OESDKTestCase): | 56 | class 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) |
