[PATCH] tests: add missing cross disabled checks
authorFabian Grünbichler <debian@fabian.gruenbichler.email>
Sat, 19 Nov 2022 09:24:08 +0000 (10:24 +0100)
committerFabian Grünbichler <debian@fabian.gruenbichler.email>
Tue, 8 Oct 2024 12:34:41 +0000 (14:34 +0200)
cross_conmpile::alternate states it should only be used in test cases
after checking cross_compile::disabled(), which is missing here. these
tests fail despite setting CFG_DISABLE_CROSS_TESTS on i386, since both
the host and the alternate cross target would be i686 in that case.

Signed-off-by: Fabian Grünbichler <debian@fabian.gruenbichler.email>
Gbp-Pq: Topic cargo
Gbp-Pq: Name c-0003-tests-add-missing-cross-disabled-checks.patch

src/tools/cargo/tests/testsuite/build_script.rs

index 6dce3d130c7c2f4bc4992c3f22e3a240ea0fc704..518d4d230e7e58b79d5408bca5e02b1cf9bab0ee 100644 (file)
@@ -737,6 +737,9 @@ fn custom_build_linker_bad_host_with_arch() {
 #[cargo_test]
 fn custom_build_env_var_rustc_linker_cross_arch_host() {
     let target = rustc_host();
+    if cross_compile::disabled() {
+        return;
+    }
     let cross_target = cross_compile::alternate();
     let p = project()
         .file(
@@ -775,6 +778,9 @@ fn custom_build_env_var_rustc_linker_cross_arch_host() {
 #[cargo_test]
 fn custom_build_linker_bad_cross_arch_host() {
     let target = rustc_host();
+    if cross_compile::disabled() {
+        return;
+    }
     let cross_target = cross_compile::alternate();
     let p = project()
         .file(