about summary refs log tree commit diff
path: root/src/test/run-make
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-02-08 06:15:52 +0000
committerbors <bors@rust-lang.org>2015-02-08 06:15:52 +0000
commitcdaf3a4393927ddfba071cfbfe86d95b68e7ae3e (patch)
tree9828694d7a89d98659c4f8b7c79d466dabb0b435 /src/test/run-make
parentf16de18db448ca5de45bff90579990259518e1fc (diff)
parente43c478035d82556168432d9be1027eca75af495 (diff)
downloadrust-cdaf3a4393927ddfba071cfbfe86d95b68e7ae3e.tar.gz
rust-cdaf3a4393927ddfba071cfbfe86d95b68e7ae3e.zip
Auto merge of #21999 - tomjakubowski:rustdoc-fixes, r=alexcrichton
r? @alexcrichton 
Diffstat (limited to 'src/test/run-make')
-rw-r--r--src/test/run-make/rustdoc-assoc-types/Makefile5
-rw-r--r--src/test/run-make/rustdoc-assoc-types/lib.rs20
-rw-r--r--src/test/run-make/rustdoc-extern-method/Makefile8
-rw-r--r--src/test/run-make/rustdoc-extern-method/bar.rs24
-rw-r--r--src/test/run-make/rustdoc-extern-method/foo.rs16
-rw-r--r--src/test/run-make/rustdoc-ffi/Makefile8
-rw-r--r--src/test/run-make/rustdoc-ffi/lib.rs16
-rw-r--r--src/test/run-make/rustdoc-ffi/user.rs16
-rw-r--r--src/test/run-make/rustdoc-hidden-line/foo.rs3
-rw-r--r--src/test/run-make/rustdoc-negative-impl/foo.rs4
-rw-r--r--src/test/run-make/rustdoc-where/foo.rs25
11 files changed, 129 insertions, 16 deletions
diff --git a/src/test/run-make/rustdoc-assoc-types/Makefile b/src/test/run-make/rustdoc-assoc-types/Makefile
new file mode 100644
index 00000000000..74fca83f5f9
--- /dev/null
+++ b/src/test/run-make/rustdoc-assoc-types/Makefile
@@ -0,0 +1,5 @@
+-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-assoc-types/lib.rs b/src/test/run-make/rustdoc-assoc-types/lib.rs
new file mode 100644
index 00000000000..3e6e0ad5600
--- /dev/null
+++ b/src/test/run-make/rustdoc-assoc-types/lib.rs
@@ -0,0 +1,20 @@
+// 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_type="lib"]
+
+// @has lib/trait.Index.html
+pub trait Index<I: ?Sized> {
+    // @has - '//*[@id="associatedtype.Output"]//code' 'type Output: ?Sized'
+    type Output: ?Sized;
+    // @has - '//*[@id="tymethod.index"]//code' \
+    //      "fn index<'a>(&'a self, index: I) -> &'a Self::Output"
+    fn index<'a>(&'a self, index: I) -> &'a Self::Output;
+}
diff --git a/src/test/run-make/rustdoc-extern-method/Makefile b/src/test/run-make/rustdoc-extern-method/Makefile
new file mode 100644
index 00000000000..c87684f59ea
--- /dev/null
+++ b/src/test/run-make/rustdoc-extern-method/Makefile
@@ -0,0 +1,8 @@
+-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-extern-method/bar.rs b/src/test/run-make/rustdoc-extern-method/bar.rs
new file mode 100644
index 00000000000..672090c13a2
--- /dev/null
+++ b/src/test/run-make/rustdoc-extern-method/bar.rs
@@ -0,0 +1,24 @@
+// 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.
+
+extern crate foo;
+
+// @has bar/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"
+pub trait Bar {
+    // @has - '//*[@id="tymethod.bar"]//code' 'extern "rust-call" fn bar'
+    extern "rust-call" fn bar(&self, _: ());
+    // @has - '//*[@id="method.bar_"]//code' 'extern "rust-call" fn bar_'
+    extern "rust-call" fn bar_(&self, _: ()) { }
+}
diff --git a/src/test/run-make/rustdoc-extern-method/foo.rs b/src/test/run-make/rustdoc-extern-method/foo.rs
new file mode 100644
index 00000000000..fc5f03e8bd3
--- /dev/null
+++ b/src/test/run-make/rustdoc-extern-method/foo.rs
@@ -0,0 +1,16 @@
+// 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_type="lib"]
+
+pub trait Foo {
+    extern "rust-call" fn foo(&self, _: ()) -> i32;
+    extern "rust-call" fn foo_(&self, _: ()) -> i32 { 0 }
+}
diff --git a/src/test/run-make/rustdoc-ffi/Makefile b/src/test/run-make/rustdoc-ffi/Makefile
new file mode 100644
index 00000000000..c312efe12f5
--- /dev/null
+++ b/src/test/run-make/rustdoc-ffi/Makefile
@@ -0,0 +1,8 @@
+-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-ffi/lib.rs b/src/test/run-make/rustdoc-ffi/lib.rs
new file mode 100644
index 00000000000..e06dbe76dbb
--- /dev/null
+++ b/src/test/run-make/rustdoc-ffi/lib.rs
@@ -0,0 +1,16 @@
+// 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_type="lib"]
+
+extern "C" {
+    // @has lib/fn.foreigner.html //pre 'pub unsafe fn foreigner(cold_as_ice: u32)'
+    pub fn foreigner(cold_as_ice: u32);
+}
diff --git a/src/test/run-make/rustdoc-ffi/user.rs b/src/test/run-make/rustdoc-ffi/user.rs
new file mode 100644
index 00000000000..09d7a7c536c
--- /dev/null
+++ b/src/test/run-make/rustdoc-ffi/user.rs
@@ -0,0 +1,16 @@
+// 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_type="lib"]
+
+extern crate lib;
+
+// @has user/fn.foreigner.html //pre 'pub unsafe fn foreigner(cold_as_ice: u32)'
+pub use lib::foreigner;
diff --git a/src/test/run-make/rustdoc-hidden-line/foo.rs b/src/test/run-make/rustdoc-hidden-line/foo.rs
index c538a132fb1..3906d9ee8ae 100644
--- a/src/test/run-make/rustdoc-hidden-line/foo.rs
+++ b/src/test/run-make/rustdoc-hidden-line/foo.rs
@@ -32,5 +32,4 @@
 pub fn foo() {}
 
 // @!has foo/fn.foo.html invisible
