Skip to content

Commit 8f93ddc

Browse files
committed
tests: Introduce platform checks
--PLATFORM-- bits: 64 os: !Windows vs. --SKIPIF-- <?php if (PHP_INT_SIZE != 64) die('skip This test is 64bit only'); if (stripos('WIN', PHP_OS) === 0) die('skip This test cannot run on Windows'); ?> This is part of overall work on test speedup by reducing the number of SKIPIF checks. Additional benefits are the tests getting more readable and replacing code with metadata. This change migrates Zend tests to the new system, the rest will be fixed in subsequent patches.
1 parent ffc8717 commit 8f93ddc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+248
-151
lines changed

Zend/tests/array_unpack/already_occupied.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
Appending to an array via unpack may fail
3-
--SKIPIF--
4-
<?php if (PHP_INT_SIZE != 8) die("skip 64bit only"); ?>
3+
--PLATFORM--
4+
bits: 64
55
--FILE--
66
<?php
77

Zend/tests/binary-32bit.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
testing binary literals
3-
--SKIPIF--
4-
<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
3+
--PLATFORM--
4+
bits: 32
55
--FILE--
66
<?php
77
var_dump(0b1);

Zend/tests/binary.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
testing binary literals
33
--INI--
44
precision=32
5-
--SKIPIF--
6-
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
5+
--PLATFORM--
6+
bits: 64
77
--FILE--
88
<?php
99
var_dump(0b1);

Zend/tests/bug46701.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
Bug #46701 (Creating associative array with long values in the key fails on 32bit linux)
3-
--SKIPIF--
4-
<?php if (PHP_INT_SIZE != 4) die('skip this test is for 32bit platforms only'); ?>
3+
--PLATFORM--
4+
bits: 32
55
--FILE--
66
<?php
77

Zend/tests/bug54547.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
--TEST--
22
Bug #54547: wrong equality of string numbers near LONG_MAX with 64-bit longs
3-
--SKIPIF--
4-
<?php
5-
if (PHP_INT_MAX !== 9223372036854775807)
6-
die("skip for 64-bit long systems only");
3+
--PLATFORM--
4+
bits: 64
75
--FILE--
86
<?php
97
var_dump("9223372036854775807" == "9223372036854775808");

