-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.sh
executable file
·85 lines (73 loc) · 2.11 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
set -u
set -o pipefail
PATH=/tmp/texlive/bin/x86_64-linux:$PATH
if [ ! -r ../biblio.bib ]; then
echo "Error ../biblio.bib not found. This script must be run in test/"
exit 1
fi
./fast_check.sh ../*.bib || exit 1
travis_fold_start() {
if [ ! -z ${TRAVIS:-} ]; then
echo -e "travis_fold:start: $1\033[33;1m$2\033[0m"
else
echo -e "::group:: $1 \033[33;1m$2\033[0m"
fi
}
travis_fold_end() {
if [ ! -z ${TRAVIS:-} ]; then
echo -e "\ntravis_fold:end: $1\r"
else
echo -e "\n::endgroup::\n"
fi
}
latexmake() {
TEXMAIN=$1
BST=$2
travis_fold_start latexmk.1 "latexmk $TEXMAIN $BST"
rm -f *.bbl *.aux *.log *.out *.bcf *.blg *.fls *.hd *.fdb_latexmk *.run.xml *.syctex.gz
if [ -h tmp.bst ]; then
rm -f tmp.bst
fi
if [ $bst != "" ]; then
ln -s ${BST}.bst tmp.bst
fi
latexmk -silent -halt-on-error -interaction=nonstopmode -gg --pdf $TEXMAIN | tee .bibtex-warnings
if [ $? -ne 0 ]; then
travis_fold_end latexmk.1
echo "Error: latexmk failed"
LOGFILE=${TEXMAIN%.*}.log
cat "$LOGFILE"
exit 1
fi
grep --quiet "Warning--" .bibtex-warnings
if [ $? -eq 0 ]; then
travis_fold_end latexmk.1
echo "Error: Please fix bibtex Warnings:"
grep "Warning--" .bibtex-warnings
exit 1
fi
grep --quiet "WARN" .bibtex-warnings
if [ $? -eq 0 ]; then
travis_fold_end latexmk.1
echo "Error: Please fix biblatex Warnings:"
grep "WARN" .bibtex-warnings
exit 1
fi
travis_fold_end latexmk.1
}
TEXMAIN="testbib.tex"
# FIXME: This doesn't seem to do anything useful.
# travis_fold_start texliveonfly.1 "texliveonfly $TEXMAIN"
# texliveonfly $TEXMAIN
# travis_fold_end texliveonfly.1
for main in "testbib" "testshortbib"; do
# FIXME: Too many warnings
# "../bibstyles/ACM-Reference-Format"
for bst in "../bibstyles/splncs04abbrev" "../bibstyles/abbrvnatamp" "$main"; do
latexmake "${main}.tex" "$bst"
done
done
latexmake "testbiblatex.tex" ""
echo "No bibtex warnings! Good job!"
exit 0