Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dixyes committed Dec 4, 2024
1 parent 70af3d5 commit 630cd3c
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ext/tests/swow_coroutine/autoload/require_in_autoload.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
swow_coroutine:
swow_coroutine/autoload: require in autoload
--SKIPIF--
<?php
require __DIR__ . '/../../include/skipif.php';
Expand Down
2 changes: 1 addition & 1 deletion ext/tests/swow_coroutine/autoload/yield_in_autoload.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
swow_coroutine:
swow_coroutine/autoload: yield in autoload
--SKIPIF--
<?php
require __DIR__ . '/../../include/skipif.php';
Expand Down
2 changes: 1 addition & 1 deletion ext/tests/swow_coroutine/destructor/case.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
swow_coroutine: destructor case
swow_coroutine/destructor: destructor case
--SKIPIF--
<?php
require __DIR__ . '/../../include/skipif.php';
Expand Down
2 changes: 1 addition & 1 deletion ext/tests/swow_coroutine/in_shutdown/bailout_in_main.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
swow_coroutine: bailout in main
swow_coroutine/in_shutdown: bailout in main
--SKIPIF--
<?php
require __DIR__ . '/../../include/skipif.php';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
swow_coroutine: bailout in shutdown functions
swow_coroutine/in_shutdown: bailout in shutdown functions
--SKIPIF--
<?php
require __DIR__ . '/../../include/skipif.php';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
swow_coroutine: bailout in main
swow_coroutine/in_shutdown: bailout in main
--SKIPIF--
<?php
require __DIR__ . '/../../include/skipif.php';
Expand Down
2 changes: 1 addition & 1 deletion ext/tests/swow_coroutine/in_shutdown/base.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
swow_coroutine: in_shutdown base
swow_coroutine/in_shutdown: in_shutdown base
--SKIPIF--
<?php
require __DIR__ . '/../../include/skipif.php';
Expand Down
12 changes: 12 additions & 0 deletions ext/tests/swow_misc/emptier.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--TEST--
swow_misc: empty file
--SKIPIF--
<?php
require __DIR__ . '/../include/skipif.php';
?>
--FILE--
<?php
echo "Done\n";
?>
--EXPECT--
Done
8 changes: 8 additions & 0 deletions ext/tests/swow_misc/emptiest.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
--TEST--
swow_misc: empty file
--SKIPIF--
<?php
require __DIR__ . '/../include/skipif.php';
?>
--FILE--
--EXPECT--
10 changes: 7 additions & 3 deletions ext/tests/swow_misc/weak_dep.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,21 @@ if (
) {
skip('Swow is not present in TEST_PHP_EXECUTABLE and cannot load it via -dextension');
}
$loaded3 = shell_exec(PHP_BINARY . " -n -m");
if (str_contains($loaded3, 'PDO')) {
skip('PDO is statically linked in TEST_PHP_EXECUTABLE');
}
?>
--FILE--
<?php

// get extension dir
$extension_dir = shell_exec(PHP_BINARY . " -r \"echo ini_get('extension_dir');\"");

// get TEST_PHP_ARGS TEST_PHP_EXTRA_ARGS
$args = ' ' . (getenv('TEST_PHP_ARGS') ?: '');
$args .= ' ' . (getenv('TEST_PHP_EXTRA_ARGS') ?: '');

// get extension dir
$extension_dir = shell_exec(PHP_BINARY . " $args -r \"echo ini_get('extension_dir');\"");

// remove pdo, make sure swow is loaded before any libpq dynamic lib
$args = preg_replace('/-d\s*"extension\s*=\s*pdo"/', '', $args);
$args = preg_replace('/-d\s*"extension\s*=\s*pdo_[^\s]*"/', '', $args);
Expand Down

0 comments on commit 630cd3c

Please sign in to comment.