summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/tests
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-12-25 01:19:05 +0000
committerKarl Berry <karl@freefriends.org>2009-12-25 01:19:05 +0000
commit9df6a81664289c4cf39c6251503a20a8f88f2a27 (patch)
tree90d4a71b293103f74e0ec66653e29cc70eb41177 /Build/source/texk/web2c/tests
parentdf79b2f75750d821914f8bdafa5fd9bb2eee9f4f (diff)
add test for bibtex respecting openout
git-svn-id: svn://tug.org/texlive/trunk@16507 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/tests')
-rwxr-xr-xBuild/source/texk/web2c/tests/bibtex-openout-test.pl37
1 files changed, 37 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/tests/bibtex-openout-test.pl b/Build/source/texk/web2c/tests/bibtex-openout-test.pl
new file mode 100755
index 00000000000..9d45effefa2
--- /dev/null
+++ b/Build/source/texk/web2c/tests/bibtex-openout-test.pl
@@ -0,0 +1,37 @@
+#!/usr/bin/env perl
+# $Id$
+# Copyright 2009 Karl Berry <tex-live@tug.org>.
+# You may freely use, modify and/or distribute this file.
+# Check that bibtex respects openout_any.
+
+BEGIN {
+ chomp ($mydir = `dirname $0`);
+ unshift (@INC, "$mydir");
+}
+
+exit (&main ());
+
+sub main
+{
+ # attempt at making it possible to run this when srcdir=builddir.
+ $ENV{"srcdir"} = $mydir if ! exists $ENV{"srcdir"};
+ my $srcdir = $ENV{"srcdir"};
+
+ $ENV{"TEXMFCNF"} = "$srcdir/../kpathsea";
+ $ENV{"BIBINPUTS"} = "$srcdir/tests";
+ $ENV{"BSTINPUTS"} = "$srcdir/tests";
+
+ $ENV{"openout_any"} = "p"; # should already be in texmf.cnf, but ...
+
+ my $prog = "./bibtex";
+ die "$0: no program $prog in " . `pwd` if ! -x $prog;
+
+ my @args = ("$srcdir/exampl.aux"); # blg open of abs path should fail
+
+ $ret = system ($prog, @args);
+ #warn ("ret=$ret in " . `pwd`);
+
+ # The test fails if the program succeeded. Ideally we'd grep the output.
+ my $bad = ($ret == 0);
+ return $bad;
+}