diff options
author | Karl Berry <karl@freefriends.org> | 2010-02-18 18:03:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-02-18 18:03:18 +0000 |
commit | e826cf1e931e56a27391f357253038be01f25396 (patch) | |
tree | 2f3195394c18fc3fde2b8ef8ef4de296e96d4a08 /Build/source/texk/dvipsk/quotecmd-test.pl | |
parent | 265ec325225e513352908a8d61e2d0bc06d6ca09 (diff) |
move common-test.pl to common directory; new popen/gzip test for dvipsk
git-svn-id: svn://tug.org/texlive/trunk@17085 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipsk/quotecmd-test.pl')
-rwxr-xr-x | Build/source/texk/dvipsk/quotecmd-test.pl | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Build/source/texk/dvipsk/quotecmd-test.pl b/Build/source/texk/dvipsk/quotecmd-test.pl new file mode 100755 index 00000000000..2d1f90da004 --- /dev/null +++ b/Build/source/texk/dvipsk/quotecmd-test.pl @@ -0,0 +1,31 @@ +#!/usr/bin/env perl +# $Id: bibtex-openout-test.pl 16507 2009-12-25 01:19:05Z karl $ +# Public domain. Originally written 2010, Karl Berry. +# Check that dvips quotes external command arguments. + +BEGIN { chomp ($srcdir = $ENV{"srcdir"} || `dirname $0`); } +require "$srcdir/../tests/common-test.pl"; + +exit (&main ()); + +sub main +{ + # create the weirdly-named file which dvips executes with popen. + # quotecmd.tex itself also creates it, but we don't want to run TeX in + # this test, nor do we want such a weirdly-named file in our + # repository, so create it here. Leave it in place, so we can run the + # program under the debugging if we need to. + my $weirdf = ' 2>&1 | echo badnews >pwned.txt #.gz'; + unlink ($weirdf); # ensure no leftover + open (WEIRDF, ">", $weirdf); + close (WEIRDF) || die "open(weird file name) failed: $!"; + + $badfile = "pwned.txt"; # will be created if program is broken + unlink ($badfile); # ensure no leftover from previous test + + my @args = ("$srcdir/testdata/quotecmd.dvi", qw(-o /dev/null)); + my $ret = &test_run ("./dvips", @args); + + my $bad = -f $badfile; # file should not have been created + return $bad; +} |