summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/tests
diff options
context:
space:
mode:
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;
+}