Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linkchecker. #521

Merged
merged 2 commits into from
Mar 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ install:

script:
- export PATH=$PATH:/home/travis/.cargo/bin && mdbook test
- cd stable-check && cargo run -- ../src
- (cd stable-check && cargo run -- ../src)
- tests/linkcheck.sh
2 changes: 1 addition & 1 deletion src/items/unions.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,4 @@ checking, etc etc etc).
[_Generics_]: items/generics.html
[_WhereClause_]: items/generics.html#where-clauses
[_StructFields_]: items/structs.html
[`transmute`]: ../../std/mem/fn.transmute.html
[`transmute`]: ../std/mem/fn.transmute.html
26 changes: 26 additions & 0 deletions tests/linkcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

set -e

if [ ! -f book.toml ]
then
echo "Run command in root directory with book.toml"
exit 1
fi

rm -rf tests/linkcheck tests/linkchecker

mkdir tests/linkchecker
curl -o tests/linkchecker/Cargo.toml https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/Cargo.toml
curl -o tests/linkchecker/main.rs https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/main.rs

mdbook build

cp -R $(rustc --print sysroot)/share/doc/rust/html tests/linkcheck
rm -rf tests/linkcheck/reference
cp -R book tests/linkcheck/reference

cargo run --manifest-path=tests/linkchecker/Cargo.toml -- tests/linkcheck/reference

rm -rf tests/linkcheck tests/linkchecker
echo "Linkcheck completed successfully!"