소스 검색

Skip Generator export tests if not supported

Stefan Siegl 9 년 전
부모
커밋
e2636b2e71
5개의 변경된 파일45개의 추가작업 그리고 5개의 파일을 삭제
  1. 9 1
      tests/generators_to_v8_001.phpt
  2. 9 1
      tests/generators_to_v8_002.phpt
  3. 9 1
      tests/generators_to_v8_003.phpt
  4. 9 1
      tests/generators_to_v8_004.phpt
  5. 9 1
      tests/generators_to_v8_basic.phpt

+ 9 - 1
tests/generators_to_v8_001.phpt

@@ -1,7 +1,15 @@
 --TEST--
 Test V8::executeString() : Generators PHP -> V8 (instantite in JS)
 --SKIPIF--
-<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
+<?php
+require_once(dirname(__FILE__) . '/skipif.inc');
+
+// Actually this check is a bit bad as it tests import, but currently
+// there is no flag we can check for export
+if (!class_exists('V8Generator')) {
+    die("skip Installed V8 version doesn't support generators");
+}
+?>
 --FILE--
 <?php
 

+ 9 - 1
tests/generators_to_v8_002.phpt

@@ -1,7 +1,15 @@
 --TEST--
 Test V8::executeString() : Generators PHP -> V8 (instantiate in JS, iterate in PHP)
 --SKIPIF--
-<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
+<?php
+require_once(dirname(__FILE__) . '/skipif.inc');
+
+// Actually this check is a bit bad as it tests import, but currently
+// there is no flag we can check for export
+if (!class_exists('V8Generator')) {
+    die("skip Installed V8 version doesn't support generators");
+}
+?>
 --FILE--
 <?php
 

+ 9 - 1
tests/generators_to_v8_003.phpt

@@ -1,7 +1,15 @@
 --TEST--
 Test V8::executeString() : Generators PHP -> V8 (instantiate in JS, iterate in PHP)
 --SKIPIF--
-<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
+<?php
+require_once(dirname(__FILE__) . '/skipif.inc');
+
+// Actually this check is a bit bad as it tests import, but currently
+// there is no flag we can check for export
+if (!class_exists('V8Generator')) {
+    die("skip Installed V8 version doesn't support generators");
+}
+?>
 --FILE--
 <?php
 

+ 9 - 1
tests/generators_to_v8_004.phpt

@@ -1,7 +1,15 @@
 --TEST--
 Test V8::executeString() : Generators PHP -> V8 (yield from)
 --SKIPIF--
-<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
+<?php
+require_once(dirname(__FILE__) . '/skipif.inc');
+
+// Actually this check is a bit bad as it tests import, but currently
+// there is no flag we can check for export
+if (!class_exists('V8Generator')) {
+    die("skip Installed V8 version doesn't support generators");
+}
+?>
 --FILE--
 <?php
 

+ 9 - 1
tests/generators_to_v8_basic.phpt

@@ -1,7 +1,15 @@
 --TEST--
 Test V8::executeString() : Generators PHP -> V8
 --SKIPIF--
-<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
+<?php
+require_once(dirname(__FILE__) . '/skipif.inc');
+
+// Actually this check is a bit bad as it tests import, but currently
+// there is no flag we can check for export
+if (!class_exists('V8Generator')) {
+    die("skip Installed V8 version doesn't support generators");
+}
+?>
 --FILE--
 <?php