summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c
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/web2c
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/web2c')
-rw-r--r--Build/source/texk/web2c/ChangeLog6
-rw-r--r--Build/source/texk/web2c/Makefile.in6
-rw-r--r--Build/source/texk/web2c/am/web.am2
-rwxr-xr-xBuild/source/texk/web2c/tests/bibtex-longline-test.pl38
-rwxr-xr-xBuild/source/texk/web2c/tests/bibtex-openout-test.pl7
5 files changed, 53 insertions, 6 deletions
diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog
index 6306b26897f..c23b8f27322 100644
--- a/Build/source/texk/web2c/ChangeLog
+++ b/Build/source/texk/web2c/ChangeLog
@@ -1,3 +1,9 @@
+2010-03-08 Karl Berry <karl@tug.org>
+
+ * tests/bibtex-openout-test.pl: allow running standalone.
+ * tests/bibtex-longline-test.pl: new test.
+ * am/web.am (web_tests): add it.
+
2010-03-08 Peter Breitenlohner <peb@mppmu.mpg.de>
* mf.ch (end_name, print_file_name): Make quoting of file names
diff --git a/Build/source/texk/web2c/Makefile.in b/Build/source/texk/web2c/Makefile.in
index a16a3ce53c4..f0c6e68cdbd 100644
--- a/Build/source/texk/web2c/Makefile.in
+++ b/Build/source/texk/web2c/Makefile.in
@@ -855,7 +855,8 @@ am__EXEEXT_22 = bibtex.test dvicopy.test dvitype.test gftodvi.test \
gftopk.test gftype.test mft.test patgen.test pktogf.test \
pktype.test pltotf.test pooltype.test tftopl.test vftovp.test \
vptovf.test weave.test
-am__EXEEXT_23 = $(am__EXEEXT_22) tests/bibtex-openout-test.pl
+am__EXEEXT_23 = $(am__EXEEXT_22) tests/bibtex-openout-test.pl \
+ tests/bibtex-longline-test.pl
@WEB_TRUE@am__EXEEXT_24 = $(am__EXEEXT_23)
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -1404,7 +1405,8 @@ ctangleboot_DEPENDENCIES = $(default_dependencies)
web_programs = bibtex dvicopy dvitype gftodvi gftopk gftype mft \
patgen pktogf pktype pltotf pooltype tftopl vftovp vptovf weave
-web_tests = $(web_programs:=.test) tests/bibtex-openout-test.pl
+web_tests = $(web_programs:=.test) tests/bibtex-openout-test.pl \
+ tests/bibtex-longline-test.pl
nodist_bibtex_SOURCES = bibtex.c bibtex.h
nodist_dvicopy_SOURCES = dvicopy.c dvicopy.h
nodist_dvitype_SOURCES = dvitype.c dvitype.h
diff --git a/Build/source/texk/web2c/am/web.am b/Build/source/texk/web2c/am/web.am
index 2f1b7c76acb..462c681d327 100644
--- a/Build/source/texk/web2c/am/web.am
+++ b/Build/source/texk/web2c/am/web.am
@@ -26,7 +26,7 @@ bibtex-web2c: bibtex.p $(web2c_depend) web2c/cvtbib.sed
@$(web2c) bibtex
bibtex.p: tangle$(EXEEXT) bibtex.web bibtex.ch
$(tangle) bibtex bibtex
-web_tests += tests/bibtex-openout-test.pl
+web_tests += tests/bibtex-openout-test.pl tests/bibtex-longline-test.pl
nodist_dvicopy_SOURCES = dvicopy.c dvicopy.h
dvicopy.c dvicopy.h: dvicopy-web2c
diff --git a/Build/source/texk/web2c/tests/bibtex-longline-test.pl b/Build/source/texk/web2c/tests/bibtex-longline-test.pl
new file mode 100755
index 00000000000..d800be2ef93
--- /dev/null
+++ b/Build/source/texk/web2c/tests/bibtex-longline-test.pl
@@ -0,0 +1,38 @@
+#!/usr/bin/env perl
+# $Id: bibtex-openout-test.pl 17085 2010-02-18 18:03:18Z karl $
+# Public domain. Originally written 2010, Karl Berry.
+# Check that bibtex does not break long strings (change in 2010).
+
+# srcdir = web2c (in the source tree)
+BEGIN { chomp ($srcdir = $ENV{"srcdir"} || `cd \`dirname $0\`/.. && pwd`); }
+require "$srcdir/../tests/common-test.pl";
+
+exit (&main ());
+
+sub main
+{
+ # The blg and bbl file names are based on the aux name and cannot be
+ # overridden. We can't write to the aux (source) directory, though,
+ # because that's an absolute path and openout_any=p. Therefore, copy
+ # the input files to our working directory.
+ for my $ext ("aux", "bib") {
+ &test_file_copy ("$srcdir/tests/longline.$ext", "./longline.$ext");
+ }
+
+ # Run BibTeX, quit if it fails.
+ my $ret = &test_run ("./bibtex", "./longline.aux");
+ return 1 if $ret != 0;
+
+ # There should be lines longer than 80 chars in the output.
+ # (In older versions of BibTeX, they are forcibly split, with a %.)
+ local *IN;
+ $IN = "longline.bbl";
+ open (IN) || die "open($IN) failed: $!";
+ while (<IN>) {
+ last if length ($_) >= 80;
+ }
+
+ # We failed if all lines were < 80.
+ my $bad = ! (length $_ >= 80);
+ return $bad;
+}
diff --git a/Build/source/texk/web2c/tests/bibtex-openout-test.pl b/Build/source/texk/web2c/tests/bibtex-openout-test.pl
index 45fd92d1b6f..cc00564e5d3 100755
--- a/Build/source/texk/web2c/tests/bibtex-openout-test.pl
+++ b/Build/source/texk/web2c/tests/bibtex-openout-test.pl
@@ -3,7 +3,8 @@
# Public domain. Originally written 2010, Karl Berry.
# Check that bibtex respects openout_any.
-BEGIN { chomp ($srcdir = $ENV{"srcdir"} || `dirname $0`); }
+# srcdir = web2c (in the source tree)
+BEGIN { chomp ($srcdir = $ENV{"srcdir"} || `cd \`dirname $0\`/.. && pwd`); }
require "$srcdir/../tests/common-test.pl";
exit (&main ());
@@ -12,10 +13,10 @@ sub main
{
$ENV{"openout_any"} = "p"; # should already be in texmf.cnf, but ...
- # .blg open of abs path should fail
+ # .blg open of abs path should fail:
my $ret = &test_run ("./bibtex", "$srcdir/exampl.aux");
- # The test fails if the program succeeded. Ideally we'd grep the output.
+ # The test fails if the program succeeded. Could also check the output.
my $bad = ($ret == 0);
return $bad;
}