summaryrefslogtreecommitdiff
path: root/Build/source/texk/tests/common-test.pl
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-03-08 18:49:47 +0000
committerKarl Berry <karl@freefriends.org>2010-03-08 18:49:47 +0000
commit39314b5c03d8cbc0fd25b4cc665df2090d75defe (patch)
tree9ea4ea2c6ef3a8376fcc52947b0fb0db2dedd970 /Build/source/texk/tests/common-test.pl
parent933606e1f19552101ffc0e2ddb0126253601efee (diff)
add longline test for bibtex 0.99d
git-svn-id: svn://tug.org/texlive/trunk@17384 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/tests/common-test.pl')
-rw-r--r--Build/source/texk/tests/common-test.pl36
1 files changed, 33 insertions, 3 deletions
diff --git a/Build/source/texk/tests/common-test.pl b/Build/source/texk/tests/common-test.pl
index 414168a9648..fe7f9d0bdb6 100644
--- a/Build/source/texk/tests/common-test.pl
+++ b/Build/source/texk/tests/common-test.pl
@@ -3,10 +3,13 @@
# Common definitions for Perl tests in TeX Live. We want to use Perl to
# have a chance of running the tests on Windows.
+# srcdir must be a sibling dir to kpathsea, e.g., web2c.
$ENV{"TEXMFCNF"} = "$srcdir/../kpathsea";
-$ENV{"BIBINPUTS"} = "$srcdir/tests";
-$ENV{"BSTINPUTS"} = "$srcdir/tests";
-$ENV{"TEXINPUTS"} = "$srcdir/tests";
+$ENV{"BIBINPUTS"}
+ = $ENV{"BSTINPUTS"}
+ = $ENV{"TEXINPUTS"}
+ = ".:$srcdir/tests:$srcdir/../tests/texmf//";
+
# Run PROG with ARGS. Return the exit status.
# Die if PROG is not executable.
@@ -22,3 +25,30 @@ sub test_run
my $ret = system ($prog, @args);
return $ret;
}
+
+sub test_file_copy
+{
+ my ($srcfile,$dstfile) = @_;
+
+ # don't copy onto itself.
+ chomp (my $srcdir = `dirname $srcfile`);
+ chomp ($srcdir = `cd $srcdir && pwd`);
+ #
+ chomp (my $dstdir = `dirname $dstfile`);
+ chomp ($dstdir = `cd $dstdir && pwd`);
+ return if $srcdir eq $dstdir;
+
+ local *IN;
+ $IN = "<$srcfile";
+ open (IN) || die "open($srcfile) failed: $!";
+ my @in = <IN>;
+ close (IN) || warn "close($srcfile) failed: $!";
+
+ local *OUT;
+ $OUT = ">$dstfile";
+ open (OUT) || die "open($dstfile) failed: $!";
+ print (OUT @in) || die "print($dstfile) failed: $!";
+ close (OUT) || warn "close($dstfile) failed: $!";
+
+ return 0;
+}