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 a540d2bace4..2d72583e07e 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 68a6a5fbfe8..dc0fcec1980 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 7a362994b8d..396b1c1de3a 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 4bacde0aadf..1cf36dab395 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 e4fb7c19909..e22736d7785 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 7e64bbdf703..ea7e959a73c 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 40947b2e256..a439e2bb25b 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 e1ef32b64d7..829fdb176bd 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 7e11b9d9f27..710b3b07549 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 99e0333ee29..64061eb0932 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 928368fabdf..e9de95b95e5 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 a0644e513a6..2bec41f3ee0 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 92b24314002..6153a396634 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 9178c1bcb9d..10d2884ebae 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 5e30e6c0c1c..c422871867d 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 717c64b3aa5..3997dcd81e1 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 a613736ab4c..055af0160f5 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 5c31c297724..cf9b30a0fe9 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 32898d652f8..7999af46eeb 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 3bcc8f45b0e..fd46b6e9909 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 8d31a1c288e..dcd3f2a2ba5 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 c315ea26d26..eec5c025377 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 77abe35948c..87c40d11579 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 03181bebdb0..1f29a9c9797 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 9d05ce99c4d..e4a9dd7e7f1 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 39db387f090..9ebd1c448ee 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 3205f5bfa33..e38f06c4b31 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 38983aee933..745c6e2c664 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 a4392b84e5b..4e2c77826b6 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 d2eb4fb6ad8..c0e4e673f94 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 722046723be..4931d158ac3 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 8ae36393182..f528a0505e4 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) }