From b7ab2aeebddc927f8e4bc98093db57f2ba56844b Mon Sep 17 00:00:00 2001 From: Ryan Prichard Date: Fri, 17 Apr 2015 05:05:22 -0700 Subject: [PATCH 1/5] Fix the dependency for the pretty-rpass-full tests The current code attempts to define the PRETTY_DEPS$(1)_H_$(3)_pretty-rpass-full variable, which does not work, because $(1) and $(3) are not inside a function. Moreover, there is a test (run-pass-fulldeps/compiler-calls.rs) that uses rustc_driver, which is not an indirect dependency of librustc or libsyntax. Listing all the dependencies will be hard to maintain, but there's a better way to do this... As with the rpass-full and cfail-full tests, add dependencies using the $$(CSREQ$(1)_T_$(3)_H_$(3)) variable, which includes the complete set of host and target crates, built for a particular stage and host. We use T_$(3), not T_$(2), because we only build LLVM for host triples (not target triples), so we can only build rustc_llvm for host triples. The fulldeps tests that use plugins need host rustc crates, whereas fulldeps tests that link against rustc and run should be skipped for cross-compilation (such as Android). Fixes #22021 --- mk/tests.mk | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/mk/tests.mk b/mk/tests.mk index a540d2bace4c6..2d72583e07e33 100644 --- a/mk/tests.mk +++ b/mk/tests.mk @@ -753,13 +753,6 @@ PRETTY_DEPS_pretty-rpass-full = $(RPASS_FULL_TESTS) PRETTY_DEPS_pretty-rfail = $(RFAIL_TESTS) PRETTY_DEPS_pretty-bench = $(BENCH_TESTS) PRETTY_DEPS_pretty-pretty = $(PRETTY_TESTS) -# The stage- and host-specific dependencies are for e.g. macro_crate_test which pulls in -# external crates. -PRETTY_DEPS$(1)_H_$(3)_pretty-rpass = -PRETTY_DEPS$(1)_H_$(3)_pretty-rpass-full = $$(HLIB$(1)_H_$(3))/stamp.syntax $$(HLIB$(1)_H_$(3))/stamp.rustc -PRETTY_DEPS$(1)_H_$(3)_pretty-rfail = -PRETTY_DEPS$(1)_H_$(3)_pretty-bench = -PRETTY_DEPS$(1)_H_$(3)_pretty-pretty = PRETTY_DIRNAME_pretty-rpass = run-pass PRETTY_DIRNAME_pretty-rpass-valgrind = run-pass-valgrind PRETTY_DIRNAME_pretty-rpass-full = run-pass-fulldeps @@ -767,6 +760,15 @@ PRETTY_DIRNAME_pretty-rfail = run-fail PRETTY_DIRNAME_pretty-bench = bench PRETTY_DIRNAME_pretty-pretty = pretty +define DEF_PRETTY_FULLDEPS +PRETTY_DEPS$(1)_T_$(2)_H_$(3)_pretty-rpass-full = $$(CSREQ$(1)_T_$(3)_H_$(3)) +endef + +$(foreach host,$(CFG_HOST), \ + $(foreach target,$(CFG_TARGET), \ + $(foreach stage,$(STAGES), \ + $(eval $(call DEF_PRETTY_FULLDEPS,$(stage),$(target),$(host)))))) + define DEF_RUN_PRETTY_TEST PRETTY_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \ @@ -780,7 +782,7 @@ check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4 $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \ $$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \ $$(PRETTY_DEPS_$(4)) \ - $$(PRETTY_DEPS$(1)_H_$(3)_$(4)) + $$(PRETTY_DEPS$(1)_T_$(2)_H_$(3)_$(4)) @$$(call E, run pretty-rpass [$(2)]: $$<) $$(Q)touch $$@.start_time $$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \ From d57fc929496fa82bee3ad2deb539150f5f3f0931 Mon Sep 17 00:00:00 2001 From: Ryan Prichard Date: Fri, 17 Apr 2015 04:58:47 -0700 Subject: [PATCH 2/5] Fix run-make/simd-ffi to work with parallel make check. --- src/test/run-make/simd-ffi/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/run-make/simd-ffi/Makefile b/src/test/run-make/simd-ffi/Makefile index 68a6a5fbfe864..dc0fcec1980fd 100644 --- a/src/test/run-make/simd-ffi/Makefile +++ b/src/test/run-make/simd-ffi/Makefile @@ -27,7 +27,8 @@ define MK_TARGETS # on some platforms, but LLVM just prints a warning so that's fine for # now. $(1): simd.rs - $$(RUSTC) --target=$(1) --emit=llvm-ir,asm simd.rs -C target-feature='+neon,+sse2' + $$(RUSTC) --target=$(1) --emit=llvm-ir,asm simd.rs \ + -C target-feature='+neon,+sse2' -C extra-filename=-$(1) endef $(foreach targetxxx,$(TARGETS),$(eval $(call MK_TARGETS,$(targetxxx)))) From f7962d2dae4462a154c6d2f1b32c315f2a7ca4ab Mon Sep 17 00:00:00 2001 From: Ryan Prichard Date: Wed, 22 Apr 2015 15:20:57 -0700 Subject: [PATCH 3/5] Ignore cross-compilation in some fulldeps tests. These tests fail, in general, for cross-compilation, because they require the rustc crates to exist for the target, and they don't. We can't compile them for the target unless we also compile LLVM for the target (we don't). Android is a subset of cross-compilation. The other fulldeps tests, on the other hand, work fine for cross-compilation, and in fact, are verifying that rustc correctly searches for a host plugin crate, not a target plugin crate. --- src/test/compile-fail-fulldeps/macro-crate-rlib.rs | 1 - src/test/run-pass-fulldeps/compiler-calls.rs | 2 +- src/test/run-pass-fulldeps/create-dir-all-bare.rs | 2 +- src/test/run-pass-fulldeps/issue-15149.rs | 2 +- src/test/run-pass-fulldeps/issue-16992.rs | 2 +- src/test/run-pass-fulldeps/issue-18763-quote-token-tree.rs | 2 +- src/test/run-pass-fulldeps/qquote.rs | 1 + src/test/run-pass-fulldeps/quote-tokens.rs | 2 +- src/test/run-pass-fulldeps/quote-unused-sp-no-warning.rs | 2 +- src/test/run-pass-fulldeps/rename-directory.rs | 2 +- 10 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/test/compile-fail-fulldeps/macro-crate-rlib.rs b/src/test/compile-fail-fulldeps/macro-crate-rlib.rs index 7a362994b8db6..396b1c1de3aa0 100644 --- a/src/test/compile-fail-fulldeps/macro-crate-rlib.rs +++ b/src/test/compile-fail-fulldeps/macro-crate-rlib.rs @@ -11,7 +11,6 @@ // aux-build:rlib_crate_test.rs // ignore-stage1 // ignore-tidy-linelength -// ignore-android // ignore-cross-compile gives a different error message #![feature(plugin)] diff --git a/src/test/run-pass-fulldeps/compiler-calls.rs b/src/test/run-pass-fulldeps/compiler-calls.rs index 4bacde0aadf3f..1cf36dab395fd 100644 --- a/src/test/run-pass-fulldeps/compiler-calls.rs +++ b/src/test/run-pass-fulldeps/compiler-calls.rs @@ -10,7 +10,7 @@ // Test that the CompilerCalls interface to the compiler works. -// ignore-android +// ignore-cross-compile #![feature(rustc_private, path)] #![feature(core)] diff --git a/src/test/run-pass-fulldeps/create-dir-all-bare.rs b/src/test/run-pass-fulldeps/create-dir-all-bare.rs index e4fb7c1990947..e22736d77856a 100644 --- a/src/test/run-pass-fulldeps/create-dir-all-bare.rs +++ b/src/test/run-pass-fulldeps/create-dir-all-bare.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-android +// ignore-cross-compile #![feature(rustc_private)] diff --git a/src/test/run-pass-fulldeps/issue-15149.rs b/src/test/run-pass-fulldeps/issue-15149.rs index 7e64bbdf703b7..ea7e959a73ce8 100644 --- a/src/test/run-pass-fulldeps/issue-15149.rs +++ b/src/test/run-pass-fulldeps/issue-15149.rs @@ -9,7 +9,7 @@ // except according to those terms. // no-prefer-dynamic -// ignore-android +// ignore-cross-compile #![feature(rustc_private)] diff --git a/src/test/run-pass-fulldeps/issue-16992.rs b/src/test/run-pass-fulldeps/issue-16992.rs index 40947b2e25652..a439e2bb25b8c 100644 --- a/src/test/run-pass-fulldeps/issue-16992.rs +++ b/src/test/run-pass-fulldeps/issue-16992.rs @@ -9,7 +9,7 @@ // except according to those terms. // ignore-pretty -// ignore-android +// ignore-cross-compile #![feature(quote, rustc_private)] diff --git a/src/test/run-pass-fulldeps/issue-18763-quote-token-tree.rs b/src/test/run-pass-fulldeps/issue-18763-quote-token-tree.rs index e1ef32b64d715..829fdb176bd31 100644 --- a/src/test/run-pass-fulldeps/issue-18763-quote-token-tree.rs +++ b/src/test/run-pass-fulldeps/issue-18763-quote-token-tree.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-android +// ignore-cross-compile // ignore-pretty: does not work well with `--test` #![feature(quote, rustc_private)] diff --git a/src/test/run-pass-fulldeps/qquote.rs b/src/test/run-pass-fulldeps/qquote.rs index 7e11b9d9f2789..710b3b07549f9 100644 --- a/src/test/run-pass-fulldeps/qquote.rs +++ b/src/test/run-pass-fulldeps/qquote.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-cross-compile // ignore-pretty // ignore-test diff --git a/src/test/run-pass-fulldeps/quote-tokens.rs b/src/test/run-pass-fulldeps/quote-tokens.rs index 99e0333ee2985..64061eb093247 100644 --- a/src/test/run-pass-fulldeps/quote-tokens.rs +++ b/src/test/run-pass-fulldeps/quote-tokens.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-android +// ignore-cross-compile // ignore-pretty: does not work well with `--test` #![feature(quote, rustc_private)] diff --git a/src/test/run-pass-fulldeps/quote-unused-sp-no-warning.rs b/src/test/run-pass-fulldeps/quote-unused-sp-no-warning.rs index 928368fabdf36..e9de95b95e5fd 100644 --- a/src/test/run-pass-fulldeps/quote-unused-sp-no-warning.rs +++ b/src/test/run-pass-fulldeps/quote-unused-sp-no-warning.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-android +// ignore-cross-compile // ignore-pretty: does not work well with `--test` #![feature(quote, rustc_private)] diff --git a/src/test/run-pass-fulldeps/rename-directory.rs b/src/test/run-pass-fulldeps/rename-directory.rs index a0644e513a6e9..2bec41f3ee040 100644 --- a/src/test/run-pass-fulldeps/rename-directory.rs +++ b/src/test/run-pass-fulldeps/rename-directory.rs @@ -11,7 +11,7 @@ // This test can't be a unit test in std, // because it needs TempDir, which is in extra -// ignore-android +// ignore-cross-compile #![feature(rustc_private, path_ext)] From 89b6f397c58db87bfcc976cafb75324b2278c171 Mon Sep 17 00:00:00 2001 From: Ryan Prichard Date: Wed, 22 Apr 2015 15:22:36 -0700 Subject: [PATCH 4/5] Replace ignore-android with ignore-cross-compile in rustdoc tests The problem is that rustdoc searches for external crates using the host triple, not the target triple. It's actually unclear to me whether this is correct behavior or not, but it is necessary to get cross-compiled tests working. --- src/test/rustdoc/default-impl.rs | 2 +- src/test/rustdoc/extern-default-method.rs | 2 +- src/test/rustdoc/extern-method.rs | 2 +- src/test/rustdoc/ffi.rs | 2 +- src/test/rustdoc/inline-default-methods.rs | 2 +- src/test/rustdoc/issue-13698.rs | 2 +- src/test/rustdoc/issue-15318-2.rs | 2 +- src/test/rustdoc/issue-15318.rs | 2 +- src/test/rustdoc/issue-17476.rs | 2 +- src/test/rustdoc/issue-19190-3.rs | 2 +- src/test/rustdoc/issue-20646.rs | 2 +- src/test/rustdoc/issue-20727-2.rs | 2 +- src/test/rustdoc/issue-20727-3.rs | 2 +- src/test/rustdoc/issue-20727-4.rs | 2 +- src/test/rustdoc/issue-20727.rs | 2 +- src/test/rustdoc/issue-21092.rs | 2 +- src/test/rustdoc/issue-21801.rs | 2 +- src/test/rustdoc/issue-22025.rs | 2 +- src/test/rustdoc/issue-23207.rs | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/test/rustdoc/default-impl.rs b/src/test/rustdoc/default-impl.rs index 92b243140021d..6153a3966342c 100644 --- a/src/test/rustdoc/default-impl.rs +++ b/src/test/rustdoc/default-impl.rs @@ -9,7 +9,7 @@ // except according to those terms. // aux-build:rustdoc-default-impl.rs -// ignore-android +// ignore-cross-compile extern crate rustdoc_default_impl as foo; diff --git a/src/test/rustdoc/extern-default-method.rs b/src/test/rustdoc/extern-default-method.rs index 9178c1bcb9d76..10d2884ebae07 100644 --- a/src/test/rustdoc/extern-default-method.rs +++ b/src/test/rustdoc/extern-default-method.rs @@ -9,7 +9,7 @@ // except according to those terms. // aux-build:rustdoc-extern-default-method.rs -// ignore-android +// ignore-cross-compile extern crate rustdoc_extern_default_method as ext; diff --git a/src/test/rustdoc/extern-method.rs b/src/test/rustdoc/extern-method.rs index 5e30e6c0c1c58..c422871867d5d 100644 --- a/src/test/rustdoc/extern-method.rs +++ b/src/test/rustdoc/extern-method.rs @@ -9,7 +9,7 @@ // except according to those terms. // aux-build:rustdoc-extern-method.rs -// ignore-android +// ignore-cross-compile #![feature(unboxed_closures)] diff --git a/src/test/rustdoc/ffi.rs b/src/test/rustdoc/ffi.rs index 717c64b3aa546..3997dcd81e153 100644 --- a/src/test/rustdoc/ffi.rs +++ b/src/test/rustdoc/ffi.rs @@ -9,7 +9,7 @@ // except according to those terms. // aux-build:rustdoc-ffi.rs -// ignore-android +// ignore-cross-compile extern crate rustdoc_ffi as lib; diff --git a/src/test/rustdoc/inline-default-methods.rs b/src/test/rustdoc/inline-default-methods.rs index a613736ab4c50..055af0160f54c 100644 --- a/src/test/rustdoc/inline-default-methods.rs +++ b/src/test/rustdoc/inline-default-methods.rs @@ -9,7 +9,7 @@ // except according to those terms. // aux-build:inline-default-methods.rs -// ignore-android +// ignore-cross-compile extern crate inline_default_methods; diff --git a/src/test/rustdoc/issue-13698.rs b/src/test/rustdoc/issue-13698.rs index 5c31c29772464..cf9b30a0fe987 100644 --- a/src/test/rustdoc/issue-13698.rs +++ b/src/test/rustdoc/issue-13698.rs @@ -9,7 +9,7 @@ // except according to those terms. // aux-build:issue-13698.rs -// ignore-android +// ignore-cross-compile extern crate issue_13698; diff --git a/src/test/rustdoc/issue-15318-2.rs b/src/test/rustdoc/issue-15318-2.rs index 32898d652f821..7999af46eebb6 100644 --- a/src/test/rustdoc/issue-15318-2.rs +++ b/src/test/rustdoc/issue-15318-2.rs @@ -9,7 +9,7 @@ // except according to those terms. // aux-build:issue-15318.rs -// ignore-android +// ignore-cross-compile extern crate issue_15318; diff --git a/src/test/rustdoc/issue-15318.rs b/src/test/rustdoc/issue-15318.rs index 3bcc8f45b0e88..fd46b6e990962 100644 --- a/src/test/rustdoc/issue-15318.rs +++ b/src/test/rustdoc/issue-15318.rs @@ -9,7 +9,7 @@ // except according to those terms. // aux-build:issue-15318.rs -// ignore-android +// ignore-cross-compile #![feature(no_std)] #![no_std] diff --git a/src/test/rustdoc/issue-17476.rs b/src/test/rustdoc/issue-17476.rs index 8d31a1c288eb8..dcd3f2a2ba5b8 100644 --- a/src/test/rustdoc/issue-17476.rs +++ b/src/test/rustdoc/issue-17476.rs @@ -9,7 +9,7 @@ // except according to those terms. // aux-build:issue-17476.rs -// ignore-android +// ignore-cross-compile extern crate issue_17476; diff --git a/src/test/rustdoc/issue-19190-3.rs b/src/test/rustdoc/issue-19190-3.rs index c315ea26d2642..eec5c02537737 100644 --- a/src/test/rustdoc/issue-19190-3.rs +++ b/src/test/rustdoc/issue-19190-3.rs @@ -9,7 +9,7 @@ // except according to those terms. // aux-build:issue-19190-3.rs -// ignore-android +// ignore-cross-compile extern crate issue_19190_3; diff --git a/src/test/rustdoc/issue-20646.rs b/src/test/rustdoc/issue-20646.rs index 77abe35948c3d..87c40d1157974 100644 --- a/src/test/rustdoc/issue-20646.rs +++ b/src/test/rustdoc/issue-20646.rs @@ -9,7 +9,7 @@ // except according to those terms. // aux-build:issue-20646.rs -// ignore-android +// ignore-cross-compile #![feature(associated_types)] diff --git a/src/test/rustdoc/issue-20727-2.rs b/src/test/rustdoc/issue-20727-2.rs index 03181bebdb05a..1f29a9c97972c 100644 --- a/src/test/rustdoc/issue-20727-2.rs +++ b/src/test/rustdoc/issue-20727-2.rs @@ -9,7 +9,7 @@ // except according to those terms. // aux-build:issue-20727.rs -// ignore-android +// ignore-cross-compile extern crate issue_20727; diff --git a/src/test/rustdoc/issue-20727-3.rs b/src/test/rustdoc/issue-20727-3.rs index 9d05ce99c4d30..e4a9dd7e7f142 100644 --- a/src/test/rustdoc/issue-20727-3.rs +++ b/src/test/rustdoc/issue-20727-3.rs @@ -9,7 +9,7 @@ // except according to those terms. // aux-build:issue-20727.rs -// ignore-android +// ignore-cross-compile extern crate issue_20727; diff --git a/src/test/rustdoc/issue-20727-4.rs b/src/test/rustdoc/issue-20727-4.rs index 39db387f09000..9ebd1c448eeb0 100644 --- a/src/test/rustdoc/issue-20727-4.rs +++ b/src/test/rustdoc/issue-20727-4.rs @@ -9,7 +9,7 @@ // except according to those terms. // aux-build:issue-20727.rs -// ignore-android +// ignore-cross-compile extern crate issue_20727; diff --git a/src/test/rustdoc/issue-20727.rs b/src/test/rustdoc/issue-20727.rs index 3205f5bfa3371..e38f06c4b317a 100644 --- a/src/test/rustdoc/issue-20727.rs +++ b/src/test/rustdoc/issue-20727.rs @@ -9,7 +9,7 @@ // except according to those terms. // aux-build:issue-20727.rs -// ignore-android +// ignore-cross-compile extern crate issue_20727; diff --git a/src/test/rustdoc/issue-21092.rs b/src/test/rustdoc/issue-21092.rs index 38983aee93397..745c6e2c6648d 100644 --- a/src/test/rustdoc/issue-21092.rs +++ b/src/test/rustdoc/issue-21092.rs @@ -9,7 +9,7 @@ // except according to those terms. // aux-build:issue-21092.rs -// ignore-android +// ignore-cross-compile extern crate issue_21092; diff --git a/src/test/rustdoc/issue-21801.rs b/src/test/rustdoc/issue-21801.rs index a4392b84e5b12..4e2c77826b6c0 100644 --- a/src/test/rustdoc/issue-21801.rs +++ b/src/test/rustdoc/issue-21801.rs @@ -9,7 +9,7 @@ // except according to those terms. // aux-build:issue-21801.rs -// ignore-android +// ignore-cross-compile extern crate issue_21801; diff --git a/src/test/rustdoc/issue-22025.rs b/src/test/rustdoc/issue-22025.rs index d2eb4fb6ad845..c0e4e673f94d8 100644 --- a/src/test/rustdoc/issue-22025.rs +++ b/src/test/rustdoc/issue-22025.rs @@ -9,7 +9,7 @@ // except according to those terms. // aux-build:issue-22025.rs -// ignore-android +// ignore-cross-compile extern crate issue_22025; diff --git a/src/test/rustdoc/issue-23207.rs b/src/test/rustdoc/issue-23207.rs index 722046723be7c..4931d158ac3e4 100644 --- a/src/test/rustdoc/issue-23207.rs +++ b/src/test/rustdoc/issue-23207.rs @@ -10,7 +10,7 @@ // aux-build:issue-23207-1.rs // aux-build:issue-23207-2.rs -// ignore-android +// ignore-cross-compile extern crate issue_23207_2; From 38d26d811a44ba93637c84ce77a58af88c47f0ac Mon Sep 17 00:00:00 2001 From: Ryan Prichard Date: Wed, 22 Apr 2015 19:01:42 -0700 Subject: [PATCH 5/5] Include the mode in compiletest's aux-build directory. The run-pass and pretty run-pass tests could run concurrently, and if they do, they need to keep their output segregated. This change might be overkill. We need the suffix for the `pretty` mode, but we might not need it otherwise. The `debuginfo-lldb` and `debuginfo-gdb` modes look like they could also need it, but the current `tests.mk` file happens not to enable both lldb and gdb at the same time, for incidental reasons. --- src/compiletest/runtest.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index 8ae3639318291..f528a0505e4b7 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -1452,7 +1452,7 @@ fn make_out_name(config: &Config, testfile: &Path, extension: &str) -> PathBuf { fn aux_output_dir_name(config: &Config, testfile: &Path) -> PathBuf { let f = output_base_name(config, testfile); let mut fname = f.file_name().unwrap().to_os_string(); - fname.push("libaux"); + fname.push(&format!(".{}.libaux", config.mode)); f.with_file_name(&fname) }