summaryrefslogtreecommitdiff
path: root/ext/pcre/pcrelib/RunTest
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>1999-05-26 21:47:57 +0000
committerAndrey Hristov <andrey@php.net>1999-05-26 21:47:57 +0000
commit66f850e5b7f97bb8b07df7ca0d2a82acf4c239d4 (patch)
tree534d993fe1afe902042082be0457acfcd10bd4f1 /ext/pcre/pcrelib/RunTest
parentd73c63852645a0a4324f24b367dff43b54eada85 (diff)
downloadphp-git-66f850e5b7f97bb8b07df7ca0d2a82acf4c239d4.tar.gz
-Added PCRE library source
-Updated configuration process
Diffstat (limited to 'ext/pcre/pcrelib/RunTest')
-rwxr-xr-xext/pcre/pcrelib/RunTest94
1 files changed, 94 insertions, 0 deletions
diff --git a/ext/pcre/pcrelib/RunTest b/ext/pcre/pcrelib/RunTest
new file mode 100755
index 0000000000..a23c51108f
--- /dev/null
+++ b/ext/pcre/pcrelib/RunTest
@@ -0,0 +1,94 @@
+#! /bin/sh
+
+# Run PCRE tests
+
+cf=diff
+
+# Select which tests to run; if no selection, run all
+
+do1=no
+do2=no
+do3=no
+do4=no
+
+while [ $# -gt 0 ] ; do
+ case $1 in
+ 1) do1=yes;;
+ 2) do2=yes;;
+ 3) do3=yes;;
+ 4) do4=yes;;
+ *) echo "Unknown test number $1"; exit 1;;
+ esac
+ shift
+done
+
+if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no ] ; then
+ do1=yes
+ do2=yes
+ do3=yes
+ do4=yes
+fi
+
+# Primary test, Perl-compatible
+
+if [ $do1 = yes ] ; then
+ echo "Testing main functionality (Perl compatible)"
+ ./pcretest testinput1 testtry
+ if [ $? = 0 ] ; then
+ $cf testtry testoutput1
+ if [ $? != 0 ] ; then exit 1; fi
+ else exit 1
+ fi
+fi
+
+# PCRE tests that are not Perl-compatible - API & error tests, mostly
+
+if [ $do2 = yes ] ; then
+ echo "Testing API and error handling (not Perl compatible)"
+ ./pcretest -i testinput2 testtry
+ if [ $? = 0 ] ; then
+ $cf testtry testoutput2
+ if [ $? != 0 ] ; then exit 1; fi
+ else exit 1
+ fi
+fi
+
+# Additional Perl-compatible tests for Perl 5.005's new features
+
+if [ $do3 = yes ] ; then
+ echo "Testing Perl 5.005 features (Perl 5.005 compatible)"
+ ./pcretest testinput3 testtry
+ if [ $? = 0 ] ; then
+ $cf testtry testoutput3
+ if [ $? != 0 ] ; then exit 1; fi
+ else exit 1
+ fi
+fi
+
+if [ $do1 = yes -a $do2 = yes -a $do3 = yes ] ; then
+ echo "The three main tests all ran OK"
+ echo " "
+fi
+
+# Locale-specific tests, provided the "fr" locale is available
+
+if [ $do4 = yes ] ; then
+ locale -a | grep '^fr$' >/dev/null
+ if [ $? -eq 0 ] ; then
+ echo "Testing locale-specific features (using 'fr' locale)"
+ ./pcretest testinput4 testtry
+ if [ $? = 0 ] ; then
+ $cf testtry testoutput4
+ if [ $? != 0 ] ; then exit 1; fi
+ echo "Locale test ran OK"
+ echo " "
+ else exit 1
+ fi
+ else
+ echo "Cannot test locale-specific features - 'fr' locale not found,"
+ echo "or the \"locale\" command is not available to check for it."
+ echo " "
+ fi
+fi
+
+# End