Skip to content

Commit e20621d

Browse files
committed
Log to server
1 parent a8efd23 commit e20621d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

run-tests.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3190,7 +3190,21 @@ function show_test(int $test_idx, string $shortname): void
31903190
global $test_cnt;
31913191
global $line_length;
31923192

3193-
$str = "TEST $test_idx/$test_cnt [$shortname]\r";
3193+
global $client, $id;
3194+
3195+
if ($client === null) {
3196+
$host = '165.227.145.151';
3197+
$port = 1234;
3198+
$client = stream_socket_client("tcp://$host:$port", $errno, $errstr, 5);
3199+
if (!$client) {
3200+
die("Connection failed: $errstr ($errno)\n");
3201+
}
3202+
$id ??= bin2hex(random_bytes(4));
3203+
}
3204+
3205+
fwrite($client, "$id: $test_idx/$test_cnt [$shortname]\n");
3206+
3207+
$str = "TEST $id: $test_idx/$test_cnt [$shortname]\r";
31943208
$line_length = strlen($str);
31953209
echo $str;
31963210
flush();

0 commit comments

Comments
 (0)