php 官方自动化测试方法 发表于 2019-05-09 ├── Makefile├── phpt│ └── test.phpt└── run-tests.php Makefile文件 123456789101112131415161718192021222324252627282930313233base_dir=./top_builddir=${base_dir}top_srcdir=${base_dir}TESTS=${base_dir}/phpt#PHP_EXECUTABLE=/usr/local/php/bin/phpPHP_EXECUTABLE=/usr/bin/phpEGREP = /bin/grep -ECC = ccPHP_TEST_SETTINGS = -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1'all: @echo @echo "You should run 'make test'." @echotest: -@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \ INI_FILE=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r 'echo php_ini_loaded_file();' 2> /dev/null`; \ if test "$$INI_FILE"; then \ cp "$$INI_FILE" $(top_builddir)/tmp-php.ini; \ else \ echo > $(top_builddir)/tmp-php.ini; \ fi; \ TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \ CC="$(CC)" \ $(PHP_EXECUTABLE) -n -c $(top_builddir)/tmp-php.ini $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -n -c $(top_builddir)/tmp-php.ini $(TESTS); \ rm $(top_builddir)/tmp-php.ini; \ else \ echo "ERROR: Cannot run tests without CLI sapi."; \ fi.PHONY: all test 参考