From: Hartmut Holzgraefe Date: Sun, 3 Dec 2000 10:45:53 +0000 (+0000) Subject: changed run-tests.php to use 'php -q' instead of 'php -f' X-Git-Tag: php-4.0.5RC1~1040 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5f683e7d7857cc458018b5fc8a501ba1f51cfc15;p=php changed run-tests.php to use 'php -q' instead of 'php -f' --- diff --git a/build/rules.mk b/build/rules.mk index 4699e32a50..8459f6c0e6 100644 --- a/build/rules.mk +++ b/build/rules.mk @@ -54,7 +54,7 @@ distclean: distclean-recursive clean-x php_config.h stamp-h Makefile build-defs.h php4.spec libphp4.module test: $(top_builddir)/php - @$(top_builddir)/php -f $(top_srcdir)/run-tests.php `pwd` + @$(top_builddir)/php -q $(top_srcdir)/run-tests.php `pwd` include $(builddir)/.deps diff --git a/run-tests.php b/run-tests.php index 3f90d4251b..00d252ff60 100755 --- a/run-tests.php +++ b/run-tests.php @@ -124,11 +124,11 @@ function do_testing($argc, &$argv) { global $term, $windows_p, $php, $skip, $testdirs, $tmpfile, $opts, $skipped, $failed, $passed, $total, $term_bold, $term_norm; - if ($argc > 0) { - if (is_dir($argv[0])) { - $dir = $argv[0]; + if ($argc > 1) { + if (is_dir($argv[1])) { + $dir = $argv[1]; } else { - for ($i = 0; $i < $argc; $i++) { + for ($i = 1; $i < $argc; $i++) { switch (run_test($argv[$i])) { case TEST_SKIPPED: case TEST_INTERNAL_ERROR: diff --git a/tests/README b/tests/README index b9b0622ecf..3c739c2fa9 100755 --- a/tests/README +++ b/tests/README @@ -2,17 +2,17 @@ PHP Regression Tests ==================== To run the tests, go to the top-level directory and -run "./php -f run-tests.php". +run "./php -q run-tests.php". Without parameters, "run-tests.php" will recursively scan through the file tree looking for directories called "tests", and run all the tests (.phpt files) within (recursively). To run tests in a single directory, pass the directory as a parameter: -"./php -f run-tests.php tests/lang". +"./php -q run-tests.php tests/lang". To run one or more single tests, pass them as parameters: -"./php -f run-tests.php tests/lang/015.phpt". +"./php -q run-tests.php tests/lang/015.phpt". The format of the .phpt files is quite simple. There are 6 possible sections. Test, Skipif, Post, Get, File and Expect. The Test section