From ad547a6b5986815fda458221149728d9d9ab1d87 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 25 Feb 2021 19:22:25 +0000 Subject: restore Build,TODO from r57911 git-svn-id: svn://tug.org/texlive/trunk@57915 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/dvipsk/quotecmd-test.pl | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 Build/source/texk/dvipsk/quotecmd-test.pl (limited to 'Build/source/texk/dvipsk/quotecmd-test.pl') diff --git a/Build/source/texk/dvipsk/quotecmd-test.pl b/Build/source/texk/dvipsk/quotecmd-test.pl new file mode 100755 index 00000000000..47ea252d037 --- /dev/null +++ b/Build/source/texk/dvipsk/quotecmd-test.pl @@ -0,0 +1,34 @@ +#!/usr/bin/env perl +# $Id$ +# 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 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. The names here and in quotecmd.tex + # must match exactly or the test won't be testing what it should. + # + # Leave the file in place, so we can conveniently run dvips under the + # debugger 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; +} -- cgit v1.2.3