diff options
| author | Corey Richardson <corey@octayn.net> | 2013-12-17 12:05:36 -0500 |
|---|---|---|
| committer | Corey Richardson <corey@octayn.net> | 2013-12-18 15:21:30 -0500 |
| commit | 5d45170b02fc3055f9a80d06f7ab1f508c8de98f (patch) | |
| tree | e54ba4365ebf9fcc4787509b2b1b26d3f15b625b /src | |
| parent | c33573440b61acf154a1cee55413d02f9835c9aa (diff) | |
Add a rustdoc test
This is just a smoke test which verifies that the expected files are generated. Also makes the rmake tests have the right deps.
Diffstat (limited to 'src')
| -rw-r--r-- | src/etc/maketest.py | 1 | ||||
| -rw-r--r-- | src/test/run-make/rustdoc-smoke/Makefile | 5 | ||||
| -rw-r--r-- | src/test/run-make/rustdoc-smoke/foo.rs | 15 | ||||
| -rwxr-xr-x | src/test/run-make/rustdoc-smoke/verify.sh | 17 |
4 files changed, 38 insertions, 0 deletions
diff --git a/src/etc/maketest.py b/src/etc/maketest.py index 96c658e5686..00d80e1bf4d 100644 --- a/src/etc/maketest.py +++ b/src/etc/maketest.py @@ -7,6 +7,7 @@ import sys os.putenv('RUSTC', os.path.abspath(sys.argv[2])) os.putenv('TMPDIR', os.path.abspath(sys.argv[3])) os.putenv('CC', sys.argv[4]) +os.putenv('RUSTDOC', os.path.abspath(sys.argv[5])) proc = subprocess.Popen(['make', '-C', sys.argv[1]], stdout = subprocess.PIPE, diff --git a/src/test/run-make/rustdoc-smoke/Makefile b/src/test/run-make/rustdoc-smoke/Makefile new file mode 100644 index 00000000000..0de678e7248 --- /dev/null +++ b/src/test/run-make/rustdoc-smoke/Makefile @@ -0,0 +1,5 @@ +-include ../tools.mk +all: + $(RUSTDOC) -w html -o $(TMPDIR)/doc foo.rs + cp verify.sh $(TMPDIR) + $(call RUN,verify.sh) $(TMPDIR) diff --git a/src/test/run-make/rustdoc-smoke/foo.rs b/src/test/run-make/rustdoc-smoke/foo.rs new file mode 100644 index 00000000000..7a86bf4d1e8 --- /dev/null +++ b/src/test/run-make/rustdoc-smoke/foo.rs @@ -0,0 +1,15 @@ +#[pkgid = "foo#0.1"]; + +//! Very docs + +pub mod bar { + + /// So correct + pub mod baz { + /// Much detail + pub fn baz() { } + } + + /// *wow* + pub trait Doge { } +} diff --git a/src/test/run-make/rustdoc-smoke/verify.sh b/src/test/run-make/rustdoc-smoke/verify.sh new file mode 100755 index 00000000000..18f3939794e --- /dev/null +++ b/src/test/run-make/rustdoc-smoke/verify.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +# $1 is the TMPDIR + +dirs="doc doc/foo doc/foo/bar doc/foo/bar/baz doc/src doc/src/foo" + +for dir in $dirs; do if [ ! -d $1/$dir ]; then + echo "$1/$dir is not a directory!" + exit 1 +fi done + +files="doc/foo/index.html doc/foo/bar/index.html doc/foo/bar/baz/fn.baz.html doc/foo/bar/trait.Doge.html doc/src/foo/foo.rs.html" + +for file in $files; do if [ ! -f $1/$file ]; then + echo "$1/$file is not a file!" + exit 1 +fi done |
