Skip to content

Commit b3e8390

Browse files
authored
Merge pull request #521 from ehuss/linkcheck
Add linkchecker.
2 parents 3c10c95 + d4544a7 commit b3e8390

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

.travis.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ install:
88

99
script:
1010
- export PATH=$PATH:/home/travis/.cargo/bin && mdbook test
11-
- cd stable-check && cargo run -- ../src
11+
- (cd stable-check && cargo run -- ../src)
12+
- tests/linkcheck.sh

tests/linkcheck.sh

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
if [ ! -f book.toml ]
6+
then
7+
echo "Run command in root directory with book.toml"
8+
exit 1
9+
fi
10+
11+
rm -rf tests/linkcheck tests/linkchecker
12+
13+
mkdir tests/linkchecker
14+
curl -o tests/linkchecker/Cargo.toml https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/Cargo.toml
15+
curl -o tests/linkchecker/main.rs https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/main.rs
16+
17+
mdbook build
18+
19+
cp -R $(rustc --print sysroot)/share/doc/rust/html tests/linkcheck
20+
rm -rf tests/linkcheck/reference
21+
cp -R book tests/linkcheck/reference
22+
23+
cargo run --manifest-path=tests/linkchecker/Cargo.toml -- tests/linkcheck/reference
24+
25+
rm -rf tests/linkcheck tests/linkchecker
26+
echo "Linkcheck completed successfully!"

0 commit comments

Comments
 (0)