2021-01-10 17:12:49 +00:00
|
|
|
set -e
|
2021-08-24 17:58:55 +00:00
|
|
|
shopt -s globstar
|
2021-01-10 17:12:49 +00:00
|
|
|
startdir=$PWD
|
|
|
|
for file in tests/fixtures/*
|
|
|
|
do
|
2024-09-15 18:49:57 +00:00
|
|
|
echo "Testing $startdir/$file"
|
2021-01-10 17:12:49 +00:00
|
|
|
cd "$startdir/$file"
|
2024-11-02 19:29:15 +00:00
|
|
|
if test -d "$startdir/$file/etc"; then
|
|
|
|
mkdocs -v build --config-file etc/mkdocs.yml -s
|
|
|
|
else mkdocs -v build -s
|
|
|
|
fi
|
2021-08-24 17:58:55 +00:00
|
|
|
# unfortunately MkDocs writes the run date in the last few lines of index
|
|
|
|
# and has version numbers in some of the scripts that are irrelevant:
|
|
|
|
for hml in **/*.html
|
|
|
|
do
|
|
|
|
grep -v MkDocs.version $hml | grep -v Build.Date.UTC | grep -v '[</]script[ >]' | grep -v '[</]link' > "$hml.cropped"
|
|
|
|
rm $hml
|
|
|
|
done
|
2024-09-15 18:49:57 +00:00
|
|
|
diff -r -x img -x '*fonts*' -x js -x '*.xml*' refsite site
|
2021-01-10 17:12:49 +00:00
|
|
|
echo "Site in $file built successfully"
|
|
|
|
rm -r site
|
|
|
|
done
|
|
|
|
echo "All site tests passed."
|