[PHP-CVS] cvs: php4 / run-tests.php /build rules.mk

2001-04-16 Thread Stig Bakken

ssb Mon Apr 16 16:28:58 2001 EDT

  Modified files:  
/php4   run-tests.php 
/php4/build rules.mk 
  Log:
  * using CGI -C option, you no longer have to specify "full" path to tests
  
  
Index: php4/run-tests.php
diff -u php4/run-tests.php:1.22 php4/run-tests.php:1.23
--- php4/run-tests.php:1.22 Thu Mar 29 04:07:37 2001
+++ php4/run-tests.php  Mon Apr 16 16:28:57 2001
@@ -127,7 +127,7 @@
 $term_bold = $term_norm = "";
 }
 
-$windows_p = (substr(php_uname(), 0, 7) == "Windows");
+$windows_p = (substr(PHP_OS, 0, 3) == "WIN");
 if ($windows_p) {
 if (file_exists('Release_TS_inline\\php.exe')) {
 $php = 'Release_TS_inline\\php.exe';
@@ -137,8 +137,11 @@
 $php=trim($windows_p ? `cd`:`pwd`).'\\php';
 }
 } else {
-// $php = $GLOBALS["TOP_BUILDDIR"]."/php"; // where should be the origin of 
this variable
-$php=trim(`pwd`).'/php';
+if (isset($GLOBALS["TOP_BUILDDIR"])) {
+$php = $GLOBALS["TOP_BUILDDIR"]."/php";
+} else {
+$php = getcwd() . '/php';
+}
 }
 
 create_compiled_in_modules_list();
Index: php4/build/rules.mk
diff -u php4/build/rules.mk:1.30 php4/build/rules.mk:1.31
--- php4/build/rules.mk:1.30Sun Dec 24 08:03:16 2000
+++ php4/build/rules.mk Mon Apr 16 16:28:58 2001
@@ -14,7 +14,7 @@
 #  | Authors: Sascha Schumann [EMAIL PROTECTED]|
 #  +--+
 #
-# $Id: rules.mk,v 1.30 2000/12/24 16:03:16 sas Exp $ 
+# $Id: rules.mk,v 1.31 2001/04/16 23:28:58 ssb Exp $ 
 #
 
 include $(top_srcdir)/build/rules_common.mk
@@ -55,9 +55,9 @@
 
 test: $(top_builddir)/php
@if test "$(TESTS)" = ""; then \
-   TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) 
$(top_builddir)/php -d 
"include_path=.:$(top_srcdir)/pear:$(top_builddir)/pear:$(PEAR_INSTALLDIR)" -q 
$(top_srcdir)/run-tests.php $(srcdir); \
+   TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) 
+$(top_builddir)/php -C -q $(top_srcdir)/run-tests.php $(srcdir); \
else \
-   TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) 
$(top_builddir)/php -d 
include_path=".:$(top_srcdir)/pear:$(top_builddir)/pear:$(PEAR_INSTALLDIR)" -q 
$(top_srcdir)/run-tests.php $(TESTS); \
+   TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) 
+$(top_builddir)/php -C -q $(top_srcdir)/run-tests.php $(TESTS); \
fi
 
 include $(builddir)/.deps



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 / run-tests.php

2001-03-29 Thread James Moore

jmoore  Thu Mar 29 04:07:38 2001 EDT

  Modified files:  
/php4   run-tests.php 
  Log:
  Output php version at end of tests.
  
Index: php4/run-tests.php
diff -u php4/run-tests.php:1.21 php4/run-tests.php:1.22
--- php4/run-tests.php:1.21 Wed Mar 21 08:01:52 2001
+++ php4/run-tests.php  Thu Mar 29 04:07:37 2001
@@ -245,7 +245,7 @@
 dowriteln(sprintf("Tests passed: %4d (%s%%)", $passed, $passed_pstr));
 dowriteln("=");
 dowriteln("Skipped ".sizeof($skipped_extensions)." extensions.");
-
+dowriteln("PHP Version: ".phpversion());
 }
 
 function find_testdirs($dir = '.', $first_pass = true)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 / run-tests.php

2001-03-21 Thread André Langhorst

andre   Wed Mar 21 04:52:33 2001 EDT

  Modified files:  
/php4   run-tests.php 
  Log:
  win32 fixes again
  
Index: php4/run-tests.php
diff -u php4/run-tests.php:1.18 php4/run-tests.php:1.19
--- php4/run-tests.php:1.18 Tue Mar 20 22:33:00 2001
+++ php4/run-tests.php  Wed Mar 21 04:52:32 2001
@@ -25,7 +25,6 @@
  * - do not test PEAR components if base class and/or component class cannot be 
