summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/synctexdir
diff options
context:
space:
mode:
authorJérôme Laurens <jerome.laurens@u-bourgogne.fr>2015-06-25 07:38:35 +0000
committerJérôme Laurens <jerome.laurens@u-bourgogne.fr>2015-06-25 07:38:35 +0000
commit6e28ac22929b91ab33618d1627b507a95599dde4 (patch)
treebeb5363a5732469becc0362ef43730dd6ba04fe7 /Build/source/texk/web2c/synctexdir
parent3abee7290010961f97384c3fe14ce3b73c5a31a8 (diff)
synctex: test file.sh now reads environment variables for custom installs
git-svn-id: svn://tug.org/texlive/trunk@37667 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/synctexdir')
-rwxr-xr-xBuild/source/texk/web2c/synctexdir/tests/test file.sh49
1 files changed, 40 insertions, 9 deletions
diff --git a/Build/source/texk/web2c/synctexdir/tests/test file.sh b/Build/source/texk/web2c/synctexdir/tests/test file.sh
index 598295348ad..d9c9a4384db 100755
--- a/Build/source/texk/web2c/synctexdir/tests/test file.sh
+++ b/Build/source/texk/web2c/synctexdir/tests/test file.sh
@@ -4,22 +4,53 @@
# This script can be sourced with "synctex" command available
# The test is a SUCCESS if no "FAILURE" appears in the output
+echo "This is test file.sh"
+echo "You can source this file or execute it"
+echo "[SYNCTEX_PATH=/the/path/to/synctex ][SYNCTEX_TEST_DIR=/the/path/to/the/test/folder ](source |./)\"test file.sh\""
+
+if test -z "$SYNCTEX_PATH"
+then
+SYNCTEX_PATH="$(which synctex)"
+elif ! test -f "$SYNCTEX_PATH" || ! test -x "$SYNCTEX_PATH"
+then
+ echo "No executable file at $SYNCTEX_PATH"
+exit -1
+fi
+echo "synctex command used: $SYNCTEX_PATH"
+if ! test -x "$SYNCTEX_PATH"
+then
+ echo "No executable file at $SYNCTEX_PATH"
+ exit -1
+fi
+
mkdir -p synctex_tests/foo/bar
mkdir -p synctex_tests/bar
-cp ../source/texk/web2c/synctexdir/unit\ tests/footest.synctex synctex_tests
-cp ../source/texk/web2c/synctexdir/unit\ tests/bartest.synctex.gz synctex_tests
+
+if test -z "$SYNCTEX_TEST_DIR"
+then
+SYNCTEX_TEST_DIR="../source/texk/web2c/synctexdir/unit\ tests"
+fi
+if ! test -d "$SYNCTEX_TEST_DIR"
+then
+ echo "No directory file at $SYNCTEX_TEST_DIR"
+ exit -1
+fi
+echo "synctex test directory: $SYNCTEX_TEST_DIR"
+
+cp "$SYNCTEX_TEST_DIR/footest.synctex" synctex_tests
+cp "$SYNCTEX_TEST_DIR/bartest.synctex.gz" synctex_tests
rm synctex_tests/bartest.synctex
-cp ../source/texk/web2c/synctexdir/unit\ tests/story-zapfino.tex synctex_tests
+cp "$SYNCTEX_TEST_DIR/story-zapfino.tex" synctex_tests
cd synctex_tests
-which synctex
-synctex test file -o footest.pdf
+
+"$SYNCTEX_PATH" test file -o footest.pdf
#
echo "-------------------------------- A-1"
-synctex view -i 1:0:test.tex -o footest
-synctex edit -o 1:0:0:bartest.pdf
-synctex update -o footest.pdf -m 2000 -x 212 -y 734
+"$SYNCTEX_PATH" view -i 1:0:test.tex -o footest
+"$SYNCTEX_PATH" edit -o 1:0:0:bartest.pdf
+"$SYNCTEX_PATH" update -o footest.pdf -m 2000 -x 212 -y 734
cat test.synctex
-synctex update -o bartest.pdf -m 2000 -x 212 -y 734
+"$SYNCTEX_PATH" update -o bartest.pdf -m 2000 -x 212 -y 734
gunzip bartest.synctex.gz
echo "test diff"
diff footest.synctex bartest.synctex