Skip to content

Commit dd10bf5

Browse files
committed
Merge branch 'mac-tests' into PHP-7.4
* mac-tests: fix mac tests on azure
2 parents e6aec81 + f16b012 commit dd10bf5

19 files changed

+64
-96
lines changed

azure/macos/brew.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ parameters:
44
steps:
55
- script: |
66
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
7-
# see https://formulae.brew.sh/ for package names
8-
brew install autoconf \
7+
displayName: 'Install Homebrew'
8+
- script: |
9+
brew install pkg-config \
10+
autoconf \
911
automake \
1012
libtool \
1113
bison \
12-
re2c \
13-
pkg-config \
14+
re2c
15+
displayName: 'Install Build Tools'
16+
- script: |
17+
brew install openssl@1.1 \
1418
krb5 \
1519
bzip2 \
1620
enchant \
@@ -20,16 +24,15 @@ steps:
2024
freetype \
2125
intltool \
2226
icu4c \
23-
readline \
2427
libiconv \
2528
zlib \
2629
t1lib \
2730
gd \
2831
libzip \
2932
gmp \
3033
tidyp \
31-
libxml2\
32-
openssl@1.1 \
34+
libxml2 \
35+
libxslt \
3336
postgresql
3437
brew link icu4c gettext --force
35-
displayName: 'brew'
38+
displayName: 'Install Build Dependencies'

azure/macos/job.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/krb5/lib/pkgconfig"
1515
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libffi/lib/pkgconfig"
1616
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxml2/lib/pkgconfig"
17+
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxslt/lib/pkgconfig"
18+
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/zlib/lib/pkgconfig"
1719
./buildconf --force
1820
./configure ${{ parameters.configurationParameters }} \
1921
--prefix=/usr/local \
@@ -32,7 +34,6 @@ jobs:
3234
--enable-exif \
3335
--with-zip \
3436
--with-zlib \
35-
--with-zlib-dir=/usr \
3637
--enable-soap \
3738
--enable-xmlreader \
3839
--with-xsl \
@@ -46,7 +47,7 @@ jobs:
4647
--with-readline=/usr/local/opt/readline \
4748
--enable-mbstring \
4849
--with-curl \
49-
--with-gettext==/usr/local/opt/gettext \
50+
--with-gettext=/usr/local/opt/gettext \
5051
--enable-sockets \
5152
--with-bz2=/usr/local/opt/bzip2 \
5253
--with-openssl \
@@ -79,9 +80,3 @@ jobs:
7980
configurationName: ${{ parameters.configurationName }}
8081
runTestsName: 'OpCache'
8182
runTestsParameters: -d zend_extension=opcache.so -d opcache.enable_cli=1
82-
- ${{ if ne(variables['Build.SourceBranch'], 'refs/heads/PHP-7.4') }}:
83-
- template: test.yml
84-
parameters:
85-
configurationName: ${{ parameters.configurationName }}
86-
runTestsName: 'JIT'
87-
runTestsParameters: -d zend_extension=opcache.so -d opcache.enable_cli=1 -d opcache.jit_buffer_size=16M

azure/macos/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ steps:
77
export TEST_PHP_JUNIT=junit.xml
88
export REPORT_EXIT_STATUS=no
99
export SKIP_IO_CAPTURE_TESTS=1
10+
export CI_NO_IPV6=1
1011
rm -rf junit.xml | true
1112
/usr/local/bin/php run-tests.php -P -q \
1213
-j$(sysctl -n hw.ncpu) \
@@ -22,6 +23,6 @@ steps:
2223
testResultsFormat: 'JUnit'
2324
testResultsFiles: junit.xml
2425
testRunTitle: '${{ parameters.configurationName }} ${{ parameters.runTestsName }}'
25-
failTaskOnFailedTests: false
26+
failTaskOnFailedTests: true
2627
displayName: 'Export ${{ parameters.configurationName }} ${{ parameters.runTestsName }} Results'
2728
condition: or(succeeded(), failed())

ext/ffi/tests/100.phpt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ try {
88
} catch (Throwable $e) {
99
die('skip PHP symbols not available');
1010
}
11+
12+
if (PHP_OS == "Darwin") {
13+
die("xfail there is a known leak here");
14+
}
1115
?>
1216
--INI--
1317
ffi.enable=1

