@@ -4,11 +4,10 @@ set NO_INTERACTION=1
44set REPORT_EXIT_STATUS = 1
55set SKIP_IO_CAPTURE_TESTS = 1
66
7- if /i " %APPVEYOR_REPO_BRANCH:~ 0 , 4 % " equ " php- " (
8- set BRANCH = %APPVEYOR_REPO_BRANCH:~ 4 , 3 %
7+ call %~dp0 find-target-branch.bat
8+ if " % BRANCH% " neq " master " (
99 set STABILITY = stable
1010) else (
11- set BRANCH = master
1211 set STABILITY = staging
1312)
1413set DEPS_DIR = %PHP_BUILD_CACHE_BASE_DIR% \deps-%BRANCH% -%PHP_SDK_VS% -%PHP_SDK_ARCH%
@@ -28,7 +27,12 @@ set PDO_MYSQL_TEST_PASS=%MYSQL_PWD%
2827set PDO_MYSQL_TEST_HOST = %MYSQL_TEST_HOST%
2928set PDO_MYSQL_TEST_PORT = %MYSQL_TEST_PORT%
3029set PDO_MYSQL_TEST_DSN = mysql:host=%PDO_MYSQL_TEST_HOST% ;port=%PDO_MYSQL_TEST_PORT% ;dbname=test
31- " C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" --user=%MYSQL_TEST_USER% -e " CREATE DATABASE IF NOT EXISTS test"
30+ if /i " %APPVEYOR% " equ " True" (
31+ set TMP_MYSQL_BIN = %ProgramFiles% \MySql\MySQL Server 5.7\bin
32+ ) else (
33+ set TMP_MYSQL_BIN = C:\mysql\bin
34+ )
35+ " %TMP_MYSQL_BIN% \mysql.exe" --host=%PDO_MYSQL_TEST_HOST% --port=%MYSQL_TEST_PORT% --user=%MYSQL_TEST_USER% --password=%MYSQL_TEST_PASSWD% -e " CREATE DATABASE IF NOT EXISTS test"
3236if %errorlevel% neq 0 exit /b 3
3337
3438rem setup PostgreSQL related exts
@@ -37,13 +41,22 @@ set PGPASSWORD=Password12!
3741rem set PGSQL_TEST_CONNSTR=host=127.0.0.1 dbname=test port=5432 user=postgres password=Password12!
3842echo ^ < ?php $conn_str = " host=127.0.0.1 dbname=test port=5432 user=%PGUSER% password=%PGPASSWORD% " ; ?^ > >> " ./ext/pgsql/tests/config.inc"
3943set PDO_PGSQL_TEST_DSN = pgsql:host=127.0.0.1 port=5432 dbname=test user=%PGUSER% password=%PGPASSWORD%
40- " C:\Program Files\PostgreSQL\10\bin\createdb.exe" test
44+ if /i " %APPVEYOR% " equ " True" (
45+ set TMP_POSTGRESQL_BIN = %ProgramFiles% \PostgreSQL\10\bin
46+ ) else (
47+ set TMP_POSTGRESQL_BIN = %PGBIN%
48+ )
49+ " %TMP_POSTGRESQL_BIN% \createdb.exe" test
4150if %errorlevel% neq 0 exit /b 3
4251
4352rem setup ODBC related exts
4453set ODBC_TEST_USER = sa
4554set ODBC_TEST_PASS = Password12!
46- set ODBC_TEST_DSN = Driver={ODBC Driver 13 for SQL Server};Server=(local)\SQL2017;Database=master;uid=%ODBC_TEST_USER% ;pwd=%ODBC_TEST_PASS%
55+ if /i " %APPVEYOR% " equ " True" (
56+ set ODBC_TEST_DSN = Driver={ODBC Driver 13 for SQL Server};Server=^ (local^ )\SQL2017;Database=master;uid=%ODBC_TEST_USER% ;pwd=%ODBC_TEST_PASS%
57+ ) else (
58+ set ODBC_TEST_DSN = Driver={ODBC Driver 17 for SQL Server};Server=^ (local^ )\SQLEXPRESS;Database=master;uid=%ODBC_TEST_USER% ;pwd=%ODBC_TEST_PASS%
59+ )
4760set PDOTEST_DSN = odbc:%ODBC_TEST_DSN%
4861
4962rem setup Firebird related exts
@@ -61,13 +74,16 @@ if %errorlevel% neq 0 exit /b 3
6174path C:\Firebird;%PATH%
6275
6376rem prepare for ext/openssl
64- if " %APPVEYOR% " equ " True " rmdir /s /q C:\OpenSSL-Win32 > NUL 2 > NUL
65- if " %APPVEYOR% " equ " True " rmdir /s /q C:\OpenSSL-Win64 > NUL 2 > NUL
77+ rmdir /s /q C:\OpenSSL-Win32 > NUL 2 > NUL
78+ rmdir /s /q C:\OpenSSL-Win64 > NUL 2 > NUL
6679if " %PLATFORM% " == " x64" (
6780 set OPENSSLDIR = " C:\Program Files\Common Files\SSL"
6881) else (
6982 set OPENSSLDIR = " C:\Program Files (x86)\Common Files\SSL"
7083)
84+ if /i " %GITHUB_ACTIONS% " equ " True" (
85+ rmdir /s /q %OPENSSLDIR% > nul 2 >& 1
86+ )
7187mkdir %OPENSSLDIR%
7288if %errorlevel% neq 0 exit /b 3
7389copy %DEPS_DIR% \template\ssl\openssl.cnf %OPENSSLDIR%
@@ -82,28 +98,18 @@ rem work-around for failing to dl(mysqli) with OPcache (https://github.com/php/p
8298if " %OPCACHE% " equ " 1" set OPCACHE_OPTS = %OPCACHE_OPTS% -d extension=mysqli
8399
84100rem prepare for enchant
85- mkdir C: \usr\local\lib\enchant-2
101+ mkdir %~d0 \usr\local\lib\enchant-2
86102if %errorlevel% neq 0 exit /b 3
87- copy %DEPS_DIR% \bin\libenchant2_hunspell.dll C: \usr\local\lib\enchant-2
103+ copy %DEPS_DIR% \bin\libenchant2_hunspell.dll %~d0 \usr\local\lib\enchant-2
88104if %errorlevel% neq 0 exit /b 3
89- reg add HKEY_CURRENT_USER\SOFTWARE\Enchant\Config /v Module_Dir /t REG_SZ /d c:\enchant_plugins
105+ mkdir %~d0 \usr\local\share\enchant\hunspell
90106if %errorlevel% neq 0 exit /b 3
91- set PHP_BUILD_CACHE_ENCHANT_DICT_DIR = %PHP_BUILD_CACHE_BASE_DIR% \enchant_dict
92- if not exist " %PHP_BUILD_CACHE_ENCHANT_DICT_DIR% " (
93- echo Creating %PHP_BUILD_CACHE_ENCHANT_DICT_DIR%
94- mkdir " %PHP_BUILD_CACHE_ENCHANT_DICT_DIR% "
95- )
96- if not exist " %PHP_BUILD_CACHE_ENCHANT_DICT_DIR% \en_US.aff" (
97- echo Fetching enchant dicts
98- pushd %PHP_BUILD_CACHE_ENCHANT_DICT_DIR%
99- del /q *
100- powershell -Command wget http://windows.php.net/downloads/qa/appveyor/ext/enchant/dict.zip -OutFile dict.zip
101- unzip dict.zip
102- del /q dict.zip
103- popd
104- )
105- mkdir %LOCALAPPDATA% \enchant\hunspell
106- copy %PHP_BUILD_CACHE_ENCHANT_DICT_DIR% \* %LOCALAPPDATA% \enchant\hunspell
107+ echo Fetching enchant dicts
108+ pushd %~d0 \usr\local\share\enchant\hunspell
109+ powershell -Command wget http://windows.php.net/downloads/qa/appveyor/ext/enchant/dict.zip -OutFile dict.zip
110+ unzip dict.zip
111+ del /q dict.zip
112+ popd
107113
108114rem prepare for snmp
109115set MIBDIRS = %DEPS_DIR% \share\mibs
@@ -137,19 +143,22 @@ mkdir c:\tests_tmp
137143
138144set TEST_PHP_JUNIT = c:\junit.out.xml
139145
140- cd " %APPVEYOR_BUILD_FOLDER% "
141146nmake test TESTS=" %OPCACHE_OPTS% -g FAIL,BORK,LEAK,XLEAK --no-progress -q --offline --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp --bless %PARALLEL% "
142147
143148set EXIT_CODE = %errorlevel%
144149
145150taskkill /f /im snmpd.exe
146151
147- appveyor PushArtifact %TEST_PHP_JUNIT%
148-
149152if %EXIT_CODE% GEQ 1 (
150153 git checkout ext\pgsql\tests\config.inc
151154 git diff > bless_tests.patch
152- appveyor PushArtifact bless_tests.patch
155+ )
156+
157+ if /i " %APPVEYOR% " equ " True" (
158+ appveyor PushArtifact %TEST_PHP_JUNIT%
159+ if %EXIT_CODE% GEQ 1 (
160+ appveyor PushArtifact bless_tests.patch
161+ )
153162)
154163
155164exit /b %EXIT_CODE%
0 commit comments