summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2016-10-29 02:27:13 +0200
committerAnatol Belski <ab@php.net>2016-10-29 02:27:13 +0200
commit9112e29890af32f6916e18d30894c1e0123ca0ef (patch)
treeb7da0ee2ecbb7dfd7b641dedea16a282c9cc9b14 /win32
parent1667acbf7208b1eb3fc708f2f1eee6b356bf605d (diff)
parent3f35078857df0474daba0812307576b2b47e6922 (diff)
downloadphp-git-9112e29890af32f6916e18d30894c1e0123ca0ef.tar.gz
Merge branch 'PHP-7.1'
* PHP-7.1: generate test ini file, so shared exts are loaded for nmake test additional env is generated for phpize, too
Diffstat (limited to 'win32')
-rw-r--r--win32/build/Makefile5
-rw-r--r--win32/build/Makefile.phpize2
-rw-r--r--win32/build/config.w327
-rw-r--r--win32/build/confutils.js68
4 files changed, 81 insertions, 1 deletions
diff --git a/win32/build/Makefile b/win32/build/Makefile
index 813d92a086..a46dfe4375 100644
--- a/win32/build/Makefile
+++ b/win32/build/Makefile
@@ -151,8 +151,13 @@ clean-pgo: clean-all
-del /f /q $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip
-del /f /q $(BUILD_DIR)\php-test-pack-$(PHP_VERSION_STRING).zip
+!if $(PHP_TEST_INI_PATH) == ""
test: set-test-env
"$(BUILD_DIR)\php.exe" -d open_basedir= -d output_buffering=0 run-tests.php $(TESTS) -p "$(BUILD_DIR)\php.exe"
+!else
+test: set-test-env
+ "$(BUILD_DIR)\php.exe" -c $(PHP_TEST_INI_PATH) -d open_basedir= -d output_buffering=0 run-tests.php $(TESTS) -p "$(BUILD_DIR)\php.exe"
+!endif
build-snap: generated_files
SET PATH=$(PATH);$(PHP_BUILD)\bin
diff --git a/win32/build/Makefile.phpize b/win32/build/Makefile.phpize
index d3b89c9195..d07ba2fc76 100644
--- a/win32/build/Makefile.phpize
+++ b/win32/build/Makefile.phpize
@@ -34,7 +34,7 @@ _EXTENSION_DLL=$(PECL_TARGETS)
_EXTENSION_DLL=$(EXT_TARGETS)
!endif
-test:
+test: set-test-env
"$(PHP_PREFIX)\php.exe" -d open_basedir= -d output_buffering=0 run-tests.php $(TESTS) -p "$(PHP_PREFIX)\php.exe" -d extension=$(BUILD_DIR)\$(_EXTENSION_DLL)
!if $(MT) == ""
diff --git a/win32/build/config.w32 b/win32/build/config.w32
index c727cf8081..188c1dc9e2 100644
--- a/win32/build/config.w32
+++ b/win32/build/config.w32
@@ -303,3 +303,10 @@ ARG_WITH("all-shared", "Force all the non obligatory extensions to be shared", "
//
// Note, nice as a name is disallowed and will generate a warning and skip saving
ARG_WITH('config-profile', 'Name of the configuration profile to save this to in php-src/config.name.bat', 'no');
+
+ARG_ENABLE("test-ini", "Enable automatic php.ini generation. The test.ini will be put \
+ into the build dir and used to automatically load the shared extensions.", "yes");
+
+ARG_WITH("test-ini-ext-exclude", "Comma separated list of shared extensions to \
+ be excluded from the test.ini", "no");
+
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index 451954406f..dcf71aa24f 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -38,6 +38,11 @@ var CLANGVERS = -1;
var INTELVERS = -1;
var COMPILER_NUMERIC_VERSION = -1;
var COMPILER_NAME = "unknown";
+var PHP_OBJECT_OUT_DIR = "";
+
+var PHP_TEST_INI_PATH = "";
+var PHP_TEST_INI = "";
+var PHP_TEST_INI_EXT_EXCLUDE = "";
var WINVER = "0x0600"; /* Vista */
@@ -1824,6 +1829,60 @@ function write_summary()
STDOUT.WriteBlankLines(2);
}
+function is_on_exclude_list_for_test_ini(list, name)
+{
+ for (var i in list) {
+ if (name == list[i]) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+function generate_test_php_ini()
+{
+ if ("no" == PHP_TEST_INI) {
+ /* Test ini generation is disabled. */
+ return;
+ }
+
+ var ini_dir = PHP_OBJECT_OUT_DIR + ("yes" == PHP_DEBUG ? "Debug" : "Release") + (PHP_ZTS ? "_TS" : "");
+ PHP_TEST_INI_PATH = ini_dir + "\\test.ini";
+
+ if (FSO.FileExists(PHP_TEST_INI_PATH)) {
+ STDOUT.WriteLine("Generating " + PHP_TEST_INI_PATH + " ...");
+ var INI = FSO.OpenTextFile(PHP_TEST_INI_PATH, 2);
+ } else {
+ STDOUT.WriteLine("Regenerating " + PHP_TEST_INI_PATH + " ...");
+ var INI = FSO.CreateTextFile(PHP_TEST_INI_PATH, true);
+ }
+
+ var ext_list = PHP_TEST_INI_EXT_EXCLUDE.split(",");
+ INI.WriteLine("extension_dir=" + ini_dir);
+ for (var i in extensions_enabled) {
+ if ("shared" != extensions_enabled[i][1]) {
+ continue;
+ }
+
+ var directive = "extension";
+ if ("opcache" == extensions_enabled[i][0]) {
+ directive = "zend_extension";
+ }
+
+ var ext_name = extensions_enabled[i][0];
+ if ("gd" == ext_name) {
+ ext_name = "gd2";
+ }
+
+ if (!is_on_exclude_list_for_test_ini(ext_list, ext_name)) {
+ INI.WriteLine(directive + "=php_" + ext_name + ".dll");
+ }
+ }
+
+ INI.Close();;
+}
+
function generate_files()
{
var i, dir, bd, last;
@@ -1858,6 +1917,9 @@ function generate_files()
}
STDOUT.WriteLine("Generating files...");
+ if (!MODE_PHPIZE) {
+ generate_test_php_ini();
+ }
generate_makefile();
if (!MODE_PHPIZE) {
generate_internal_functions();
@@ -2287,6 +2349,12 @@ function generate_makefile()
handle_analyzer_makefile_flags(MF, keys[i], val);
}
+ if (!MODE_PHPIZE) {
+ var val = "yes" == PHP_TEST_INI ? PHP_TEST_INI_PATH : "";
+ /* Be sure it's done after generate_test_php_ini(). */
+ MF.WriteLine("PHP_TEST_INI_PATH=\"" + val + "\"");
+ }
+
MF.WriteBlankLines(1);
if (MODE_PHPIZE) {
var TF = FSO.OpenTextFile(PHP_DIR + "/script/Makefile.phpize", 1);