736f997ba8
Debugger tests that run hphp in non local mode (i.e. with the "-h some-server:some-port" option specified) currently use a clunky specialized C++ test harness that invokes PHP scripts that talk to the debugger client via the obsolete client API. This revision moves those tests to the new PHP only framework. The debugger client is now controlled by piping in commands, just like the other debugger tests. The main difference is that the debugger client is connected to a server instance and a separate PHP driver is used to load the server, load the client, and then load pages from the server so that the client can hit breakpoints. It also checks that the client can respond to ctrl-c by actually sending a SIGINT signal to the client process.
24 linhas
883 B
PHP
24 linhas
883 B
PHP
<?php
|
|
|
|
require_once('test_base.php');
|
|
|
|
function test1Controller($hphpdOutput, $hphpdProcessId, $serverPort) {
|
|
// Request a page so that the client can debug it.
|
|
waitForClientToOutput($hphpdOutput, "Waiting for server response");
|
|
$url = "http://".php_uname('n').':'.$serverPort.'/test1.php';
|
|
echo "Requesting test1.php\n";
|
|
request($url, 1); // proceed without waiting for a response
|
|
|
|
// Send ctrl-c to client, which is waiting for a hung server
|
|
waitForClientToOutput($hphpdOutput, "Break at cls::pubHardBreak()");
|
|
waitForClientToOutput($hphpdOutput, "Waiting for server response");
|
|
sleep(2); // give server a chance to get itself in the enless loop
|
|
echo "sending SIGINT to the debugger client.\n";
|
|
posix_kill($hphpdProcessId, SIGINT);
|
|
|
|
// Let client run until script quits
|
|
waitForClientToOutput($hphpdOutput, "quit");
|
|
}
|
|
|
|
runTest('test1', "test1Controller");
|