about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-04-06 13:49:30 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-04-07 17:54:33 -0700
commitd3647fe81543f0a04a0d6aee15f4bb8c08774295 (patch)
tree1d1b9e07a488f5e87c309510fdddbc0f02b90276
parent10359de4051d56feeacd455946b93ec48e6511fc (diff)
downloadrust-d3647fe81543f0a04a0d6aee15f4bb8c08774295.tar.gz
rust-d3647fe81543f0a04a0d6aee15f4bb8c08774295.zip
test: Move all run-make rustdoc tests to test/rustdoc
-rw-r--r--mk/tests.mk2
-rw-r--r--src/test/auxiliary/rustdoc-default-impl.rs (renamed from src/test/run-make/rustdoc-default-impl/foo.rs)0
-rw-r--r--src/test/auxiliary/rustdoc-extern-default-method.rs (renamed from src/test/run-make/rustdoc-extern-default-method/ext.rs)0
-rw-r--r--src/test/auxiliary/rustdoc-extern-method.rs (renamed from src/test/run-make/rustdoc-extern-method/foo.rs)0
-rw-r--r--src/test/auxiliary/rustdoc-ffi.rs (renamed from src/test/run-make/rustdoc-ffi/lib.rs)0
-rw-r--r--src/test/run-make/rustdoc-assoc-types/Makefile5
-rw-r--r--src/test/run-make/rustdoc-default-impl/Makefile5
-rw-r--r--src/test/run-make/rustdoc-extern-default-method/Makefile6
-rw-r--r--src/test/run-make/rustdoc-extern-method/Makefile7
-rw-r--r--src/test/run-make/rustdoc-ffi/Makefile8
-rw-r--r--src/test/run-make/rustdoc-hidden-line/Makefile15
-rw-r--r--src/test/run-make/rustdoc-must-use/Makefile5
-rw-r--r--src/test/run-make/rustdoc-negative-impl/Makefile5
-rw-r--r--src/test/run-make/rustdoc-recursion/Makefile11
-rw-r--r--src/test/run-make/rustdoc-search-index/Makefile15
-rw-r--r--src/test/run-make/rustdoc-smoke/Makefile4
-rw-r--r--src/test/run-make/rustdoc-src-links/Makefile5
-rw-r--r--src/test/run-make/rustdoc-src-links/foo.rs43
-rw-r--r--src/test/run-make/rustdoc-src-links/qux/mod.rs39
-rw-r--r--src/test/run-make/rustdoc-viewpath-self/Makefile5
-rw-r--r--src/test/run-make/rustdoc-where/Makefile5
-rw-r--r--src/test/rustdoc/assoc-types.rs (renamed from src/test/run-make/rustdoc-assoc-types/lib.rs)2
-rw-r--r--src/test/rustdoc/default-impl.rs (renamed from src/test/run-make/rustdoc-default-impl/bar.rs)4
-rw-r--r--src/test/rustdoc/extern-default-method.rs (renamed from src/test/run-make/rustdoc-extern-default-method/lib.rs)6
-rw-r--r--src/test/rustdoc/extern-method.rs (renamed from src/test/run-make/rustdoc-extern-method/bar.rs)8
-rw-r--r--src/test/rustdoc/ffi.rs (renamed from src/test/run-make/rustdoc-ffi/user.rs)11
-rw-r--r--src/test/rustdoc/hidden-line.rs (renamed from src/test/run-make/rustdoc-hidden-line/foo.rs)4
-rw-r--r--src/test/rustdoc/must-use.rs (renamed from src/test/run-make/rustdoc-must-use/lib.rs)6
-rw-r--r--src/test/rustdoc/negative-impl.rs (renamed from src/test/run-make/rustdoc-negative-impl/foo.rs)8
-rw-r--r--src/test/rustdoc/recursion1.rs (renamed from src/test/run-make/rustdoc-recursion/foo.rs)0
-rw-r--r--src/test/rustdoc/recursion2.rs (renamed from src/test/run-make/rustdoc-recursion/foo2.rs)0
-rw-r--r--src/test/rustdoc/recursion3.rs (renamed from src/test/run-make/rustdoc-recursion/foo3.rs)0
-rw-r--r--src/test/rustdoc/search-index.rs (renamed from src/test/run-make/rustdoc-search-index/index.rs)0
-rw-r--r--src/test/rustdoc/smoke.rs (renamed from src/test/run-make/rustdoc-smoke/foo.rs)15
-rw-r--r--src/test/rustdoc/src-links.rs56
-rw-r--r--src/test/rustdoc/src-links/mod.rs29
-rw-r--r--src/test/rustdoc/viewpath-self.rs (renamed from src/test/run-make/rustdoc-viewpath-self/foo.rs)2
-rw-r--r--src/test/rustdoc/where.rs (renamed from src/test/run-make/rustdoc-where/foo.rs)2
38 files changed, 125 insertions, 213 deletions
diff --git a/mk/tests.mk b/mk/tests.mk
index 29ffe55291f..bf30b7e50cd 100644
--- a/mk/tests.mk
+++ b/mk/tests.mk
@@ -472,7 +472,7 @@ DEBUGINFO_GDB_RS := $(wildcard $(S)src/test/debuginfo/*.rs)
 DEBUGINFO_LLDB_RS := $(wildcard $(S)src/test/debuginfo/*.rs)
 CODEGEN_RS := $(wildcard $(S)src/test/codegen/*.rs)
 CODEGEN_CC := $(wildcard $(S)src/test/codegen/*.cc)
-RUSTDOCCK_RS := $(wildcard $(S)src/test/rustdocck/*.rs)
+RUSTDOCCK_RS := $(wildcard $(S)src/test/rustdoc/*.rs)
 
 # perf tests are the same as bench tests only they run under
 # a performance monitor.
diff --git a/src/test/run-make/rustdoc-default-impl/foo.rs b/src/test/auxiliary/rustdoc-default-impl.rs
index 8f11629be6c..8f11629be6c 100644
--- a/src/test/run-make/rustdoc-default-impl/foo.rs
+++ b/src/test/auxiliary/rustdoc-default-impl.rs
diff --git a/src/test/run-make/rustdoc-extern-default-method/ext.rs b/src/test/auxiliary/rustdoc-extern-default-method.rs
index 861562753f9..861562753f9 100644
--- a/src/test/run-make/rustdoc-extern-default-method/ext.rs
+++ b/src/test/auxiliary/rustdoc-extern-default-method.rs
diff --git a/src/test/run-make/rustdoc-extern-method/foo.rs b/src/test/auxiliary/rustdoc-extern-method.rs
index 96a7a8378b7..96a7a8378b7 100644
--- a/src/test/run-make/rustdoc-extern-method/foo.rs
+++ b/src/test/auxiliary/rustdoc-extern-method.rs
diff --git a/src/test/run-make/rustdoc-ffi/lib.rs b/src/test/auxiliary/rustdoc-ffi.rs
index e06dbe76dbb..e06dbe76dbb 100644
--- a/src/test/run-make/rustdoc-ffi/lib.rs
+++ b/src/test/auxiliary/rustdoc-ffi.rs
diff --git a/src/test/run-make/rustdoc-assoc-types/Makefile b/src/test/run-make/rustdoc-assoc-types/Makefile
deleted file mode 100644
index 74fca83f5f9..00000000000
--- a/src/test/run-make/rustdoc-assoc-types/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
--include ../tools.mk
-
-all: lib.rs
-	$(HOST_RPATH_ENV) $(RUSTDOC) -w html -o $(TMPDIR)/doc lib.rs
-	$(HTMLDOCCK) $(TMPDIR)/doc lib.rs
diff --git a/src/test/run-make/rustdoc-default-impl/Makefile b/src/test/run-make/rustdoc-default-impl/Makefile
deleted file mode 100644
index 338cf9d2053..00000000000
--- a/src/test/run-make/rustdoc-default-impl/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
--include ../tools.mk
-
-all: foo.rs bar.rs
-	$(RUSTC) foo.rs --crate-type lib
-	$(HOST_RPATH_ENV) $(RUSTDOC) -w html -o $(TMPDIR)/doc bar.rs -L $(TMPDIR)
diff --git a/src/test/run-make/rustdoc-extern-default-method/Makefile b/src/test/run-make/rustdoc-extern-default-method/Makefile
deleted file mode 100644
index ffc4a08f801..00000000000
--- a/src/test/run-make/rustdoc-extern-default-method/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
--include ../tools.mk
-
-all: lib.rs ext.rs
-	$(HOST_RPATH_ENV) $(RUSTC) ext.rs
-	$(HOST_RPATH_ENV) $(RUSTDOC) -L $(TMPDIR) -w html -o $(TMPDIR)/doc lib.rs
-	$(HTMLDOCCK) $(TMPDIR)/doc lib.rs
diff --git a/src/test/run-make/rustdoc-extern-method/Makefile b/src/test/run-make/rustdoc-extern-method/Makefile
deleted file mode 100644
index 55cbd2da6ae..00000000000
--- a/src/test/run-make/rustdoc-extern-method/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
--include ../tools.mk
-
-all: foo.rs bar.rs
-	$(HOST_RPATH_ENV) $(RUSTC) foo.rs
-	$(HOST_RPATH_ENV) $(RUSTDOC) -w html -o $(TMPDIR)/doc foo.rs
-	$(HOST_RPATH_ENV) $(RUSTDOC) -L $(TMPDIR) -w html -o $(TMPDIR)/doc bar.rs
-	$(HTMLDOCCK) $(TMPDIR)/doc bar.rs
diff --git a/src/test/run-make/rustdoc-ffi/Makefile b/src/test/run-make/rustdoc-ffi/Makefile
deleted file mode 100644
index c312efe12f5..00000000000
--- a/src/test/run-make/rustdoc-ffi/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
--include ../tools.mk
-
-all: lib.rs
-	$(HOST_RPATH_ENV) $(RUSTC) lib.rs
-	$(HOST_RPATH_ENV) $(RUSTDOC) -w html -o $(TMPDIR)/doc lib.rs
-	$(HOST_RPATH_ENV) $(RUSTDOC) -L $(TMPDIR) -w html -o $(TMPDIR)/doc user.rs
-	$(HTMLDOCCK) $(TMPDIR)/doc lib.rs
-	$(HTMLDOCCK) $(TMPDIR)/doc user.rs
diff --git a/src/test/run-make/rustdoc-hidden-line/Makefile b/src/test/run-make/rustdoc-hidden-line/Makefile
deleted file mode 100644
index 3ac7b6d2fae..00000000000
--- a/src/test/run-make/rustdoc-hidden-line/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
--include ../tools.mk
-
-# FIXME ignore windows
-ifndef IS_WINDOWS
-
-all:
-	@echo $(RUSTDOC)
-	$(HOST_RPATH_ENV) $(RUSTDOC) --test foo.rs
-	$(HOST_RPATH_ENV) $(RUSTDOC) -w html -o $(TMPDIR)/doc foo.rs
-	$(HTMLDOCCK) $(TMPDIR)/doc foo.rs
-
-else
-all:
-
-endif
diff --git a/src/test/run-make/rustdoc-must-use/Makefile b/src/test/run-make/rustdoc-must-use/Makefile
deleted file mode 100644
index 74fca83f5f9..00000000000
--- a/src/test/run-make/rustdoc-must-use/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
--include ../tools.mk
-
-all: lib.rs
-	$(HOST_RPATH_ENV) $(RUSTDOC) -w html -o $(TMPDIR)/doc lib.rs
-	$(HTMLDOCCK) $(TMPDIR)/doc lib.rs
diff --git a/src/test/run-make/rustdoc-negative-impl/Makefile b/src/test/run-make/rustdoc-negative-impl/Makefile
deleted file mode 100644
index c1b1683efdb..00000000000
--- a/src/test/run-make/rustdoc-negative-impl/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
--include ../tools.mk
-
-all: foo.rs
-	$(HOST_RPATH_ENV) $(RUSTDOC) -w html -o $(TMPDIR)/doc foo.rs
-	$(HTMLDOCCK) $(TMPDIR)/doc foo.rs
diff --git a/src/test/run-make/rustdoc-recursion/Makefile b/src/test/run-make/rustdoc-recursion/Makefile
deleted file mode 100644
index ba971836e5a..00000000000
--- a/src/test/run-make/rustdoc-recursion/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
--include ../tools.mk
-
-# FIXME ignore windows
-ifndef IS_WINDOWS
-all:
-	$(HOST_RPATH_ENV) $(RUSTDOC) -w html -o $(TMPDIR)/doc foo.rs
-	$(HOST_RPATH_ENV) $(RUSTDOC) -w html -o $(TMPDIR)/doc foo2.rs
-	$(HOST_RPATH_ENV) $(RUSTDOC) -w html -o $(TMPDIR)/doc foo3.rs
-else
-all:
-endif
diff --git a/src/test/run-make/rustdoc-search-index/Makefile b/src/test/run-make/rustdoc-search-index/Makefile
deleted file mode 100644
index e7e8f0c35a7..00000000000
--- a/src/test/run-make/rustdoc-search-index/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
--include ../tools.mk
-
-# FIXME ignore windows
-ifndef IS_WINDOWS
-
-source=index.rs
-
-all:
-	$(HOST_RPATH_ENV) $(RUSTDOC) -w html -o $(TMPDIR)/doc $(source)
-	$(HTMLDOCCK) $(TMPDIR)/doc $(source)
-
-else
-all:
-
-endif
diff --git a/src/test/run-make/rustdoc-smoke/Makefile b/src/test/run-make/rustdoc-smoke/Makefile
deleted file mode 100644
index 7a1ad761b3d..00000000000
--- a/src/test/run-make/rustdoc-smoke/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
--include ../tools.mk
-all:
-	$(HOST_RPATH_ENV) $(RUSTDOC) -w html -o $(TMPDIR)/doc foo.rs
-	$(HTMLDOCCK) $(TMPDIR)/doc foo.rs
diff --git a/src/test/run-make/rustdoc-src-links/Makefile b/src/test/run-make/rustdoc-src-links/Makefile
deleted file mode 100644
index 419603e82f7..00000000000
--- a/src/test/run-make/rustdoc-src-links/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
--include ../tools.mk
-all:
-	$(HOST_RPATH_ENV) $(RUSTDOC) -w html -o $(TMPDIR)/doc foo.rs
-	$(HTMLDOCCK) $(TMPDIR)/doc foo.rs
-	$(HTMLDOCCK) $(TMPDIR)/doc qux/mod.rs
diff --git a/src/test/run-make/rustdoc-src-links/foo.rs b/src/test/run-make/rustdoc-src-links/foo.rs
deleted file mode 100644
index 9a964f11252..00000000000
--- a/src/test/run-make/rustdoc-src-links/foo.rs
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![crate_name = "foo"]
-
-//! Dox
-// @has src/foo/foo.rs.html
-// @has foo/index.html '//a/@href' '../src/foo/foo.rs.html'
-
-pub mod qux;
-
-// @has foo/bar/index.html '//a/@href' '../../src/foo/foo.rs.html'
-pub mod bar {
-
-    /// Dox
-    // @has foo/bar/baz/index.html '//a/@href' '../../../src/foo/foo.rs.html'
-    pub mod baz {
-        /// Dox
-        // @has foo/bar/baz/fn.baz.html '//a/@href' '../../../src/foo/foo.rs.html'
-        pub fn baz() { }
-    }
-
-    /// Dox
-    // @has foo/bar/trait.Foobar.html '//a/@href' '../../src/foo/foo.rs.html'
-    pub trait Foobar { fn dummy(&self) { } }
-
-    // @has foo/bar/struct.Foo.html '//a/@href' '../../src/foo/foo.rs.html'
-    pub struct Foo { x: i32, y: u32 }
-
-    // @has foo/bar/fn.prawns.html '//a/@href' '../../src/foo/foo.rs.html'
-    pub fn prawns((a, b): (i32, u32), Foo { x, y }: Foo) { }
-}
-
-/// Dox
-// @has foo/fn.modfn.html '//a/@href' '../src/foo/foo.rs.html'
-pub fn modfn() { }
diff --git a/src/test/run-make/rustdoc-src-links/qux/mod.rs b/src/test/run-make/rustdoc-src-links/qux/mod.rs
deleted file mode 100644
index 9b1563d32ac..00000000000
--- a/src/test/run-make/rustdoc-src-links/qux/mod.rs
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-//! Dox
-// @has src/foo/qux/mod.rs.html
-// @has foo/qux/index.html '//a/@href' '../../src/foo/qux/mod.rs.html'
-
-// @has foo/qux/bar/index.html '//a/@href' '../../../src/foo/qux/mod.rs.html'
-pub mod bar {
-
-    /// Dox
-    // @has foo/qux/bar/baz/index.html '//a/@href' '../../../../src/foo/qux/mod.rs.html'
-    pub mod baz {
-        /// Dox
-        // @has foo/qux/bar/baz/fn.baz.html '//a/@href' '../../../../src/foo/qux/mod.rs.html'
-        pub fn baz() { }
-    }
-
-    /// Dox
-    // @has foo/qux/bar/trait.Foobar.html '//a/@href' '../../../src/foo/qux/mod.rs.html'
-    pub trait Foobar { fn dummy(&self) { } }
-
-    // @has foo/qux/bar/struct.Foo.html '//a/@href' '../../../src/foo/qux/mod.rs.html'
-    pub struct Foo { x: i32, y: u32 }
-
-    // @has foo/qux/bar/fn.prawns.html '//a/@href' '../../../src/foo/qux/mod.rs.html'
-    pub fn prawns((a, b): (i32, u32), Foo { x, y }: Foo) { }
-}
-
-/// Dox
-// @has foo/qux/fn.modfn.html '//a/@href' '../../src/foo/qux/mod.rs.html'
-pub fn modfn() { }
diff --git a/src/test/run-make/rustdoc-viewpath-self/Makefile b/src/test/run-make/rustdoc-viewpath-self/Makefile
deleted file mode 100644
index c1b1683efdb..00000000000
--- a/src/test/run-make/rustdoc-viewpath-self/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
--include ../tools.mk
-
-all: foo.rs
-	$(HOST_RPATH_ENV) $(RUSTDOC) -w html -o $(TMPDIR)/doc foo.rs
-	$(HTMLDOCCK) $(TMPDIR)/doc foo.rs
diff --git a/src/test/run-make/rustdoc-where/Makefile b/src/test/run-make/rustdoc-where/Makefile
deleted file mode 100644
index c1b1683efdb..00000000000
--- a/src/test/run-make/rustdoc-where/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
--include ../tools.mk
-
-all: foo.rs
-	$(HOST_RPATH_ENV) $(RUSTDOC) -w html -o $(TMPDIR)/doc foo.rs
-	$(HTMLDOCCK) $(TMPDIR)/doc foo.rs
diff --git a/src/test/run-make/rustdoc-assoc-types/lib.rs b/src/test/rustdoc/assoc-types.rs
index 3e6e0ad5600..20076a76494 100644
--- a/src/test/run-make/rustdoc-assoc-types/lib.rs
+++ b/src/test/rustdoc/assoc-types.rs
@@ -10,7 +10,7 @@
 
 #![crate_type="lib"]
 
-// @has lib/trait.Index.html
+// @has assoc_types/trait.Index.html
 pub trait Index<I: ?Sized> {
     // @has - '//*[@id="associatedtype.Output"]//code' 'type Output: ?Sized'
     type Output: ?Sized;
diff --git a/src/test/run-make/rustdoc-default-impl/bar.rs b/src/test/rustdoc/default-impl.rs
index 60a2f7202f8..0539ecae99d 100644
--- a/src/test/run-make/rustdoc-default-impl/bar.rs
+++ b/src/test/rustdoc/default-impl.rs
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern crate foo;
+// aux-build:rustdoc-default-impl.rs
+
+extern crate rustdoc_default_impl as foo;
 
 pub use foo::bar;
 
diff --git a/src/test/run-make/rustdoc-extern-default-method/lib.rs b/src/test/rustdoc/extern-default-method.rs
index df92764dc9a..c40c46df9fe 100644
--- a/src/test/run-make/rustdoc-extern-default-method/lib.rs
+++ b/src/test/rustdoc/extern-default-method.rs
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-extern crate ext;
+// aux-build:rustdoc-extern-default-method.rs
 
-// @count lib/struct.Struct.html '//*[@id="method.provided"]' 1
+extern crate rustdoc_extern_default_method as ext;
+
+// @count extern_default_method/struct.Struct.html '//*[@id="method.provided"]' 1
 pub use ext::Struct;
diff --git a/src/test/run-make/rustdoc-extern-method/bar.rs b/src/test/rustdoc/extern-method.rs
index 26a05f8490f..ff92adf08c1 100644
--- a/src/test/run-make/rustdoc-extern-method/bar.rs
+++ b/src/test/rustdoc/extern-method.rs
@@ -8,16 +8,18 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// aux-build:rustdoc-extern-method.rs
+
 #![feature(unboxed_closures)]
 
-extern crate foo;
+extern crate rustdoc_extern_method as foo;
 
-// @has bar/trait.Foo.html //pre "pub trait Foo"
+// @has extern_method/trait.Foo.html //pre "pub trait Foo"
 // @has - '//*[@id="tymethod.foo"]//code' 'extern "rust-call" fn foo'
 // @has - '//*[@id="tymethod.foo_"]//code' 'extern "rust-call" fn foo_'
 pub use foo::Foo;
 
-// @has bar/trait.Bar.html //pre "pub trait Bar"
+// @has extern_method/trait.Bar.html //pre "pub trait Bar"
 pub trait Bar {
     // @has - '//*[@id="tymethod.bar"]//code' 'extern "rust-call" fn bar'
     extern "rust-call" fn bar(&self, _: ());
diff --git a/src/test/run-make/rustdoc-ffi/user.rs b/src/test/rustdoc/ffi.rs
index 09d7a7c536c..a720e39497d 100644
--- a/src/test/run-make/rustdoc-ffi/user.rs
+++ b/src/test/rustdoc/ffi.rs
@@ -8,9 +8,14 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![crate_type="lib"]
+// aux-build:rustdoc-ffi.rs
 
-extern crate lib;
+extern crate rustdoc_ffi as lib;
 
-// @has user/fn.foreigner.html //pre 'pub unsafe fn foreigner(cold_as_ice: u32)'
+// @has ffi/fn.foreigner.html //pre 'pub unsafe fn foreigner(cold_as_ice: u32)'
 pub use lib::foreigner;
+
+extern "C" {
+    // @has ffi/fn.another.html //pre 'pub unsafe fn another(cold_as_ice: u32)'
+    pub fn another(cold_as_ice: u32);
+}
diff --git a/src/test/run-make/rustdoc-hidden-line/foo.rs b/src/test/rustdoc/hidden-line.rs
index 3906d9ee8ae..bb9eec793df 100644
--- a/src/test/run-make/rustdoc-hidden-line/foo.rs
+++ b/src/test/rustdoc/hidden-line.rs
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![crate_name="foo"]
-
 /// The '# ' lines should be removed from the output, but the #[derive] should be
 /// retained.
 ///
@@ -31,5 +29,5 @@
 /// ```
 pub fn foo() {}
 
-// @!has foo/fn.foo.html invisible
+// @!has hidden_line/fn.foo.html invisible
 // @matches - //pre "#\[derive\(PartialEq\)\] // Bar"
diff --git a/src/test/run-make/rustdoc-must-use/lib.rs b/src/test/rustdoc/must-use.rs
index cef79d4536b..e293675f5b0 100644
--- a/src/test/run-make/rustdoc-must-use/lib.rs
+++ b/src/test/rustdoc/must-use.rs
@@ -8,15 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![crate_type="lib"]
-
-// @has lib/struct.Struct.html //pre '#[must_use]'
+// @has must_use/struct.Struct.html //pre '#[must_use]'
 #[must_use]
 pub struct Struct {
     field: i32,
 }
 
-// @has lib/enum.Enum.html //pre '#[must_use = "message"]'
+// @has must_use/enum.Enum.html //pre '#[must_use = "message"]'
 #[must_use = "message"]
 pub enum Enum {
     Variant(i32),
diff --git a/src/test/run-make/rustdoc-negative-impl/foo.rs b/src/test/rustdoc/negative-impl.rs
index 6c56bcc9be6..aadabb15d1d 100644
--- a/src/test/run-make/rustdoc-negative-impl/foo.rs
+++ b/src/test/rustdoc/negative-impl.rs
@@ -10,13 +10,13 @@
 
 #![feature(optin_builtin_traits)]
 
-// @matches foo/struct.Alpha.html '//pre' "pub struct Alpha"
+// @matches negative_impl/struct.Alpha.html '//pre' "pub struct Alpha"
 pub struct Alpha;
-// @matches foo/struct.Bravo.html '//pre' "pub struct Bravo<B>"
+// @matches negative_impl/struct.Bravo.html '//pre' "pub struct Bravo<B>"
 pub struct Bravo<B>(B);
 
-// @matches foo/struct.Alpha.html '//*[@class="impl"]//code' "impl !Send for Alpha"
+// @matches negative_impl/struct.Alpha.html '//*[@class="impl"]//code' "impl !Send for Alpha"
 impl !Send for Alpha {}
 
-// @matches foo/struct.Bravo.html '//*[@class="impl"]//code' "impl<B> !Send for Bravo<B>"
+// @matches negative_impl/struct.Bravo.html '//*[@class="impl"]//code' "impl<B> !Send for Bravo<B>"
 impl<B> !Send for Bravo<B> {}
diff --git a/src/test/run-make/rustdoc-recursion/foo.rs b/src/test/rustdoc/recursion1.rs
index 7505d20566d..7505d20566d 100644
--- a/src/test/run-make/rustdoc-recursion/foo.rs
+++ b/src/test/rustdoc/recursion1.rs
diff --git a/src/test/run-make/rustdoc-recursion/foo2.rs b/src/test/rustdoc/recursion2.rs
index 7505d20566d..7505d20566d 100644
--- a/src/test/run-make/rustdoc-recursion/foo2.rs
+++ b/src/test/rustdoc/recursion2.rs
diff --git a/src/test/run-make/rustdoc-recursion/foo3.rs b/src/test/rustdoc/recursion3.rs
index 62a13f76ca4..62a13f76ca4 100644
--- a/src/test/run-make/rustdoc-recursion/foo3.rs
+++ b/src/test/rustdoc/recursion3.rs
diff --git a/src/test/run-make/rustdoc-search-index/index.rs b/src/test/rustdoc/search-index.rs
index 42469a21f22..42469a21f22 100644
--- a/src/test/run-make/rustdoc-search-index/index.rs
+++ b/src/test/rustdoc/search-index.rs
diff --git a/src/test/run-make/rustdoc-smoke/foo.rs b/src/test/rustdoc/smoke.rs
index 494eb03d728..6ba7018bf22 100644
--- a/src/test/run-make/rustdoc-smoke/foo.rs
+++ b/src/test/rustdoc/smoke.rs
@@ -8,29 +8,28 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// @has foo/index.html
-#![crate_name = "foo"]
+// @has smoke/index.html
 
 //! Very docs
 
-// @has foo/bar/index.html
+// @has smoke/bar/index.html
 pub mod bar {
 
     /// So correct
-    // @has foo/bar/baz/index.html
+    // @has smoke/bar/baz/index.html
     pub mod baz {
         /// Much detail
-        // @has foo/bar/baz/fn.baz.html
+        // @has smoke/bar/baz/fn.baz.html
         pub fn baz() { }
     }
 
     /// *wow*
-    // @has foo/bar/trait.Doge.html
+    // @has smoke/bar/trait.Doge.html
     pub trait Doge { fn dummy(&self) { } }
 
-    // @has foo/bar/struct.Foo.html
+    // @has smoke/bar/struct.Foo.html
     pub struct Foo { x: isize, y: usize }
 
-    // @has foo/bar/fn.prawns.html
+    // @has smoke/bar/fn.prawns.html
     pub fn prawns((a, b): (isize, usize), Foo { x, y }: Foo) { }
 }
diff --git a/src/test/rustdoc/src-links.rs b/src/test/rustdoc/src-links.rs
new file mode 100644
index 00000000000..4d7dad64b47
--- /dev/null
+++ b/src/test/rustdoc/src-links.rs
@@ -0,0 +1,56 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![crate_name = "foo"]
+
+//! Dox
+// @has src/foo/src-links.rs.html
+// @has foo/index.html '//a/@href' '../src/foo/src-links.rs.html'
+
+#[path = "src-links/mod.rs"]
+pub mod qux;
+
+// @has foo/bar/index.html '//a/@href' '../../src/foo/src-links.rs.html'
+pub mod bar {
+
+    /// Dox
+    // @has foo/bar/baz/index.html '//a/@href' '../../../src/foo/src-links.rs.html'
+    pub mod baz {
+        /// Dox
+        // @has foo/bar/baz/fn.baz.html '//a/@href' '../../../src/foo/src-links.rs.html'
+        pub fn baz() { }
+    }
+
+    /// Dox
+    // @has foo/bar/trait.Foobar.html '//a/@href' '../../src/foo/src-links.rs.html'
+    pub trait Foobar { fn dummy(&self) { } }
+
+    // @has foo/bar/struct.Foo.html '//a/@href' '../../src/foo/src-links.rs.html'
+    pub struct Foo { x: i32, y: u32 }
+
+    // @has foo/bar/fn.prawns.html '//a/@href' '../../src/foo/src-links.rs.html'
+    pub fn prawns((a, b): (i32, u32), Foo { x, y }: Foo) { }
+}
+
+/// Dox
+// @has foo/fn.modfn.html '//a/@href' '../src/foo/src-links.rs.html'
+pub fn modfn() { }
+
+// same hierarchy as above, but just for the submodule
+
+// @has src/foo/src-links/mod.rs.html
+// @has foo/qux/index.html '//a/@href' '../../src/foo/src-links/mod.rs.html'
+// @has foo/qux/bar/index.html '//a/@href' '../../../src/foo/src-links/mod.rs.html'
+// @has foo/qux/bar/baz/index.html '//a/@href' '../../../../src/foo/src-links/mod.rs.html'
+// @has foo/qux/bar/baz/fn.baz.html '//a/@href' '../../../../src/foo/src-links/mod.rs.html'
+// @has foo/qux/bar/trait.Foobar.html '//a/@href' '../../../src/foo/src-links/mod.rs.html'
+// @has foo/qux/bar/struct.Foo.html '//a/@href' '../../../src/foo/src-links/mod.rs.html'
+// @has foo/qux/bar/fn.prawns.html '//a/@href' '../../../src/foo/src-links/mod.rs.html'
+// @has foo/qux/fn.modfn.html '//a/@href' '../../src/foo/src-links/mod.rs.html'
diff --git a/src/test/rustdoc/src-links/mod.rs b/src/test/rustdoc/src-links/mod.rs
new file mode 100644
index 00000000000..eb5e737b369
--- /dev/null
+++ b/src/test/rustdoc/src-links/mod.rs
@@ -0,0 +1,29 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! Dox
+pub mod bar {
+
+    /// Dox
+    pub mod baz {
+        /// Dox
+        pub fn baz() { }
+    }
+
+    /// Dox
+    pub trait Foobar { fn dummy(&self) { } }
+
+    pub struct Foo { x: i32, y: u32 }
+
+    pub fn prawns((a, b): (i32, u32), Foo { x, y }: Foo) { }
+}
+
+/// Dox
+pub fn modfn() { }
diff --git a/src/test/run-make/rustdoc-viewpath-self/foo.rs b/src/test/rustdoc/viewpath-self.rs
index 6fd47d84c30..65a981353f0 100644
--- a/src/test/run-make/rustdoc-viewpath-self/foo.rs
+++ b/src/test/rustdoc/viewpath-self.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![crate_name = "foo"]
+
 pub mod io {
     pub trait Reader { fn dummy(&self) { } }
 }
diff --git a/src/test/run-make/rustdoc-where/foo.rs b/src/test/rustdoc/where.rs
index 91a7e1c9fd4..3ce91d63300 100644
--- a/src/test/run-make/rustdoc-where/foo.rs
+++ b/src/test/rustdoc/where.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![crate_name = "foo"]
+
 pub trait MyTrait { fn dummy(&self) { } }
 
 // @has foo/struct.Alpha.html '//pre' "pub struct Alpha<A> where A: MyTrait"