1 $ErrorActionPreference = "Stop" 2 3 $dir = 'C:\projects\ext-fiber\' 4 if ($env:ARCH -eq 'x64') { 5 $dir += 'x64\' 6 } 7 $dir += 'Release' 8 if ($env:TS -eq '1') { 9 $dir += '_TS' 10 } 11 12 $fiber_dll_opt = "-d extension=$dir\php_fiber.dll" 13 14 Set-Location "C:\projects\ext-fiber" 15 16 $php = Get-Command 'php' | Select-Object -ExpandProperty 'Definition' 17 $dname = (Get-Item $php).Directory.FullName 18 19 $opts = '-n' 20 if ($env:OPCACHE -ne '0') { 21 $opts += " -d zend_extension=$dname\ext\php_opcache.dll -d opcache.enabled=1 -d opcache.enable_cli=1 -d opcache.optimization_level=0" 22 } 23 $opts += " $fiber_dll_opt" 24 $env:TEST_PHP_ARGS = $opts 25 26 $env:TEST_PHP_EXECUTABLE = $php 27 & $php run-tests.php -q --show-diff tests 28 if (-not $?) { 29 throw "tests failed with errorlevel $LastExitCode" 30 } 31