ext/pcntl/tests/001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function test_exit_signal(){
2727
$pid=pcntl_fork();
2828

2929
if ($pid==0) {
30-
sleep(10);
30+
while(1);
3131
exit;
3232
} else {
3333
$options=0;

ext/sockets/tests/ipv6_skipif.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
2-
if (!defined("AF_INET6")) {
2+
if (getenv("CI_NO_IPV6") || !defined("AF_INET6")) {
33
die('skip no IPv6 support');
44
}
55
if (@stream_socket_client('udp://[::1]:8888') === false)
66
die('skip no IPv6 support');
7+

ext/sockets/tests/mcast_ipv6_send.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Multicast support: IPv6 send options
55
if (!extension_loaded('sockets')) {
66
die('skip sockets extension not available.');
77
}
8-
if (!defined('IPPROTO_IPV6')) {
8+
if (getenv('CI_NO_IPV6') || !defined('IPPROTO_IPV6')) {
99
die('skip IPv6 not available.');
1010
}
1111
$level = IPPROTO_IPV6;

ext/sockets/tests/socket_create_listen-nobind.phpt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ if (fileowner($filename) == 0) {
1212
unlink ($filename);
1313
die('SKIP Test cannot be run as root.');
1414
}
15+
if (@socket_create_listen(80)) {
16+
die('SKIP Test cannot be run in environment that will allow binding to port 80 (azure)');
17+
}
1518
--FILE--
1619
<?php
17-
$sock = socket_create_listen(PHP_OS == "Darwin" ? 427 : 80);
20+
$sock = socket_create_listen(80);
1821
--EXPECTF--
1922
Warning: socket_create_listen(): unable to bind to given address [13]: Permission denied in %s on line %d
2023
--CLEAN--

ext/standard/tests/file/flock_basic.phpt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,26 @@ Description: PHP supports a portable way of locking complete files
1111
echo "*** Testing flock() fun with file and dir ***\n";
1212
$file_path = __DIR__;
1313

14-
$file_handle = fopen("$file_path/lock.tmp", "w");
14+
$lock_file = preg_replace("~\.phpt?$~", null, __FILE__);
15+
16+
$file_handle = fopen($lock_file, "w");
1517
var_dump(flock($file_handle, LOCK_SH|LOCK_NB));
1618
var_dump(flock($file_handle, LOCK_UN));
1719
var_dump(flock($file_handle, LOCK_EX));
1820
var_dump(flock($file_handle, LOCK_UN));
1921
fclose($file_handle);
20-
unlink("$file_path/lock.tmp");
22+
unlink($lock_file);
23+
24+
$lock_dir = sprintf("%s.dir", preg_replace("~\.phpt?$~", null, __FILE__));
2125

22-
mkdir("$file_path/dir");
23-
$dir_handle = opendir("$file_path/dir");
26+
mkdir($lock_dir);
27+
$dir_handle = opendir($lock_dir);
2428
var_dump(flock($dir_handle, LOCK_SH|LOCK_NB));
2529
var_dump(flock($dir_handle, LOCK_UN));
2630
var_dump(flock($dir_handle, LOCK_EX));
2731
var_dump(flock($dir_handle, LOCK_UN));
2832
closedir($dir_handle);
29-
rmdir("$file_path/dir");
33+
rmdir($lock_dir);
3034

3135
echo "\n*** Done ***\n";
3236
?>

ext/standard/tests/file/flock_error.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Description: PHP supports a portable way of locking complete files
1010

1111
echo "*** Testing error conditions ***\n";
1212

13-
$file = __DIR__."/flock.tmp";
13+
$file = preg_replace("~\.phpt?$~", null, __FILE__);
1414
$fp = fopen($file, "w");
1515

1616
/* array of operatons */

ext/standard/tests/file/flock_variation.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Description: PHP supports a portable way of locking complete files
1010

1111
echo "*** Testing flock() fun with the various operation and
1212
wouldblock values ***\n";
13-
$file = __DIR__."/flock.tmp";
13+
14+
$file = preg_replace("~\.phpt?$~", null, __FILE__);
1415
$fp = fopen($file, "w");
1516

1617
/* array of operatons */

ext/standard/tests/streams/stream_socket_enable_crypto.phpt

Lines changed: 0 additions & 66 deletions
This file was deleted.

ext/zlib/tests/bug55544.phpt

57 Bytes
Binary file not shown.

ext/zlib/tests/gzencode_variation1.phpt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ if( substr(PHP_OS, 0, 3) == "WIN" ) {
1010
if (!extension_loaded("zlib")) {
1111
print "skip - ZLIB extension not loaded";
1212
}
13+
14+
if (PHP_OS == "Darwin") {
15+
print "skip - OS is encoded in headers, tested header is non Darwin";
16+
}
1317
?>
1418
--FILE--
1519
<?php

ext/zlib/tests/gzencode_variation2.phpt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ if( substr(PHP_OS, 0, 3) == "WIN" ) {
1010
if (!extension_loaded("zlib")) {
1111
print "skip - ZLIB extension not loaded";
1212
}
13+
14+
if (PHP_OS == "Darwin") {
15+
print "skip - OS is encoded in headers, tested header is non Darwin";
16+
}
1317
?>
1418
--FILE--
1519
<?php

sapi/cli/php_cli.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,12 @@ static int do_cli(int argc, char **argv) /* {{{ */
961961
}
962962
request_started = 1;
963963
CG(start_lineno) = lineno;
964+
965+
zend_register_bool_constant(
966+
ZEND_STRL("PHP_CLI_PROCESS_TITLE"),
967+
is_ps_title_available() == PS_TITLE_SUCCESS,
968+
CONST_CS, 0);
969+
964970
*arg_excp = arg_free; /* reconstuct argv */
965971

966972
if (hide_argv) {

sapi/cli/tests/cli_get_process_title_basic.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ Patrick Allaert patrickallaert@php.net
66
--SKIPIF--
77
<?php
88
if (PHP_SAPI !== "cli")
9-
die("skip");
9+
die("skip cli process title not available in non-cli SAPI");
10+
if (!PHP_CLI_PROCESS_TITLE)
11+
die("skip process title not available (disabled or unsupported)");
1012
?>
1113
--FILE--
1214
<?php

sapi/cli/tests/cli_process_title_unix.phpt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
Check cli_process_title support on Unix
33
--SKIPIF--
44
<?php
5+
if (PHP_SAPI !== "cli")
6+
die("skip cli process title not available in non-cli SAPI");
7+
if (!PHP_CLI_PROCESS_TITLE)
8+
die("skip process title not available (disabled or unsupported)");
59
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
610
die("skip");
711
?>

sapi/cli/tests/cli_set_process_title_basic.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ Patrick Allaert patrickallaert@php.net
66
--SKIPIF--
77
<?php
88
if (PHP_SAPI !== "cli")
9-
die("skip");
9+
die("skip cli process title not available in non-cli SAPI");
10+
if (!PHP_CLI_PROCESS_TITLE)
11+
die("skip process title not available (disabled or unsupported)");
1012
?>
1113
--FILE--
1214
<?php

0 commit comments

Comments
 (0)