Skip to content

Commit

Permalink
Merge pull request rust-lang#521 from ehuss/linkcheck
Browse files Browse the repository at this point in the history
Add linkchecker.
  • Loading branch information
Havvy authored Mar 15, 2019
2 parents 3c10c95 + d4544a7 commit b3e8390
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
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
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!"

0 comments on commit b3e8390

Please sign in to comment.