1#! /bin/sh
2
3# Copyright (C) 2010-2013 Peter Breitenlohner <tex-live@tug.org>
4# You may freely use, modify and/or distribute this file.
5
6# Using test data from Philipp Lehman <lehman@gmx.net>
7
8test -d ptests || mkdir -p ptests
9
10# Create bib data
11mk_bib () {
12  for i
13  do
14    for j in 0 1 2 3 4 5 6 7 8 9; do
15      for k in 0 1 2 3 4 5 6 7 8 9; do
16        for l in 0 1 2 3 4 5 6 7 8 9; do
17          cat <<EOF
18@Type{key$i$j$k$l,
19  field001	  = {Value 001},
20  field002	  = {Value 002},
21  field003	  = {Value 003},
22  field004	  = {Value 004},
23  field005	  = {Value 005},
24  field006	  = {Value 006},
25  field007	  = {Value 007},
26  field008	  = {Value 008},
27  field009	  = {Value 009},
28  field010	  = {Value 010}
29}
30
31EOF
32        done
33      done
34    done
35  done
36}
37
38# Create aux data
39mk_aux () {
40  cat <<EOF
41\relax
42\citation{*}
43\bibstyle{$1}
44\bibdata{memtest}
45EOF
46}
47
48for t in 1 2 3; do
49
50  mk_aux memdata$t >ptests/memtest$t.aux
51
52  env=
53
54  case $t in
55  1) mk_bib 0 >ptests/memtest.bib;;
56  2) mk_bib 1 >>ptests/memtest.bib;;
57  3) env='ent_str_size=2000 glob_str_size=2000';;
58  esac
59
60  echo "Running memtest$t ..."
61
62  eval $env \
63    TEXMFCNF=$srcdir/../kpathsea \
64    BSTINPUTS=$srcdir/tests \
65    BIBINPUTS=./ptests \
66    ./pbibtex ptests/memtest$t || exit 1
67
68done
69
70