Skip to content

Commit 72ac8cf

Browse files
y-utiweltling
authored andcommitted
Enable 'nmake test' on building extensions
On Windows, Makefile generated by phpize doesn't have the 'test' target rule. This commit fixes that and enables 'nmake test' on Windows.
1 parent 305bddb commit 72ac8cf

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

win32/build/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ build-lib: build-ext-libs
191191
build-devel: build-headers build-lib
192192
@if not exist $(BUILD_DIR_DEV)\script mkdir $(BUILD_DIR_DEV)\script >nul
193193
@if not exist $(BUILD_DIR_DEV)\build mkdir $(BUILD_DIR_DEV)\build >nul
194+
@copy run-tests.php $(BUILD_DIR_DEV)\script\ /y >nul
194195
@copy win32\build\confutils.js $(BUILD_DIR_DEV)\script\ /y >nul
195196
@copy win32\build\configure.tail $(BUILD_DIR_DEV)\script\ /y >nul
196197
@copy win32\build\config.w32.phpize.in $(BUILD_DIR_DEV)\script\ /y >nul

win32/build/Makefile.phpize

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ clean: clean-pecl
2626
@for %D in (_x $(BUILD_DIRS_SUB)) do @if exist %D @del /F /Q %D\*.* > NUL
2727
-@del /F /Q $(BUILD_DIR)\*.res $(BUILD_DIR)\*.lib $(BUILD_DIR)\*.ilk $(BUILD_DIR)\*.pdb $(BUILD_DIR)\*.exp $(PHPDEF) $(BUILD_DIR)\php-$(PHP_VERSION_STRING)-Win32.zip $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)-Win32.zip > NUL
2828

29+
!if "$(EXT_TARGETS)" == ""
30+
_EXTENSION_DLL=$(PECL_TARGETS)
31+
!else
32+
_EXTENSION_DLL=$(EXT_TARGETS)
33+
!endif
34+
35+
test:
36+
"$(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)
37+
2938
!if $(MT) == ""
3039
_VC_MANIFEST_EMBED_EXE=
3140
_VC_MANIFEST_EMBED_DLL=

win32/build/phpize.js.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,3 +268,5 @@ C.Write(file_get_contents(PHP_DIR + "\\script\\configure.tail"));
268268

269269
B.WriteLine("@echo off");
270270
B.WriteLine("cscript /nologo configure.js %*");
271+
272+
FSO.CopyFile(PHP_DIR + "\\script\\run-tests.php", "run-tests.php", true);

0 commit comments

Comments
 (0)