Add extension configure tests

This commit is contained in:
crazywhalecc
2024-12-05 15:48:09 +08:00
committed by Jerry Ma
parent 64258e3513
commit 45bdb6a66b
5 changed files with 172 additions and 0 deletions

13
tests/configure.php Normal file
View File

@@ -0,0 +1,13 @@
<?php
if (patch_point() === 'before-php-make') {
// get config.status file
$config_status = file_get_contents(SOURCE_PATH . '/php-src/config.status');
if ($config_status === false) {
throw patch_point_interrupt(1, 'Failed to read config.status');
}
if (str_contains($config_status, 'S["PHP_VERSION"]=""')) {
throw patch_point_interrupt(1, 'Cannot find valid PHP_VERSION in config.status');
}
throw patch_point_interrupt(0);
}