mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
php: add a custom PHP runner for tests
Since the default PHP test runner ignores a good number of environment variables to potentially tampering the test suite execution, create a custom php-for-tests.sh script which does nothing more than sourcing the custom environment that our run-php-tests.sh outputs and running the actual "php" executable (the one found by configure). This fixes the loading of the guestfs_php.so module in the test suite, as the libguestfs.so.0 library can be found by that module.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -360,6 +360,7 @@ Makefile.in
|
||||
/php/extension/mkinstalldirs
|
||||
/php/extension/missing
|
||||
/php/extension/modules/
|
||||
/php/extension/php-for-tests.sh
|
||||
/php/extension/php_guestfs_php.h
|
||||
/php/extension/run-tests.php
|
||||
/php/extension/tmp-php.ini
|
||||
|
||||
@@ -1595,6 +1595,8 @@ AC_CONFIG_FILES([appliance/libguestfs-make-fixed-appliance],
|
||||
[chmod +x,-w appliance/libguestfs-make-fixed-appliance])
|
||||
AC_CONFIG_FILES([inspector/test-xmllint.sh],
|
||||
[chmod +x,-w inspector/test-xmllint.sh])
|
||||
AC_CONFIG_FILES([php/extension/php-for-tests.sh],
|
||||
[chmod +x,-w php/extension/php-for-tests.sh])
|
||||
AC_CONFIG_FILES([pick-guests.pl],
|
||||
[chmod +x,-w pick-guests.pl])
|
||||
AC_CONFIG_FILES([podwrapper.pl],
|
||||
|
||||
4
php/extension/php-for-tests.sh.in
Executable file
4
php/extension/php-for-tests.sh.in
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
. ./env
|
||||
@PHP@ $@
|
||||
@@ -45,4 +45,4 @@ TESTS=$(echo guestfs_php_*.phpt)
|
||||
echo TESTS: $TESTS
|
||||
|
||||
# PHP ignores the result of the tests!
|
||||
make test TESTS="$TESTS"
|
||||
make test TESTS="$TESTS" PHP_EXECUTABLE="$PWD/php-for-tests.sh"
|
||||
|
||||
Reference in New Issue
Block a user