Zend/tests/bug55509.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
--TEST--
22
Bug #55509 (segfault on x86_64 using more than 2G memory)
3+
--PLATFORM--
4+
bits: 64
35
--SKIPIF--
46
<?php
5-
if (PHP_INT_SIZE == 4) {
6-
die('skip Not for 32-bits OS');
7-
}
8-
97
$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
108
if ($zend_mm_enabled === "0") {
119
die("skip Zend MM disabled");

Zend/tests/bug62097.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
--TEST--
22
Bug #62097: fix for bug #54547 is wrong for 32-bit machines
3-
--SKIPIF--
4-
<?php
5-
if (PHP_INT_MAX !== 2147483647)
6-
die('skip for system with 32-bit wide longs only');
3+
--PLATFORM--
4+
bits: 32
75
--FILE--
86
<?php
97
var_dump("02147483647" == "2147483647",

Zend/tests/bug69892.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
Bug #69892: Different arrays compare identical due to integer key truncation
3-
--SKIPIF--
4-
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only"); ?>
3+
--PLATFORM--
4+
bits: 64
55
--FILE--
66
<?php
77
var_dump([0 => 0] === [0x100000000 => 0]);

Zend/tests/bug70173.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
--TEST--
22
Bug #70173 (ZVAL_COPY_VALUE_EX broken for 32bit Solaris Sparc)
3-
--SKIPIF--
4-
<?php
5-
if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platforms only");
6-
?>
3+
--PLATFORM--
4+
bits: 32
75
--FILE--
86
<?php
97
$var = 2900000000;

Zend/tests/bug74093.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
--TEST--
22
Bug #74093 (Maximum execution time of n+2 seconds exceed not written in error_log)
3+
--PLATFORM--
4+
os: !Windows
5+
zts: false
36
--SKIPIF--
47
<?php
58
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
6-
if (PHP_ZTS) die("skip only for no-zts build");
7-
if (substr(PHP_OS, 0, 3) == 'WIN') die("skip not for Windows");
89
?>
910
--INI--
1011
memory_limit=1G

Zend/tests/bug77660.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
Bug #77660 (Segmentation fault on break 2147483648)
3-
--SKIPIF--
4-
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
3+
--PLATFORM--
4+
bits: 64
55
--FILE--
66
<?php
77
for(;;) break 2147483648;

Zend/tests/compare_001.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
comparing different variables for equality
3-
--SKIPIF--
4-
<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
3+
--PLATFORM--
4+
bits: 32
55
--FILE--
66
<?php
77

Zend/tests/compare_001_64bit.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
comparing different variables for equality
3-
--SKIPIF--
4-
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
3+
--PLATFORM--
4+
bits: 64
55
--FILE--
66
<?php
77

Zend/tests/compare_002.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
comparing different variables for identity
3-
--SKIPIF--
4-
<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
3+
--PLATFORM--
4+
bits: 32
55
--FILE--
66
<?php
77

Zend/tests/compare_002_64bit.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
comparing different variables for identity
3-
--SKIPIF--
4-
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
3+
--PLATFORM--
4+
bits: 64
55
--FILE--
66
<?php
77

Zend/tests/compare_003.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
comparing different variables (greater than)
3-
--SKIPIF--
4-
<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
3+
--PLATFORM--
4+
bits: 32
55
--FILE--
66
<?php
77

Zend/tests/compare_003_64bit.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
comparing different variables (greater than)
3-
--SKIPIF--
4-
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
3+
--PLATFORM--
4+
bits: 64
55
--FILE--
66
<?php
77

Zend/tests/compare_004.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
comparing different variables (less than)
3-
--SKIPIF--
4-
<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
3+
--PLATFORM--
4+
bits: 32
55
--FILE--
66
<?php
77

Zend/tests/compare_004_64bit.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
comparing different variables (less than)
3-
--SKIPIF--
4-
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
3+
--PLATFORM--
4+
bits: 64
55
--FILE--
66
<?php
77

Zend/tests/compare_005.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
comparing different variables (greater or equal than)
3-
--SKIPIF--
4-
<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
3+
--PLATFORM--
4+
bits: 32
55
--FILE--
66
<?php
77

Zend/tests/compare_005_64bit.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
comparing different variables (greater or equal than)
3-
--SKIPIF--
4-
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
3+
--PLATFORM--
4+
bits: 64
55
--FILE--
66
<?php
77

Zend/tests/compare_006.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
comparing different variables (smaller or equal than)
3-
--SKIPIF--
4-
<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
3+
--PLATFORM--
4+
bits: 32
55
--FILE--
66
<?php
77

Zend/tests/compare_006_64bit.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
comparing different variables (smaller or equal than)
3-
--SKIPIF--
4-
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
3+
--PLATFORM--
4+
bits: 64
55
--FILE--
66
<?php
77

Zend/tests/concat_003.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
--TEST--
22
Concatenating many small strings should not slowdown allocations
3+
--PLATFORM--
4+
# debug version is slow
5+
debug: false
36
--SKIPIF--
47
<?php
5-
if (PHP_DEBUG) { die ("skip debug version is slow"); }
68
if (getenv('SKIP_PERF_SENSITIVE')) die("skip performance sensitive test");
79
?>
810
--FILE--

Zend/tests/decrement_001.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
decrementing different variables
3-
--SKIPIF--
4-
<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
3+
--PLATFORM--
4+
bits: 32
55
--INI--
66
precision=14
77
--FILE--

Zend/tests/decrement_001_64bit.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
decrementing different variables
3-
--SKIPIF--
4-
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
3+
--PLATFORM--
4+
bits: 64
55
--INI--
66
precision=14
77
--FILE--

Zend/tests/double_to_string.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
double to string conversion tests
33
--INI--
44
precision=14
5-
--SKIPIF--
6-
<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
5+
--PLATFORM--
6+
bits: 32
77
--FILE--
88
<?php
99

Zend/tests/double_to_string_64bit.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
double to string conversion tests (64bit)
3-
--SKIPIF--
4-
<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); ?>
3+
--PLATFORM--
4+
bits: 64
55
--INI--
66
precision=14
77
--FILE--

Zend/tests/dval_to_lval_32.phpt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
--TEST--
22
zend_dval_to_lval preserves low bits (32 bit long)
3-
--SKIPIF--
4-
<?php
5-
if (PHP_INT_SIZE != 4)
6-
die("skip for machines with 32-bit longs");
7-
?>
3+
--PLATFORM--
4+
bits: 32
85
--FILE--
96
<?php
107
/* test doubles around -4e21 */

Zend/tests/dval_to_lval_64.phpt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
--TEST--
22
zend_dval_to_lval preserves low bits (64 bit long)
3-
--SKIPIF--
4-
<?php
5-
if (PHP_INT_SIZE != 8)
6-
die("skip for machines with 64-bit longs");
7-
?>
3+
--PLATFORM--
4+
bits: 64
85
--FILE--
96
<?php
107
/* test doubles around -4e21 */

Zend/tests/float_to_int/explicit_casts_should_not_warn.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
--TEST--
22
Explicit (int) cast must not warn
3-
--SKIPIF--
4-
<?php
5-
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
6-
?>
3+
--PLATFORM--
4+
bits: 64
75
--FILE--
86
<?php
97

Zend/tests/float_to_int/explicit_casts_should_not_warn_32bit.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
--TEST--
22
Explicit (int) cast must not warn 32bit variation
3-
--SKIPIF--
4-
<?php
5-
if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
6-
?>
3+
--PLATFORM--
4+
bits: 32
75
--FILE--
86
<?php
97

Zend/tests/float_to_int/warning_float_does_not_fit_zend_long_strings.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
--TEST--
22
Implicit float to int conversions when float too large should warn, string offset variant
3-
--SKIPIF--
4-
<?php
5-
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
6-
?>
3+
--PLATFORM--
4+
bits: 64
75
--FILE--
86
<?php
97

Zend/tests/float_to_int/warning_float_does_not_fit_zend_long_strings_32bit.phpt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
--TEST--
22
Implicit float to int conversions when float too large should warn, string offset variant, 32bit variant
3-
--SKIPIF--
4-
<?php
5-
if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
6-
?>
3+
--PLATFORM--
4+
bits: 32
75
--FILE--
86
<?php
97

Zend/tests/hex_overflow_32bit.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
testing integer overflow (32bit)
33
--INI--
44
serialize_precision=14
5-
--SKIPIF--
6-
<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
5+
--PLATFORM--
6+
bits: 32
77
--FILE--
88
<?php
99

Zend/tests/increment_001.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
incrementing different variables
3-
--SKIPIF--
4-
<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
3+
--PLATFORM--
4+
bits: 32
55
--INI--
66
precision=14
77
--FILE--

0 commit comments

Comments
 (0)