-// @matches - //pre '#.*\[.*derive.*\(.*Eq.*\).*\].*//.*Bar'
-
+// @matches - //pre "#\[derive\(PartialEq\)\] // Bar"
diff --git a/src/test/run-make/rustdoc-negative-impl/foo.rs b/src/test/run-make/rustdoc-negative-impl/foo.rs
index eaa3af86563..b5fcbf46c5c 100644
--- a/src/test/run-make/rustdoc-negative-impl/foo.rs
+++ b/src/test/run-make/rustdoc-negative-impl/foo.rs
@@ -15,8 +15,8 @@ pub struct Alpha;
 // @matches foo/struct.Bravo.html '//pre' "pub struct Bravo<B>"
 pub struct Bravo<B>;
 
-// @matches foo/struct.Alpha.html '//*[@class="impl"]//code' "impl !.*Send.* for .*Alpha"
+// @matches foo/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 foo/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-where/foo.rs b/src/test/run-make/rustdoc-where/foo.rs
index 9f38ff13805..68fde60564e 100644
--- a/src/test/run-make/rustdoc-where/foo.rs
+++ b/src/test/run-make/rustdoc-where/foo.rs
@@ -10,29 +10,30 @@
 
 pub trait MyTrait {}
 
-// @matches foo/struct.Alpha.html '//pre' "Alpha.*where.*A:.*MyTrait"
+// @has foo/struct.Alpha.html '//pre' "pub struct Alpha<A> where A: MyTrait"
 pub struct Alpha<A> where A: MyTrait;
-// @matches foo/trait.Bravo.html '//pre' "Bravo.*where.*B:.*MyTrait"
+// @has foo/trait.Bravo.html '//pre' "pub trait Bravo<B> where B: MyTrait"
 pub trait Bravo<B> where B: MyTrait {}
-// @matches foo/fn.charlie.html '//pre' "charlie.*where.*C:.*MyTrait"
+// @has foo/fn.charlie.html '//pre' "pub fn charlie<C>() where C: MyTrait"
 pub fn charlie<C>() where C: MyTrait {}
 
 pub struct Delta<D>;
-// @matches foo/struct.Delta.html '//*[@class="impl"]//code' "impl.*Delta.*where.*D:.*MyTrait"
+// @has foo/struct.Delta.html '//*[@class="impl"]//code' \
+//          "impl<D> Delta<D> where D: MyTrait"
 impl<D> Delta<D> where D: MyTrait {
     pub fn delta() {}
 }
 
 pub struct Echo<E>;
-// @matches foo/struct.Echo.html '//*[@class="impl"]//code' \
-//          "impl.*MyTrait.*for.*Echo.*where.*E:.*MyTrait"
-// @matches foo/trait.MyTrait.html '//*[@id="implementors-list"]//code' \
-//          "impl.*MyTrait.*for.*Echo.*where.*E:.*MyTrait"
+// @has foo/struct.Echo.html '//*[@class="impl"]//code' \
+//          "impl<E> MyTrait for Echo<E> where E: MyTrait"
+// @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//code' \
+//          "impl<E> MyTrait for Echo<E> where E: MyTrait"
 impl<E> MyTrait for Echo<E> where E: MyTrait {}
 
 pub enum Foxtrot<F> {}
-// @matches foo/enum.Foxtrot.html '//*[@class="impl"]//code' \
-//          "impl.*MyTrait.*for.*Foxtrot.*where.*F:.*MyTrait"
-// @matches foo/trait.MyTrait.html '//*[@id="implementors-list"]//code' \
-//          "impl.*MyTrait.*for.*Foxtrot.*where.*F:.*MyTrait"
+// @has foo/enum.Foxtrot.html '//*[@class="impl"]//code' \
+//          "impl<F> MyTrait for Foxtrot<F> where F: MyTrait"
+// @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//code' \
+//          "impl<F> MyTrait for Foxtrot<F> where F: MyTrait"
 impl<F> MyTrait for Foxtrot<F> where F: MyTrait {}