diff options
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/rust.py')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/rust.py | 138 |
1 files changed, 21 insertions, 117 deletions
diff --git a/meta/lib/oeqa/selftest/cases/rust.py b/meta/lib/oeqa/selftest/cases/rust.py index ad14189c6d..d99a58d6b9 100644 --- a/meta/lib/oeqa/selftest/cases/rust.py +++ b/meta/lib/oeqa/selftest/cases/rust.py | |||
@@ -1,11 +1,11 @@ | |||
1 | # SPDX-License-Identifier: MIT | 1 | # SPDX-License-Identifier: MIT |
2 | import os | ||
3 | import subprocess | 2 | import subprocess |
4 | import time | 3 | import time |
5 | from oeqa.core.decorator import OETestTag | 4 | from oeqa.core.decorator import OETestTag |
5 | from oeqa.core.decorator.data import skipIfArch | ||
6 | from oeqa.core.case import OEPTestResultTestCase | 6 | from oeqa.core.case import OEPTestResultTestCase |
7 | from oeqa.selftest.case import OESelftestTestCase | 7 | from oeqa.selftest.case import OESelftestTestCase |
8 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu, Command | 8 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu |
9 | from oeqa.utils.sshcontrol import SSHControl | 9 | from oeqa.utils.sshcontrol import SSHControl |
10 | 10 | ||
11 | def parse_results(filename): | 11 | def parse_results(filename): |
@@ -38,15 +38,9 @@ def parse_results(filename): | |||
38 | @OETestTag("toolchain-user") | 38 | @OETestTag("toolchain-user") |
39 | @OETestTag("runqemu") | 39 | @OETestTag("runqemu") |
40 | class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase): | 40 | class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase): |
41 | def test_rust(self, *args, **kwargs): | ||
42 | # Disable Rust Oe-selftest | ||
43 | #self.skipTest("The Rust Oe-selftest is disabled.") | ||
44 | |||
45 | # Skip mips32 target since it is unstable with rust tests | ||
46 | machine = get_bb_var('MACHINE') | ||
47 | if machine == "qemumips": | ||
48 | self.skipTest("The mips32 target is skipped for Rust Oe-selftest.") | ||
49 | 41 | ||
42 | @skipIfArch(['mips', 'mips64']) | ||
43 | def test_rust(self, *args, **kwargs): | ||
50 | # build remote-test-server before image build | 44 | # build remote-test-server before image build |
51 | recipe = "rust" | 45 | recipe = "rust" |
52 | start_time = time.time() | 46 | start_time = time.time() |
@@ -66,132 +60,43 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase): | |||
66 | # bless: First runs rustfmt to format the codebase, | 60 | # bless: First runs rustfmt to format the codebase, |
67 | # then runs tidy checks. | 61 | # then runs tidy checks. |
68 | exclude_list = [ | 62 | exclude_list = [ |
69 | 'compiler/rustc', | 63 | 'src/bootstrap', |
70 | 'compiler/rustc_interface/src/tests.rs', | ||
71 | 'library/panic_abort', | ||
72 | 'library/panic_unwind', | ||
73 | 'library/test/src/stats/tests.rs', | ||
74 | 'src/bootstrap/builder/tests.rs', | ||
75 | 'src/doc/rustc', | 64 | 'src/doc/rustc', |
76 | 'src/doc/rustdoc', | 65 | 'src/doc/rustdoc', |
77 | 'src/doc/unstable-book', | 66 | 'src/doc/unstable-book', |
67 | 'src/etc/test-float-parse', | ||
78 | 'src/librustdoc', | 68 | 'src/librustdoc', |
79 | 'src/rustdoc-json-types', | 69 | 'src/rustdoc-json-types', |
80 | 'src/tools/compiletest/src/common.rs', | 70 | 'src/tools/jsondoclint', |
81 | 'src/tools/lint-docs', | 71 | 'src/tools/lint-docs', |
72 | 'src/tools/replace-version-placeholder', | ||
82 | 'src/tools/rust-analyzer', | 73 | 'src/tools/rust-analyzer', |
83 | 'src/tools/rustdoc-themes', | 74 | 'src/tools/rustdoc-themes', |
84 | 'src/tools/tidy', | 75 | 'src/tools/rust-installer', |
76 | 'src/tools/suggest-tests', | ||
85 | 'tests/assembly/asm/aarch64-outline-atomics.rs', | 77 | 'tests/assembly/asm/aarch64-outline-atomics.rs', |
86 | 'tests/codegen/abi-main-signature-32bit-c-int.rs', | 78 | 'tests/codegen/issues/issue-122805.rs', |
87 | 'tests/codegen/abi-repr-ext.rs', | ||
88 | 'tests/codegen/abi-x86-interrupt.rs', | ||
89 | 'tests/codegen/branch-protection.rs', | ||
90 | 'tests/codegen/catch-unwind.rs', | ||
91 | 'tests/codegen/cf-protection.rs', | ||
92 | 'tests/codegen/enum-bounds-check-derived-idx.rs', | ||
93 | 'tests/codegen/force-unwind-tables.rs', | ||
94 | 'tests/codegen/intrinsic-no-unnamed-attr.rs', | ||
95 | 'tests/codegen/issues/issue-103840.rs', | ||
96 | 'tests/codegen/issues/issue-47278.rs', | ||
97 | 'tests/codegen/issues/issue-73827-bounds-check-index-in-subexpr.rs', | ||
98 | 'tests/codegen/lifetime_start_end.rs', | ||
99 | 'tests/codegen/local-generics-in-exe-internalized.rs', | ||
100 | 'tests/codegen/match-unoptimized.rs', | ||
101 | 'tests/codegen/noalias-rwlockreadguard.rs', | ||
102 | 'tests/codegen/non-terminate/nonempty-infinite-loop.rs', | ||
103 | 'tests/codegen/noreturn-uninhabited.rs', | ||
104 | 'tests/codegen/repr-transparent-aggregates-3.rs', | ||
105 | 'tests/codegen/riscv-abi/call-llvm-intrinsics.rs', | ||
106 | 'tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs', | ||
107 | 'tests/codegen/riscv-abi/riscv64-lp64d-abi.rs', | ||
108 | 'tests/codegen/sse42-implies-crc32.rs', | ||
109 | 'tests/codegen/thread-local.rs', | 79 | 'tests/codegen/thread-local.rs', |
110 | 'tests/codegen/uninit-consts.rs', | 80 | 'tests/mir-opt/', |
111 | 'tests/pretty/raw-str-nonexpr.rs', | ||
112 | 'tests/run-make', | 81 | 'tests/run-make', |
113 | 'tests/run-make-fulldeps', | 82 | 'tests/run-make-fulldeps', |
114 | 'tests/rustdoc', | 83 | 'tests/rustdoc', |
115 | 'tests/rustdoc-json', | 84 | 'tests/rustdoc-json', |
116 | 'tests/rustdoc-js-std', | 85 | 'tests/rustdoc-js-std', |
117 | 'tests/rustdoc-ui/cfg-test.rs', | ||
118 | 'tests/rustdoc-ui/check-cfg-test.rs', | ||
119 | 'tests/rustdoc-ui/display-output.rs', | ||
120 | 'tests/rustdoc-ui/doc-comment-multi-line-attr.rs', | ||
121 | 'tests/rustdoc-ui/doc-comment-multi-line-cfg-attr.rs', | ||
122 | 'tests/rustdoc-ui/doc-test-doctest-feature.rs', | ||
123 | 'tests/rustdoc-ui/doctest-multiline-crate-attribute.rs', | ||
124 | 'tests/rustdoc-ui/doctest-output.rs', | ||
125 | 'tests/rustdoc-ui/doc-test-rustdoc-feature.rs', | ||
126 | 'tests/rustdoc-ui/failed-doctest-compile-fail.rs', | ||
127 | 'tests/rustdoc-ui/issue-80992.rs', | ||
128 | 'tests/rustdoc-ui/issue-91134.rs', | ||
129 | 'tests/rustdoc-ui/nocapture-fail.rs', | ||
130 | 'tests/rustdoc-ui/nocapture.rs', | ||
131 | 'tests/rustdoc-ui/no-run-flag.rs', | ||
132 | 'tests/rustdoc-ui/run-directory.rs', | ||
133 | 'tests/rustdoc-ui/test-no_std.rs', | ||
134 | 'tests/rustdoc-ui/test-type.rs', | ||
135 | 'tests/rustdoc/unit-return.rs', | ||
136 | 'tests/ui/abi/stack-probes-lto.rs', | 86 | 'tests/ui/abi/stack-probes-lto.rs', |
137 | 'tests/ui/abi/stack-probes.rs', | 87 | 'tests/ui/abi/stack-probes.rs', |
138 | 'tests/ui/array-slice-vec/subslice-patterns-const-eval-match.rs', | 88 | 'tests/ui/codegen/mismatched-data-layouts.rs', |
139 | 'tests/ui/asm/x86_64/sym.rs', | 89 | 'tests/codegen/rust-abi-arch-specific-adjustment.rs', |
140 | 'tests/ui/associated-type-bounds/fn-apit.rs', | ||
141 | 'tests/ui/associated-type-bounds/fn-dyn-apit.rs', | ||
142 | 'tests/ui/associated-type-bounds/fn-wrap-apit.rs', | ||
143 | 'tests/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs', | 90 | 'tests/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs', |
144 | 'tests/ui/drop/dynamic-drop.rs', | 91 | 'tests/ui/feature-gates/version_check.rs', |
145 | 'tests/ui/empty_global_asm.rs', | ||
146 | 'tests/ui/functions-closures/fn-help-with-err.rs', | ||
147 | 'tests/ui/linkage-attr/issue-10755.rs', | ||
148 | 'tests/ui/macros/restricted-shadowing-legacy.rs', | ||
149 | 'tests/ui/process/nofile-limit.rs', | ||
150 | 'tests/ui/process/process-panic-after-fork.rs', | ||
151 | 'tests/ui/process/process-sigpipe.rs', | ||
152 | 'tests/ui/simd/target-feature-mixup.rs', | ||
153 | 'tests/ui/structs-enums/multiple-reprs.rs', | ||
154 | 'src/tools/jsondoclint', | ||
155 | 'src/tools/replace-version-placeholder', | ||
156 | 'tests/codegen/abi-efiapi.rs', | ||
157 | 'tests/codegen/abi-sysv64.rs', | ||
158 | 'tests/codegen/align-byval.rs', | ||
159 | 'tests/codegen/align-fn.rs', | ||
160 | 'tests/codegen/asm-powerpc-clobbers.rs', | ||
161 | 'tests/codegen/async-fn-debug-awaitee-field.rs', | ||
162 | 'tests/codegen/binary-search-index-no-bound-check.rs', | ||
163 | 'tests/codegen/call-metadata.rs', | ||
164 | 'tests/codegen/debug-column.rs', | ||
165 | 'tests/codegen/debug-limited.rs', | ||
166 | 'tests/codegen/debuginfo-generic-closure-env-names.rs', | ||
167 | 'tests/codegen/drop.rs', | ||
168 | 'tests/codegen/dst-vtable-align-nonzero.rs', | ||
169 | 'tests/codegen/enable-lto-unit-splitting.rs', | ||
170 | 'tests/codegen/enum/enum-u128.rs', | ||
171 | 'tests/codegen/fn-impl-trait-self.rs', | ||
172 | 'tests/codegen/inherit_overflow.rs', | ||
173 | 'tests/codegen/inline-function-args-debug-info.rs', | ||
174 | 'tests/codegen/intrinsics/mask.rs', | ||
175 | 'tests/codegen/intrinsics/transmute-niched.rs', | ||
176 | 'tests/codegen/issues/issue-73258.rs', | ||
177 | 'tests/codegen/issues/issue-75546.rs', | ||
178 | 'tests/codegen/issues/issue-77812.rs', | ||
179 | 'tests/codegen/issues/issue-98156-const-arg-temp-lifetime.rs', | ||
180 | 'tests/codegen/llvm-ident.rs', | ||
181 | 'tests/codegen/mainsubprogram.rs', | ||
182 | 'tests/codegen/move-operands.rs', | ||
183 | 'tests/codegen/repr/transparent-mips64.rs', | ||
184 | 'tests/mir-opt/', | ||
185 | 'tests/rustdoc-json', | ||
186 | 'tests/rustdoc-ui/doc-test-rustdoc-feature.rs', | ||
187 | 'tests/rustdoc-ui/no-run-flag.rs', | ||
188 | 'tests/ui-fulldeps/', | 92 | 'tests/ui-fulldeps/', |
189 | 'tests/ui/numbers-arithmetic/u128.rs' | 93 | 'tests/ui/process/nofile-limit.rs', |
94 | 'tidyselftest' | ||
190 | ] | 95 | ] |
191 | 96 | ||
192 | exclude_fail_tests = " ".join([" --exclude " + item for item in exclude_list]) | 97 | exclude_fail_tests = " ".join([" --exclude " + item for item in exclude_list]) |
193 | # Add exclude_fail_tests with other test arguments | 98 | # Add exclude_fail_tests with other test arguments |
194 | testargs = exclude_fail_tests + " --doc --no-fail-fast --bless" | 99 | testargs = exclude_fail_tests + " --no-fail-fast --bless" |
195 | 100 | ||
196 | # wrap the execution with a qemu instance. | 101 | # wrap the execution with a qemu instance. |
197 | # Tests are run with 512 tasks in parallel to execute all tests very quickly | 102 | # Tests are run with 512 tasks in parallel to execute all tests very quickly |
@@ -199,7 +104,7 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase): | |||
199 | # Copy remote-test-server to image through scp | 104 | # Copy remote-test-server to image through scp |
200 | host_sys = get_bb_var("RUST_BUILD_SYS", "rust") | 105 | host_sys = get_bb_var("RUST_BUILD_SYS", "rust") |
201 | ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, user="root") | 106 | ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, user="root") |
202 | ssh.copy_to(builddir + "/build/" + host_sys + "/stage1-tools-bin/remote-test-server","~/") | 107 | ssh.copy_to(builddir + "/build/" + host_sys + "/stage2-tools-bin/remote-test-server","~/") |
203 | # Execute remote-test-server on image through background ssh | 108 | # Execute remote-test-server on image through background ssh |
204 | command = '~/remote-test-server --bind 0.0.0.0:12345 -v' | 109 | command = '~/remote-test-server --bind 0.0.0.0:12345 -v' |
205 | sshrun=subprocess.Popen(("ssh", '-o', 'UserKnownHostsFile=/dev/null', '-o', 'StrictHostKeyChecking=no', '-f', "root@%s" % qemu.ip, command), shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | 110 | sshrun=subprocess.Popen(("ssh", '-o', 'UserKnownHostsFile=/dev/null', '-o', 'StrictHostKeyChecking=no', '-f', "root@%s" % qemu.ip, command), shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
@@ -210,9 +115,8 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase): | |||
210 | tmpdir = get_bb_var("TMPDIR", "rust") | 115 | tmpdir = get_bb_var("TMPDIR", "rust") |
211 | 116 | ||
212 | # Set path for target-poky-linux-gcc, RUST_TARGET_PATH and hosttools. | 117 | # Set path for target-poky-linux-gcc, RUST_TARGET_PATH and hosttools. |
213 | cmd = " export PATH=%s/recipe-sysroot-native/usr/bin:$PATH;" % rustlibpath | 118 | cmd = "export TARGET_VENDOR=\"-poky\";" |
214 | cmd = cmd + " export TARGET_VENDOR=\"-poky\";" | 119 | cmd = cmd + " export PATH=%s/recipe-sysroot-native/usr/bin/python3-native:%s/recipe-sysroot-native/usr/bin:%s/recipe-sysroot-native/usr/bin/%s:%s/hosttools:$PATH;" % (rustlibpath, rustlibpath, rustlibpath, tcpath, tmpdir) |
215 | cmd = cmd + " export PATH=%s/recipe-sysroot-native/usr/bin/%s:%s/hosttools:$PATH;" % (rustlibpath, tcpath, tmpdir) | ||
216 | cmd = cmd + " export RUST_TARGET_PATH=%s/rust-targets;" % rustlibpath | 120 | cmd = cmd + " export RUST_TARGET_PATH=%s/rust-targets;" % rustlibpath |
217 | # Trigger testing. | 121 | # Trigger testing. |
218 | cmd = cmd + " export TEST_DEVICE_ADDR=\"%s:12345\";" % qemu.ip | 122 | cmd = cmd + " export TEST_DEVICE_ADDR=\"%s:12345\";" % qemu.ip |