-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-test.sh
executable file
·63 lines (45 loc) · 1.46 KB
/
run-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
#!/bin/bash
#
# Arguments: Diff to commit ID
#-------------------------------------------------------------------------------
set -e
# commit id to diff to
DIFF_COMMIT=$1
CURRENT_COMMIT=$(git rev-parse HEAD)
# dir the temxf is in
TEXMF_DIR=../install/rawtree
OUT_DIR_CURRENT=out-current
OUT_DIR_BASE=out-base
TEXMF_CURRENT=texmf-current
TEXMF_BASE=texmf-base
if [ -z $1 ]; then
echo "Run with 'run-test.sh COMMIT_ID'"
exit
fi
# Create dirs for texmf files
mkdir -p texmf-base
mkdir -p texmf-current
# Make all new
make -BC $TEXMF_DIR/ font build-src
# Copy files to temporary texmf folder
cp -r $TEXMF_DIR/tex texmf-current/.
cp -r $TEXMF_DIR/doc texmf-current/.
cp -r $TEXMF_DIR/fonts texmf-current/.
# Checkout version to commit
git checkout $DIFF_COMMIT
# Make all new
make -BC $TEXMF_DIR/ font build-src
# Copy files to temporary texmf folder
cp -r $TEXMF_DIR/tex texmf-base/.
cp -r $TEXMF_DIR/doc texmf-base/.
cp -r $TEXMF_DIR/fonts texmf-base/.
# Create output directories
mkdir -p $OUT_DIR_CURRENT
mkdir -p $OUT_DIR_BASE
git checkout $CURRENT_COMMIT
# Generate all test files
for testfile in $(find test-documents -name *.tex); do
TEXMFHOME=texmf-current:$(kpsewhich -var-value TEXMFHOME) pdflatex -output-directory $OUT_DIR_CURRENT $testfile;
TEXMFHOME=texmf-base:$(kpsewhich -var-value TEXMFHOME) pdflatex -output-directory $OUT_DIR_BASE $testfile;
./pdfdiff.sh $OUT_DIR_CURRENT/$(basename $testfile .tex).pdf $OUT_DIR_BASE/$(basename $testfile .tex).pdf
done