From e0b531d5f47ac36cb300e8069f336fb5c87d0c3c Mon Sep 17 00:00:00 2001 From: Stig Bakken Date: Tue, 25 Jul 2000 00:55:37 +0000 Subject: [PATCH] * the beginning of a regression testing framework? --- pear/package.dtd | 113 +++++++++++++++++++++++++++++++++++++++++++++ pear/run-tests.in | 47 +++++++++++++++++++ pear/tests/PEAR.r | 1 + pear/tests/PEAR.t | 8 ++++ pear/tests/php.ini | 2 + 5 files changed, 171 insertions(+) create mode 100644 pear/package.dtd create mode 100755 pear/run-tests.in create mode 100644 pear/tests/PEAR.r create mode 100644 pear/tests/PEAR.t create mode 100644 pear/tests/php.ini diff --git a/pear/package.dtd b/pear/package.dtd new file mode 100644 index 0000000000..cb1f7b0dea --- /dev/null +++ b/pear/package.dtd @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pear/run-tests.in b/pear/run-tests.in new file mode 100755 index 0000000000..4710a10878 --- /dev/null +++ b/pear/run-tests.in @@ -0,0 +1,47 @@ +#!@prefix@/bin/php + 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 index 0000000000..0bcaa956f5 --- /dev/null +++ b/pear/tests/PEAR.r @@ -0,0 +1 @@ +int(0) diff --git a/pear/tests/PEAR.t b/pear/tests/PEAR.t new file mode 100644 index 0000000000..11df9b8178 --- /dev/null +++ b/pear/tests/PEAR.t @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/pear/tests/php.ini b/pear/tests/php.ini new file mode 100644 index 0000000000..c75c9b4f11 --- /dev/null +++ b/pear/tests/php.ini @@ -0,0 +1,2 @@ +; php.ini for PEAR tests +include_path=.. -- 2.50.1