PHP  
 PHP_HEAD
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for sapi/cli/tests/cli_process_title_unix.phpt ('Check cli_process_title support on Unix')

Script

1: <?php
2:
echo "*** Testing setting the process title ***\n";
3:
4:
$set_title $original_title uniqid("title"true);
5:
$pid getmypid();
6:
7: if (
cli_set_process_title($original_title) === true)
8:   echo 
"Successfully set title\n";
9:
10:
$ps_process_title_field "command";
11: if (
strtoupper(substr(PHP_OS03)) == "AIX")
12: {
13:   
$ps_process_title_field "args";
14: }
15:
$ps_output shell_exec("ps -p $pid -o $ps_process_title_field | tail -n 1");
16:
17: if (
$ps_output === null)
18: {
19:   echo 
"ps failed\n";
20:   die();
21: }
22:
23:
$loaded_title trim($ps_output);
24: if (
strpos(strtoupper(substr(PHP_OS013)), "BSD") !== false)
25: {
26:   
// Fix up title for BSD
27:   
$set_title "php: $original_title (php)";
28: }
29:
30: if (
$loaded_title == $set_title)
31:   echo 
"Successfully verified title using ps\n";
32: else
33:   echo 
"Actually loaded from ps: $loaded_title\n";
34:
35:
$read_title cli_get_process_title();
36: if (
$read_title == $original_title)
37:   echo 
"Successfully verified title using get\n";
38: else
39:   echo 
"Actually loaded from get: $read_title\n";
40:
41:
?>
42:

Expected

*** Testing setting the process title ***
Successfully set title
Successfully verified title using ps
Successfully verified title using get

Output

*** Testing setting the process title ***
Successfully set title
Actually loaded from ps: valgrind -q --tool=memcheck --trace-children=yes --vex-iropt-register-updates=allregs-at-mem-access --log-file=/var/php_gcov/PHP_HEAD/sapi/cli/tests/cli_process_title_unix.mem /var/php_gcov/PHP_HEAD/sapi/cli/php -n -c /var/php_gcov/PHP_HEAD/tmp-php.ini -d output_handler= -d open_basedir= -d disable_functions= -d output_buffering=Off -d error_reporting=32767 -d display_errors=1 -d display_startup_errors=1 -d log_errors=0 -d html_errors=0 -d track_errors=1 -d report_memleaks=1 -d report_zend_debug=0 -d docref_root= -d docref_ext=.html -d error_prepend_string= -d error_append_string= -d auto_prepend_file= -d auto_append_file= -d ignore_repeated_errors=0 -d precision=14 -d memory_limit=128M -d log_errors_max_len=0 -d opcache.fast_shutdown=0 -d opcache.file_update_protection=0 -d extension_dir=/var/php_gcov/PHP_HEAD/modules/ -d zend_extension=/var/php_gcov/PHP_HEAD/modules/opcache.so -d session.auto_start=0 -d tidy.clean_output=0 -d zlib.output_compression=Off -d mbstring.func_overload=0 -f /var/php_gcov/PHP_HEAD/sapi/cli/tests/cli_process_title_unix.php
Successfully verified title using get

Diff

003+ Actually loaded from ps: valgrind -q --tool=memcheck --trace-children=yes --vex-iropt-register-updates=allregs-at-mem-access --log-file=/var/php_gcov/PHP_HEAD/sapi/cli/tests/cli_process_title_unix.mem /var/php_gcov/PHP_HEAD/sapi/cli/php -n -c /var/php_gcov/PHP_HEAD/tmp-php.ini -d output_handler= -d open_basedir= -d disable_functions= -d output_buffering=Off -d error_reporting=32767 -d display_errors=1 -d display_startup_errors=1 -d log_errors=0 -d html_errors=0 -d track_errors=1 -d report_memleaks=1 -d report_zend_debug=0 -d docref_root= -d docref_ext=.html -d error_prepend_string= -d error_append_string= -d auto_prepend_file= -d auto_append_file= -d ignore_repeated_errors=0 -d precision=14 -d memory_limit=128M -d log_errors_max_len=0 -d opcache.fast_shutdown=0 -d opcache.file_update_protection=0 -d extension_dir=/var/php_gcov/PHP_HEAD/modules/ -d zend_extension=/var/php_gcov/PHP_HEAD/modules/opcache.so -d session.auto_start=0 -d tidy.clean_output=0 -d zlib.output_compression=Off -d mbstring.func_overload=0 -f /var/php_gcov/PHP_HEAD/sapi/cli/tests/cli_process_title_unix.php
003- Successfully verified title using ps

 

Generated at Tue, 27 Sep 2016 10:26:14 +0000 (17 hours ago)

Copyright © 2005-2016 The PHP Group
All rights reserved.