]> granicus.if.org Git - php/commitdiff
* the beginning of a regression testing framework?
authorStig Bakken <ssb@php.net>
Tue, 25 Jul 2000 00:55:37 +0000 (00:55 +0000)
committerStig Bakken <ssb@php.net>
Tue, 25 Jul 2000 00:55:37 +0000 (00:55 +0000)
pear/package.dtd [new file with mode: 0644]
pear/run-tests.in [new file with mode: 0755]
pear/tests/PEAR.r [new file with mode: 0644]
pear/tests/PEAR.t [new file with mode: 0644]
pear/tests/php.ini [new file with mode: 0644]

diff --git a/pear/package.dtd b/pear/package.dtd
new file mode 100644 (file)
index 0000000..cb1f7b0
--- /dev/null
@@ -0,0 +1,113 @@
+<!--
+     $Id: package.dtd,v 1.1 2000-07-25 00:55:36 ssb Exp $
+
+     This is the PEAR package description, version 1.0.
+     It should be used with the informal public identifier:
+
+         "-//PHP Group//DTD PEAR Package 1.0//EN//XML"
+
+     Using XML namespaces is optional, but the namespace that should
+     be used for this DTD is:
+
+         "http://xmlns.php.net/pear/package".
+
+     Copyright (c) 1997, 1998, 1999, 2000 The PHP Group
+
+     This source file is subject to version 2.02 of the PHP license,
+     that is bundled with this package in the file LICENSE, and is
+     available at through the world-wide-web at
+     http://www.php.net/license/2_02.txt.
+     If you did not receive a copy of the PHP license and are unable to
+     obtain it through the world-wide-web, please send a note to
+     license@php.net so we can mail you a copy immediately.
+
+     Authors:
+         Stig S. Bakken <ssb@fast.no>
+
+  -->
+
+<!--============== attributes present in all elements ======================-->
+<!ENTITY % global.atts         "id             ID      #IMPLIED">
+
+<!--============== attributes common to several elements ===================-->
+<!ENTITY % extension.atts      "Debug          (on|off) 'off'
+                                ThreadSafe     (on|off) 'off'">
+<!ENTITY % format.atts         "Format         CDATA   #REQUIRED">
+
+<!--=============== ELEMENT: Package =======================================-->
+<!ELEMENT Package              (Name,Summary,Maintainer,Release,FileList)>
+<!ATTLIST Package              %global.atts;
+                               Type            (Source|Binary) 'Binary'>
+
+<!--=============== ELEMENT: Name ==========================================-->
+<!ELEMENT Name                 (#PCDATA)>
+<!ATTLIST Name                 %global.atts;>
+
+<!--=============== ELEMENT: Summary =======================================-->
+<!ELEMENT Summary              (#PCDATA)>
+<!ATTLIST Summary              %global.atts;>
+
+<!--=============== ELEMENT: Maintainer ====================================-->
+<!ELEMENT Maintainer           (Initials,Name,Email)>
+<!ATTLIST Maintainer           %global.atts;>
+
+<!--=============== ELEMENT: Initials ======================================-->
+<!ELEMENT Initials             (#PCDATA)>
+<!ATTLIST Initials             %global.atts;>
+
+<!--=============== ELEMENT: Email =========================================-->
+<!ELEMENT Email                        (#PCDATA)>
+<!ATTLIST Email                        %global.atts;>
+
+<!--=============== ELEMENT: Release =======================================-->
+<!ELEMENT Release              (Version,Date,Notes?)>
+<!ATTLIST Release              %global.atts;>
+
+<!--=============== ELEMENT: Version =======================================-->
+<!ELEMENT Version              (#PCDATA)>
+<!ATTLIST Version              %global.atts;>
+
+<!--=============== ELEMENT: Date =========================================-->
+<!ELEMENT Date                 (#PCDATA)>
+<!ATTLIST Date                 %global.atts;>
+
+<!--=============== ELEMENT: Notes =========================================-->
+<!ELEMENT Notes                        (#PCDATA)>
+<!ATTLIST Notes                        %global.atts;>
+
+<!--=============== ELEMENT: FileList ======================================-->
+<!ELEMENT FileList             (DestDir |
+                                Dir     | File     |
+                                ExtDir  | ExtFile  |
+                                DocDir  | DocFile)*>
+<!ATTLIST FileList             %global.atts;>
+
+<!--=============== ELEMENT: DestDir =======================================-->
+<!ELEMENT DestDir              (#PCDATA)>
+<!ATTLIST DestDir              %global.atts;>
+
+<!--=============== ELEMENT: Dir ===========================================-->
+<!ELEMENT Dir                  (#PCDATA)>
+<!ATTLIST Dir                  %global.atts;>
+
+<!--=============== ELEMENT: File ==========================================-->
+<!ELEMENT File                 (#PCDATA)>
+<!ATTLIST File                 %global.atts;>
+
+<!--=============== ELEMENT: ExtDir ========================================-->
+<!ELEMENT ExtDir               (#PCDATA)>
+<!ATTLIST ExtDir               %global.atts;>
+
+<!--=============== ELEMENT: ExtFile =======================================-->
+<!ELEMENT ExtFile              (#PCDATA)>
+<!ATTLIST ExtFile              %global.atts;
+                               %extension.atts;>
+
+<!--=============== ELEMENT: DocDir ========================================-->
+<!ELEMENT DocDir               (#PCDATA)>
+<!ATTLIST DocDir               %global.atts;>
+
+<!--=============== ELEMENT: DocFile =======================================-->
+<!ELEMENT DocFile              (#PCDATA)>
+<!ATTLIST DocFile              %global.atts;
+                               %format.atts;>
diff --git a/pear/run-tests.in b/pear/run-tests.in
new file mode 100755 (executable)
index 0000000..4710a10
--- /dev/null
@@ -0,0 +1,47 @@
+#!@prefix@/bin/php
+<?php // -*- C++ -*-
+
+$prefix = "@prefix@";
+$bindir = "@prefix@/bin";
+$php = "$bindir/php";
+$installdir = '@PEAR_INSTALLDIR@';
+$extdir = '@EXTENSION_DIR@';
+$abs_srcdir = '@abs_srcdir@/pear';
+
+$incpath = ".:$abs_srcdir/pear/tests:$abs_srcdir/pear/tests";
+
+$start = "*";
+print "argc=$argc\n";
+if ($argc > 1) {
+    $start = implode(" ", $argv);
+}
+$fp = popen("find $start -name tests -type d -print", "r");
+if (!$fp) {
+    die("Could not run find!\n");
+}
+while ($dir = trim(fgets($fp, 1024))) {
+    print "dir=$dir\n";
+    $dp = opendir($dir);
+    while ($ent = readdir($dp)) {
+       if (substr($ent, -2) != ".t") {
+           continue;
+       }
+       $res = "$dir/".substr($ent, 0, -1) . 'r';
+       $out = "$dir/".substr($ent, 0, -1) . 'o';
+       $cmd = ("$php -d include_path=$incpath -d auto_prepend_file=none ".
+               "-f $dir/$ent | tee $out | cmp -s $res -");
+       print "cmd=$cmd\n";
+       $err = 0;
+       system($cmd, &$err);
+       print "$dir/$ent: ";
+       if ($err) {
+           print "failed\n";
+       } else {
+           print "passed\n";
+       }
+    }
+    closedir($dp);
+}
+pclose($fp);
+
+?>
diff --git a/pear/tests/PEAR.r b/pear/tests/PEAR.r
new file mode 100644 (file)
index 0000000..0bcaa95
--- /dev/null
@@ -0,0 +1 @@
+int(0)
diff --git a/pear/tests/PEAR.t b/pear/tests/PEAR.t
new file mode 100644 (file)
index 0000000..11df9b8
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+
+require "PEAR.php";
+
+$err = new PEAR_Error;
+var_dump(PEAR::isError($err));
+
+?>
\ No newline at end of file
diff --git a/pear/tests/php.ini b/pear/tests/php.ini
new file mode 100644 (file)
index 0000000..c75c9b4
--- /dev/null
@@ -0,0 +1,2 @@
+; php.ini for PEAR tests
+include_path=..