source: trunk/third/pcre/RunTest.in @ 19309

Revision 19309, 3.4 KB checked in by ghudson, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r19308, which included commits to RCS files with non-trunk default branches.
  • Property svn:executable set to *
Line 
1#! /bin/sh
2
3# This file is generated by configure from RunTest.in. Make any changes
4# to that file.
5
6# Run PCRE tests
7
8cf=diff
9testdata=@top_srcdir@/testdata
10
11# Select which tests to run; if no selection, run all
12
13do1=no
14do2=no
15do3=no
16do4=no
17do5=no
18do6=no
19
20while [ $# -gt 0 ] ; do
21  case $1 in
22    1) do1=yes;;
23    2) do2=yes;;
24    3) do3=yes;;
25    4) do4=yes;;
26    5) do5=yes;;
27    6) do6=yes;;
28    *) echo "Unknown test number $1"; exit 1;;
29  esac
30  shift
31done
32
33if [ "@UTF8@" = "" ] ; then
34  if [ $do5 = yes ] ; then
35    echo "Can't run test 5 because UFT8 support is not configured"
36    exit 1
37  fi   
38  if [ $do6 = yes ] ; then
39    echo "Can't run test 6 because UFT8 support is not configured"
40    exit 1
41  fi   
42fi   
43
44if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a\
45     $do5 = no -a $do6 = no ] ; then
46  do1=yes
47  do2=yes
48  do3=yes
49  do4=yes
50  if [ "@UTF8@" != "" ] ; then do5=yes; fi
51  if [ "@UTF8@" != "" ] ; then do6=yes; fi
52fi
53
54# Primary test, Perl-compatible
55
56if [ $do1 = yes ] ; then
57  echo "Testing main functionality (Perl compatible)"
58  ./pcretest $testdata/testinput1 testtry
59  if [ $? = 0 ] ; then
60    $cf testtry $testdata/testoutput1
61    if [ $? != 0 ] ; then exit 1; fi
62  else exit 1
63  fi
64fi
65
66# PCRE tests that are not Perl-compatible - API & error tests, mostly
67
68if [ $do2 = yes ] ; then
69  echo "Testing API and error handling (not Perl compatible)"
70  ./pcretest -i $testdata/testinput2 testtry
71  if [ $? = 0 ] ; then
72    $cf testtry $testdata/testoutput2
73    if [ $? != 0 ] ; then exit 1; fi
74  else exit 1
75  fi
76fi
77
78# Additional Perl-compatible tests for Perl 5.005's new features
79
80if [ $do3 = yes ] ; then
81  echo "Testing Perl 5.005 features (Perl 5.005 compatible)"
82  ./pcretest $testdata/testinput3 testtry
83  if [ $? = 0 ] ; then
84    $cf testtry $testdata/testoutput3
85    if [ $? != 0 ] ; then exit 1; fi
86  else exit 1
87  fi
88fi
89
90if [ $do1 = yes -a $do2 = yes -a $do3 = yes ] ; then
91  echo " "
92  echo "The three main tests all ran OK"
93  echo " "
94fi
95
96# Locale-specific tests, provided the "fr" locale is available
97
98if [ $do4 = yes ] ; then
99  locale -a | grep '^fr$' >/dev/null
100  if [ $? -eq 0 ] ; then
101    echo "Testing locale-specific features (using 'fr' locale)"
102    ./pcretest $testdata/testinput4 testtry
103    if [ $? = 0 ] ; then
104      $cf testtry $testdata/testoutput4
105      if [ $? != 0 ] ; then
106        echo " "
107        echo "Locale test did not run entirely successfully."
108        echo "This usually means that there is a problem with the locale"
109        echo "settings rather than a bug in PCRE."   
110      else
111      echo "Locale test ran OK"
112      fi
113      echo " "
114    else exit 1
115    fi
116  else
117    echo "Cannot test locale-specific features - 'fr' locale not found,"
118    echo "or the \"locale\" command is not available to check for it."
119    echo " "
120  fi
121fi
122
123# Additional tests for UTF8 support
124
125if [ $do5 = yes ] ; then
126  echo "Testing experimental, incomplete UTF8 support (Perl compatible)"
127  ./pcretest $testdata/testinput5 testtry
128  if [ $? = 0 ] ; then
129    $cf testtry $testdata/testoutput5
130    if [ $? != 0 ] ; then exit 1; fi
131  else exit 1
132  fi
133  echo "UTF8 test ran OK"
134  echo " "
135fi
136
137if [ $do6 = yes ] ; then
138  echo "Testing API and internals for UTF8 support (not Perl compatible)"
139  ./pcretest $testdata/testinput6 testtry
140  if [ $? = 0 ] ; then
141    $cf testtry $testdata/testoutput6
142    if [ $? != 0 ] ; then exit 1; fi
143  else exit 1
144  fi
145  echo "UTF8 internals test ran OK"
146  echo " "
147fi
148
149# End
Note: See TracBrowser for help on using the repository browser.