instanciated
  */
 
-set_time_limit(0);
 ob_implicit_flush();
 
 define('TEST_PASSED', 0);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 / run-tests.php

2001-03-21 Thread André Langhorst

andre   Wed Mar 21 05:00:34 2001 EDT

  Modified files:  
/php4   run-tests.php 
  Log:
  fighting against the cvs client, it does not want to let the win32 binary safe 
change go in...
  
Index: php4/run-tests.php
diff -u php4/run-tests.php:1.19 php4/run-tests.php:1.20
--- php4/run-tests.php:1.19 Wed Mar 21 04:52:32 2001
+++ php4/run-tests.php  Wed Mar 21 05:00:33 2001
@@ -72,14 +72,10 @@
 dowrite("$str\n");
 }
 
-// use this function to consistently work with '/' divided dirs instead of '\' 
divided ones
-function win_safe_path($str)  {
-$str=str_replace('\\','/',$str);
-}
-
 function create_compiled_in_modules_list()  {
 global $php,$compiled_in_modules;
 $ret=`$php -m`;
+   
 $compiled_in_modules=explode("\n",$ret);
 foreach ($compiled_in_modules AS $key = $value) {
 if (!$value
@@ -133,19 +129,18 @@
 
 $windows_p = (substr(php_uname(), 0, 7) == "Windows");
 if ($windows_p) {
-if (file_exists('Release_TS_inline/php.exe')) {
-$php = 'Release_TS_inline\php.exe';
-} elseif (file_exists('Release_TS/php.exe')) {
-$php = 'Release_TS\php.exe';
+if (file_exists('Release_TS_inline\\php.exe')) {
+$php = 'Release_TS_inline\\php.exe';
+} elseif (file_exists('Release_TS\\php.exe')) {
+$php = 'Release_TS\\php.exe';
 } else {
-$php=trim($windows_p ? `cd`:`pwd`).'/php';
-win_safe_path($php);
+$php=trim($windows_p ? `cd`:`pwd`).'\\php';
 }
 } else {
 // $php = $GLOBALS["TOP_BUILDDIR"]."/php"; // where should be the origin of 
this variable
-$php=trim($windows_p ? `cd`:`pwd`).'/php';
-win_safe_path($php);
+$php=trim(`pwd`).'/php';
 }
+
 create_compiled_in_modules_list();

 if (!is_executable($php)) {
@@ -384,14 +379,16 @@
 while (!(feof($fp1) || feof($fp2))) {
 if (!feof($fp1)  trim($line1 = fgets($fp1, 10240)) != "") {
 //print "adding line1 $line1\n";
-$data1 .= $line1;
+   
+$data1 .= trim($line1);
 }
 if (!feof($fp2)  trim($line2 = fgets($fp2, 10240)) != "") {
 //print "adding line2 $line2\n";
-$data2 .= $line2;
+
+$data2 .= trim($line2);
 }
 }
-   
+   echo strlen($data1).'|'.strlen($data2);
 fclose($fp1);
 fclose($fp2);
 if ((trim($data1) != trim($data2))
@@ -414,15 +411,14 @@
 return TEST_INTERNAL_ERROR;
 }
 $tmpdir = dirname($file);
-win_safe_path($tmpdir);
 $tmpfix = "phpt.";
 $tmpfile["FILE"] = tempnam($tmpdir, $tmpfix);
 $tmpfile["SKIPIF"] = tempnam($tmpdir, $tmpfix);
 $tmpfile["POST"] = tempnam($tmpdir, $tmpfix);
+   
 $tmpfile["EXPECT"] = tempnam($tmpdir, $tmpfix);
 $tmpfile["OUTPUT"] = tempnam($tmpdir, $tmpfix);
 
-array_walk($tmpfile,'win_safe_path');
 
 while ($line = fgets($fp, 4096)) {
 if (preg_match('/^--([A-Z]+)--/', $line, $matches)) {
@@ -489,6 +485,8 @@
 putenv("CONTENT_LENGTH=");
 }
 if (isset($fps["POST"])) {
+   
+// XXX Fix me, I do not work on win32 (?)
 $cmd = "$php -q $tmpfile[FILE]  $tmpfile[POST]";
 } else {
 $cmd = "$php -q $tmpfile[FILE]";
@@ -499,6 +497,7 @@
 delete_tmpfiles();
 return TEST_INTERNAL_ERROR;
 }
+//echo $cmd;
 $cp = popen($cmd, "r");
 if (!$cp) {
 dowriteln("Error: could not execute: $cmd");



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-CVS] cvs: php4 / run-tests.php

2001-03-21 Thread Thies C. Arntzen

On Wed, Mar 21, 2001 at 12:52:33PM -, Andr Langhorst wrote:
 andre Wed Mar 21 04:52:33 2001 EDT
 
   Modified files:  
 /php4 run-tests.php 
   Log:
   win32 fixes again
   
 Index: php4/run-tests.php
 diff -u php4/run-tests.php:1.18 php4/run-tests.php:1.19
 --- php4/run-tests.php:1.18   Tue Mar 20 22:33:00 2001
 +++ php4/run-tests.phpWed Mar 21 04:52:32 2001
 @@ -25,7 +25,6 @@
   * - do not test PEAR components if base class and/or component class cannot be 
instanciated
   */
  
 -set_time_limit(0);

out of curiousity - why is removing set_time_limit(0) needed?

tc

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 / run-tests.php

2001-03-21 Thread André Langhorst

andre   Wed Mar 21 08:01:53 2001 EDT

  Modified files:  
/php4   run-tests.php 
  Log:
  I don't like to commit this over and over either, but this client definitely seems 
to dislike branches
  
Index: php4/run-tests.php
diff -u php4/run-tests.php:1.20 php4/run-tests.php:1.21
--- php4/run-tests.php:1.20 Wed Mar 21 05:00:33 2001
+++ php4/run-tests.php  Wed Mar 21 08:01:52 2001
@@ -388,7 +388,6 @@
 $data2 .= trim($line2);
 }
 }
-   echo strlen($data1).'|'.strlen($data2);
 fclose($fp1);
 fclose($fp2);
 if ((trim($data1) != trim($data2))



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-CVS] cvs: php4 / run-tests.php

2001-03-21 Thread André Langhorst

   run-tests.php will still need more than 30 seconds (default) on some
 systems. If not now, then when more tests are added, etc.
 
   IMHO it should be in there.

ok. maybe a good idea to put it there, but set_time_limit(900) will be 
sufficient

andr

-- 
 Andr Langhorstt: +49 331 5811560 
 [EMAIL PROTECTED]  m: +49 173 9558736 
* PHP Quality Assurance  http://qa.php.net  *


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 / run-tests.php

2001-03-20 Thread André Langhorst

andre   Tue Mar 20 22:04:37 2001 EDT

  Modified files:  
/php4   run-tests.php 
  Log:
  1) fixed tests on *both* win32+linux
  2) made tests more sophisticated (checking against compiled in modules)
  3) minor changes
  4) win32 improvements 
  

