0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-22 19:51:51 +00:00

Merge pull request #293 from stesie/refresh-appveyor

[WIP] refresh appveyor
This commit is contained in:
Stefan Siegl 2017-03-08 08:37:41 +01:00 committed by GitHub
commit 9a1f42c56c
4 changed files with 69 additions and 22 deletions

View File

@ -1,21 +1,22 @@
environment:
matrix:
- BUILD_PLATFORM: x86
ARTIFACT_NAME: v8js_vc14_php7_ts.zip
- ARTIFACT_NAME: v8js_vc14_php7_%Platform%_ts.zip
OUTDIR: Release_TS
- BUILD_PLATFORM: x86
ARTIFACT_NAME: v8js_vc14_php7_nts.zip
V8_ASSETS: V8-5.8.301.0-%Platform%.zip
- ARTIFACT_NAME: v8js_vc14_php7_%Platform%_nts.zip
OUTDIR: Release
CONFIGURE_EXTRA: --disable-zts
V8_ASSETS: V8-5.8.301.0-%Platform%.zip
PHP_VERSION: 7.0.7
PHP_VERSION: 7.0.16
PHP_SDK: c:\projects\php-sdk
os: Windows Server 2012
clone_folder: c:\projects\php-sdk\v8js-ci\vc14\x86\php\ext\v8js
clone_folder: c:\projects\php-sdk\v8js-ci\vc14\%Platform%\php\ext\v8js
matrix:
fast_finish: true
platform:
- x64
- x86
install:
- cd %PHP_SDK%
@ -23,21 +24,31 @@ install:
- 7z.exe x php-sdk-binary-tools-20110915.zip
- call bin\phpsdk_setvars.bat
- call bin\phpsdk_buildtree.bat v8js-ci
- cd v8js-ci\vc14\x86
- cd v8js-ci\vc14\%Platform%
- md deps
- curl -fSL -o v8-4.9.385.29-x86-deps.zip 'https://s3.amazonaws.com/win-phpv8/v8-4.9.385.29-x86-deps.zip'
- 7z.exe x v8-4.9.385.29-x86-deps.zip
- cd deps
- curl -fSL -o %V8_ASSETS% 'https://s3.amazonaws.com/win-phpv8/%V8_ASSETS%'
- 7z.exe x %V8_ASSETS%
- cd ..
- curl -fSL -o 'php-%PHP_VERSION%.tar.gz' 'http://us1.php.net/distributions/php-%PHP_VERSION%.tar.gz'
- ren php php-%PHP_VERSION%
- 7z.exe x php-%PHP_VERSION%.tar.gz -y
- 7z.exe x php-%PHP_VERSION%.tar -y | find /v "Extracting"
- cd php-%PHP_VERSION%
- IF "%Platform%" == "x64" SET OUTDIR=x64\%OUTDIR%
- mkdir %OUTDIR%
- move ..\deps\lib\*.dll %OUTDIR%\
- move ..\deps\bin\*.dll %OUTDIR%\
build_script:
- '"%VS140COMNTOOLS%\VsDevCmd" %BUILD_PLATFORM%'
- set
- ps: >-
If ($env:Platform -Match "x86") {
$env:VCVARS_PLATFORM="x86"
$env:ENV_PLATFORM="x86"
} Else {
$env:VCVARS_PLATFORM="amd64"
$env:ENV_PLATFORM="x64"
}
- call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" %VCVARS_PLATFORM%
- echo Building PHP [%PHP_VERSION%]
- '%PHP_SDK%\bin\phpsdk_setvars'
- buildconf
@ -50,14 +61,14 @@ after_build:
- ps: Push-AppveyorArtifact $env:ARTIFACT_NAME
test_script:
- cd c:\projects\php-sdk\v8js-ci\vc14\x86\php-%PHP_VERSION%
- cd c:\projects\php-sdk\v8js-ci\vc14\%Platform%\php-%PHP_VERSION%
- set NO_INTERACTION=1
- set TEST_PHP_JUNIT=junit.xml
- set REPORT_EXIT_STATUS=1
- "%OUTDIR%\\php.exe run-tests.php -p %OUTDIR%\\php.exe ext/v8js/tests/ -d extension=php_v8js.dll -d extension_dir=%OUTDIR%\\"
on_finish:
- cd c:\projects\php-sdk\v8js-ci\vc14\x86\php-%PHP_VERSION%
- cd c:\projects\php-sdk\v8js-ci\vc14\%Platform%\php-%PHP_VERSION%
- ps: |
# upload results to AppVeyor
$wc = New-Object 'System.Net.WebClient'

View File

@ -16,9 +16,9 @@ if (PHP_V8JS != "no") {
ADD_FLAG("CFLAGS_V8JS", "/D __STDC_LIMIT_MACROS");
// defaults
var v8major = 4;
var v8minor = 7;
var v8build = 75;
var v8major = 5;
var v8minor = 8;
var v8build = 301;
var v8patch = 0;
var v8pinc = search_paths("v8-version.h", php_usual_include_suspects, null);
if (typeof(v8pinc) == "string") {

36
tests/long_int64.phpt Normal file
View File

@ -0,0 +1,36 @@
--TEST--
Test V8::executeString() : Check long 64-bit export from PHP to JS
--SKIPIF--
<?php
require_once(dirname(__FILE__) . '/skipif.inc');
if (4 == PHP_INT_SIZE)
die("SKIP test not supported on 32bit PHP");
?>
--FILE--
<?php
$addInt = function ($a, $b) {
return $a + $b;
};
$v8 = new V8Js('PHP');
$v8->add = $addInt;
$v8->p1 = 10;
$v8->p2 = pow(2,45);
var_dump($v8->p2);
var_dump($v8->executeString('
var res = PHP.p1 + PHP.p2;
"p1:" + PHP.p1 +
", p2:" + PHP.p2 +
", PHP.add(p1,p2)=" + PHP.add(PHP.p1, PHP.p2) +
", p1+p2=" + res +
" -> " + (new Date(res)).toISOString();
'));
?>
===EOF===
--EXPECT--
int(35184372088832)
string(105) "p1:10, p2:35184372088832, PHP.add(p1,p2)=35184372088842, p1+p2=35184372088842 -> 3084-12-12T12:41:28.842Z"
===EOF===

View File

@ -101,7 +101,7 @@ static v8::Handle<v8::Value> v8js_hash_to_jsarr(zval *value, v8::Isolate *isolat
v8::Handle<v8::Value> zval_to_v8js(zval *value, v8::Isolate *isolate TSRMLS_DC) /* {{{ */
{
v8::Handle<v8::Value> jsValue;
long v;
zend_long v;
zend_class_entry *ce;
switch (Z_TYPE_P(value))
@ -143,9 +143,9 @@ v8::Handle<v8::Value> zval_to_v8js(zval *value, v8::Isolate *isolate TSRMLS_DC)
#undef max
#undef min
if (v < - std::numeric_limits<int32_t>::min() || v > std::numeric_limits<int32_t>::max()) {
jsValue = V8JS_FLOAT((double)v);
jsValue = V8JS_FLOAT(static_cast<double>(v));
} else {
jsValue = V8JS_INT(v);
jsValue = V8JS_INT(static_cast<int32_t>(v));
}
break;