auto merge of #11185 : huonw/rust/doc-ignore, r=cmr

Currently any line starting with `#` is filtered from the output,
including line like `#[deriving]`; this patch makes it so lines are only
filtered when followed by a space similar to the current behaviour of
the tutorial/manual tester.
This commit is contained in:
bors 2013-12-30 05:51:51 -08:00
commit a4f30bf0c0
6 changed files with 57 additions and 7 deletions

View file

@ -0,0 +1,7 @@
-include ../tools.mk
all:
$(RUSTDOC) --test foo.rs
$(RUSTDOC) -w html -o $(TMPDIR)/doc foo.rs
cp verify.sh $(TMPDIR)
$(call RUN,verify.sh) $(TMPDIR)

View file

@ -0,0 +1,22 @@
#[crate_id="foo#0.1"];
/// The '# ' lines should be removed from the output, but the #[deriving] should be
/// retained.
///
/// ```rust
/// mod to_make_deriving_work { // FIXME #4913
///
/// # #[deriving(Eq)] // invisible
/// # struct Foo; // invisible
///
/// #[deriving(Eq)] // Bar
/// struct Bar(Foo);
///
/// fn test() {
/// let x = Bar(Foo);
/// assert!(x == x); // check that the derivings worked
/// }
///
/// }
/// ```
pub fn foo() {}

View file

@ -0,0 +1,8 @@
#!/bin/sh
file="$1/doc/foo/fn.foo.html"
grep -v 'invisible' $file &&
grep '#\[deriving(Eq)\] // Bar' $file
exit $?