From 6e28ac22929b91ab33618d1627b507a95599dde4 Mon Sep 17 00:00:00 2001 From: Jérôme Laurens Date: Thu, 25 Jun 2015 07:38:35 +0000 Subject: 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 --- .../texk/web2c/synctexdir/tests/test file.sh | 49 ++++++++++++++++++---- 1 file changed, 40 insertions(+), 9 deletions(-) (limited to 'Build/source/texk/web2c/synctexdir') 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 -- cgit v1.2.3