|
| 1 | +@echo on |
| 2 | + |
| 3 | +if /i "%APPVEYOR%%GITHUB_ACTIONS%" neq "True" ( |
| 4 | + echo for CI only |
| 5 | + exit /b 3 |
| 6 | +) |
| 7 | + |
| 8 | +set NO_INTERACTION=1 |
| 9 | +set REPORT_EXIT_STATUS=1 |
| 10 | +set SKIP_IO_CAPTURE_TESTS=1 |
| 11 | + |
| 12 | +if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" ( |
| 13 | + set BRANCH=%APPVEYOR_REPO_BRANCH:~4,3% |
| 14 | + set STABILITY=stable |
| 15 | +) else ( |
| 16 | + set BRANCH=master |
| 17 | + set STABILITY=staging |
| 18 | +) |
| 19 | +set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VS%-%PHP_SDK_ARCH% |
| 20 | +if not exist "%DEPS_DIR%" ( |
| 21 | + echo "%DEPS_DIR%" doesn't exist |
| 22 | + exit /b 3 |
| 23 | +) |
| 24 | + |
| 25 | +if /i "%APPVEYOR%" equ "True" ( |
| 26 | + rem setup MySQL related exts |
| 27 | + set MYSQL_PWD=Password12! |
| 28 | + set MYSQL_TEST_PASSWD=%MYSQL_PWD% |
| 29 | + set MYSQL_TEST_USER=root |
| 30 | + set MYSQL_TEST_HOST=127.0.0.1 |
| 31 | + set MYSQL_TEST_PORT=3306 |
| 32 | + set PDO_MYSQL_TEST_USER=%MYSQL_TEST_USER% |
| 33 | + set PDO_MYSQL_TEST_PASS=%MYSQL_PWD% |
| 34 | + set PDO_MYSQL_TEST_HOST=%MYSQL_TEST_HOST% |
| 35 | + set PDO_MYSQL_TEST_PORT=%MYSQL_TEST_PORT% |
| 36 | + set PDO_MYSQL_TEST_DSN=mysql:host=%PDO_MYSQL_TEST_HOST%;port=%PDO_MYSQL_TEST_PORT%;dbname=test |
| 37 | + "C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" --user=%MYSQL_TEST_USER% -e "CREATE DATABASE IF NOT EXISTS test" |
| 38 | + if %errorlevel% neq 0 exit /b 3 |
| 39 | + |
| 40 | + rem setup PostgreSQL related exts |
| 41 | + set PGUSER=postgres |
| 42 | + set PGPASSWORD=Password12! |
| 43 | + rem set PGSQL_TEST_CONNSTR=host=127.0.0.1 dbname=test port=5432 user=postgres password=Password12! |
| 44 | + echo ^<?php $conn_str = "host=127.0.0.1 dbname=test port=5432 user=%PGUSER% password=%PGPASSWORD%"; ?^> >> ext\pgsql\tests\config.inc |
| 45 | + set PDO_PGSQL_TEST_DSN=pgsql:host=127.0.0.1 port=5432 dbname=test user=%PGUSER% password=%PGPASSWORD% |
| 46 | + "C:\Program Files\PostgreSQL\10\bin\createdb.exe" test |
| 47 | + if %errorlevel% neq 0 exit /b 3 |
| 48 | + |
| 49 | + rem setup ODBC related exts |
| 50 | + set ODBC_TEST_USER=sa |
| 51 | + set ODBC_TEST_PASS=Password12! |
| 52 | + set ODBC_TEST_DSN=Driver={ODBC Driver 13 for SQL Server};Server=^(local^)\SQL2017;Database=master;uid=%ODBC_TEST_USER%;pwd=%ODBC_TEST_PASS% |
| 53 | + set PDOTEST_DSN=odbc:%ODBC_TEST_DSN% |
| 54 | +) |
| 55 | + |
| 56 | +rem prepare for ext/openssl |
| 57 | +rmdir /s /q C:\OpenSSL-Win32 >NUL 2>NUL |
| 58 | +rmdir /s /q C:\OpenSSL-Win64 >NUL 2>NUL |
| 59 | +if "%PLATFORM%" == "x86" ( |
| 60 | + set OPENSSLDIR="C:\Program Files (x86)\Common Files\SSL" |
| 61 | +) else ( |
| 62 | + set OPENSSLDIR="C:\Program Files\Common Files\SSL" |
| 63 | +) |
| 64 | +if /i "%GITHUB_ACTIONS%" equ "True" ( |
| 65 | + rmdir /s /q %OPENSSLDIR% >NUL 2>NUL |
| 66 | +) |
| 67 | +mkdir %OPENSSLDIR% |
| 68 | +if %errorlevel% neq 0 exit /b 3 |
| 69 | +copy %DEPS_DIR%\template\ssl\openssl.cnf %OPENSSLDIR% |
| 70 | +if %errorlevel% neq 0 exit /b 3 |
| 71 | +rem set OPENSSL_CONF=%OPENSSLDIR%\openssl.cnf |
| 72 | +set OPENSSL_CONF= |
| 73 | +rem set SSLEAY_CONF= |
| 74 | + |
| 75 | +rem prepare for enchant |
| 76 | +mkdir C:\usr\local\lib\enchant-2 |
| 77 | +if %errorlevel% neq 0 exit /b 3 |
| 78 | +copy %DEPS_DIR%\bin\libenchant2_hunspell.dll C:\usr\local\lib\enchant-2 |
| 79 | +if %errorlevel% neq 0 exit /b 3 |
| 80 | +reg add HKEY_CURRENT_USER\SOFTWARE\Enchant\Config /v Module_Dir /t REG_SZ /d c:\enchant_plugins |
| 81 | +if %errorlevel% neq 0 exit /b 3 |
| 82 | +set PHP_BUILD_CACHE_ENCHANT_DICT_DIR=%PHP_BUILD_CACHE_BASE_DIR%\enchant_dict |
| 83 | +if not exist "%PHP_BUILD_CACHE_ENCHANT_DICT_DIR%" ( |
| 84 | + echo Creating %PHP_BUILD_CACHE_ENCHANT_DICT_DIR% |
| 85 | + mkdir "%PHP_BUILD_CACHE_ENCHANT_DICT_DIR%" |
| 86 | +) |
| 87 | +if not exist "%PHP_BUILD_CACHE_ENCHANT_DICT_DIR%\en_US.aff" ( |
| 88 | + echo Fetching enchant dicts |
| 89 | + pushd %PHP_BUILD_CACHE_ENCHANT_DICT_DIR% |
| 90 | + del /q * |
| 91 | + powershell -Command wget http://windows.php.net/downloads/qa/appveyor/ext/enchant/dict.zip -OutFile dict.zip |
| 92 | + unzip dict.zip |
| 93 | + del /q dict.zip |
| 94 | + popd |
| 95 | +) |
| 96 | +mkdir %LOCALAPPDATA%\enchant\hunspell |
| 97 | +copy %PHP_BUILD_CACHE_ENCHANT_DICT_DIR%\* %LOCALAPPDATA%\enchant\hunspell |
| 98 | + |
| 99 | +set PHP_BUILD_DIR=%PHP_BUILD_OBJ_DIR%\Release |
| 100 | +if "%THREAD_SAFE%" neq "" set PHP_BUILD_DIR=%PHP_BUILD_DIR%_TS |
| 101 | + |
| 102 | +mkdir %PHP_BUILD_DIR%\test_file_cache |
| 103 | +rem generate php.ini |
| 104 | +echo extension_dir=%PHP_BUILD_DIR% > %PHP_BUILD_DIR%\php.ini |
| 105 | +echo opcache.file_cache=%PHP_BUILD_DIR%\test_file_cache >> %PHP_BUILD_DIR%\php.ini |
| 106 | +if "%OPCACHE%" neq "" echo zend_extension=php_opcache.dll >> %PHP_BUILD_DIR%\php.ini |
| 107 | +rem work-around for some spawned PHP processes requiring OpenSSL |
| 108 | +echo extension=php_openssl.dll >> %PHP_BUILD_DIR%\php.ini |
| 109 | + |
| 110 | +set TEST_PHPDBG_EXECUTABLE=%PHP_BUILD_DIR%\phpdbg.exe |
| 111 | + |
| 112 | +mkdir c:\tests_tmp |
| 113 | + |
| 114 | +set TEST_PHP_JUNIT=c:\junit.out.xml |
| 115 | + |
| 116 | +nmake test TESTS=" -q -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP --color --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp -j2" |
| 117 | +if %errorlevel% neq 0 exit /b %errorlevel% |
| 118 | + |
| 119 | +set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=16M |
| 120 | +nmake test TESTS="%OPCACHE_OPTS% -q -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP --color --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp -j2" |
| 121 | +if %errorlevel% neq 0 exit /b %errorlevel% |
0 commit comments