Index: php4/run-tests.php
diff -u php4/run-tests.php:1.16 php4/run-tests.php:1.17
--- php4/run-tests.php:1.16 Sun Feb 25 22:06:47 2001
+++ php4/run-tests.php  Tue Mar 20 22:04:36 2001
@@ -21,6 +21,8 @@
 /*
  * TODO:
  * - look for test-specific php.ini files
+ * - implement module skipping for PEAR
+ * - do not test PEAR components if base class and/or component class cannot be 
+instanciated
  */
 
 ob_implicit_flush();
@@ -30,6 +32,9 @@
 define('TEST_SKIPPED', -2);
 define('TEST_INTERNAL_ERROR', -3);
 
+define('EXT_DIR_NAME','/php4/ext/');
+define('EXT_DIR_NAME_LEN',strlen(EXT_DIR_NAME));
+
 initialize();
 /*
 $opts = parse_options($argc, $argv);
@@ -67,6 +72,47 @@
 dowrite("$str\n");
 }
 
+// use this function to consistently work with '/' divided dirs instead of '\' 
+divided ones
+function win_safe_path($str)  {
+$str=str_replace('\\','/',$str);
+}
+
+function create_compiled_in_modules_list()  {
+global $php,$compiled_in_modules;
+$ret=`$php -m`;
+$compiled_in_modules=explode("\n",$ret);
+foreach ($compiled_in_modules AS $key = $value) {
+if (!$value
+|| strchr($value,' ') )unset($compiled_in_modules[$key]);
+}
+
+}
+
+function extract_module_name_from_path($path)   {
+if ($pos1=strpos($path,EXT_DIR_NAME)) {
+   $pos3=strpos($path,'/',$pos1+EXT_DIR_NAME_LEN);
+   return substr($path,$pos2=$pos1+EXT_DIR_NAME_LEN,$pos3-$pos2);
+}
+}
+
+
+function create_found_tests_4_modules_list() {
+   global $modules_2_test,$testdirs;
+
+   foreach ($testdirs AS $path) {
+   if ($mod_name=extract_module_name_from_path($path))
+   $modules_2_test[$mod_name]=TRUE;
+   }
+}
+
+function create_modules_2_test_list() {
+global $compiled_in_modules,$modules_2_test,$modules_available;
+foreach ($compiled_in_modules AS $value)
+if ($modules_2_test[$value]) $modules_available[]=$value;
+}
+
+
+
 function initialize()
 {
 global $term, $windows_p, $php, $skip, $testdirs, $tmpfile,
@@ -92,14 +138,18 @@
 } elseif (file_exists('Release_TS/php.exe')) {
 $php = 'Release_TS\php.exe';
 } else {
-$php = "./php.exe";
+$php=trim($windows_p ? `cd`:`pwd`).'/php';
+win_safe_path($php);
 }
 } else {
-$php = $GLOBALS["TOP_BUILDDIR"]."/php";
+// $php = $GLOBALS["TOP_BUILDDIR"]."/php"; // where should be the origin of 
+this variable
+$php=trim($windows_p ? `cd`:`pwd`).'/php';
+win_safe_path($php);
 }
-
+create_compiled_in_modules_list();
+   
 if (!is_executable($php)) {
-dowriteln("PHP CGI binary ($php) not executable.");
+dowriteln("PHP CGI binary ($php) is not executable.");
 dowriteln("Please compile PHP as a CGI executable and try again.");
 exit;
 }
@@ -139,7 +189,7 @@
 function do_testing($argc, $argv)
 {
 global $term, $windows_p, $php, $skip, $testdirs, $tmpfile, $opts,
-$skipped, $failed, $passed, $total, $term_bold, $term_norm;
+$skipped, $failed, $passed, $total, $term_bold, $term_norm, 
+$skipped_extensions;
 
 if ($argc  1) {
 if (is_dir($argv[1])) {
@@ -162,11 +212,15 @@
 }
 }
 } else {
-$dir = $GLOBALS["TOP_SRCDIR"];
+// $dir = $GLOBALS["TOP_SRCDIR"]; // XXX ??? where should this variable be 
+set?
+$dir=str_replace('\\','/',trim(($windows_p ? `cd`:`pwd`)));
 }
-
 if (isset($dir)  $dir) {
 find_testdirs($dir);
+
+create_found_tests_4_modules_list();
+create_modules_2_test_list();
+
 for ($i = 0; $i  sizeof($testdirs); $i++) {
 run_tests_in_dir($testdirs[$i]);
 }
@@ -194,6 +248,9 @@
 dowriteln(sprintf("Tests skipped:%4d (%s%%)", $skipped, $skipped_pstr));
 dowriteln(sprintf("Tests failed: %4d (%s%%)", $failed, $failed_pstr));
 dowriteln(sprintf("Tests passed: %4d (%s%%)", $passed, $passed_pstr));
+dowriteln("=");
+dowriteln("Skipped ".sizeof($skipped_extensions)." extensions.");
+
 }
 
 function find_testdirs($dir = '.', $first_pass = true)
@@ -210,20 +267,27 @@
 }
 while ($ent = readdir($dp)) {
 $path = "$dir/$ent";
-if ((isset($skip[$ent])  $skip[$ent]) || substr($ent, 0, 1) == "." || 
!is_dir($path)) {
+
+if ((isset($skip[$ent])  $skip[$ent])
+|| substr($ent, 0, 1) == "."
+|| !is_dir($path)
+
+) {
 continue;
-}
+}
+  
 if (strstr("/$path/", "/tests/")) {
 $testdirs[] = $path;
 }
 find_testdirs($path, false);

[PHP-CVS] cvs: php4 / run-tests.php

2001-03-20 Thread Sebastian Bergmann

sbergmann   Tue Mar 20 22:33:00 2001 EDT

  Modified files:  
/php4   run-tests.php 
  Log:
  Disable maximum execution time for tests.
  
Index: php4/run-tests.php
diff -u php4/run-tests.php:1.17 php4/run-tests.php:1.18
--- php4/run-tests.php:1.17 Tue Mar 20 22:04:36 2001
+++ php4/run-tests.php  Tue Mar 20 22:33:00 2001
@@ -25,6 +25,7 @@
  * - do not test PEAR components if base class and/or component class cannot be 
instanciated
  */
 
+set_time_limit(0);
 ob_implicit_flush();
 
 define('TEST_PASSED', 0);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]