From 9df6a81664289c4cf39c6251503a20a8f88f2a27 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 25 Dec 2009 01:19:05 +0000 Subject: add test for bibtex respecting openout git-svn-id: svn://tug.org/texlive/trunk@16507 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/texk/web2c/tests/bibtex-openout-test.pl | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 Build/source/texk/web2c/tests/bibtex-openout-test.pl (limited to 'Build/source/texk/web2c/tests') 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 . +# 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; +} -- cgit v1.2.3