Same as for HEAD: Trying to skip tests if they can't connect to the

DB server. Note the environment variable MYSQL_TEST_SKIP_CONNECT_FAILURE
to control if you want tests that can't connect to fail or to be skipped.
This commit is contained in:
Ulf Wendel 2007-10-12 12:06:07 +00:00
parent f8156f1607
commit 3a11ec8ba1
12 changed files with 14 additions and 3 deletions

View File

@ -1,7 +1,7 @@
<?php
/*
Default values are "localhost", "root",
database "phptest" and empty password.
database "stest" and empty password.
Change the MYSQL_TEST environment values
if you want to use another configuration
*/
@ -12,9 +12,10 @@
$port = getenv("MYSQL_TEST_PORT") ? getenv("MYSQL_TEST_PORT") : 3306;
$user = getenv("MYSQL_TEST_USER") ? getenv("MYSQL_TEST_USER") : "root";
$passwd = getenv("MYSQL_TEST_PASSWD") ? getenv("MYSQL_TEST_PASSWD") : "";
$db = getenv("MYSQL_TEST_DB") ? getenv("MYSQL_TEST_DB") : "phptest";
$db = getenv("MYSQL_TEST_DB") ? getenv("MYSQL_TEST_DB") : "test";
$engine = getenv("MYSQL_TEST_ENGINE") ? getenv("MYSQL_TEST_ENGINE") : "MyISAM";
$socket = getenv("MYSQL_TEST_SOCKET") ? getenv("MYSQL_TEST_SOCKET") : null;
$skip_on_connect_failure = getenv("MYSQL_TEST_SKIP_CONNECT_FAILURE") ? getenv("MYSQL_TEST_SKIP_CONNECT_FAILURE") : true;
/* Development setting: test experimal features and/or feature requests that never worked before? */
$TEST_EXPERIMENTAL = (in_array(getenv("MYSQL_TEST_EXPERIMENTAL"), array(0, 1))) ?

View File

@ -4,6 +4,7 @@ mysqli_debug()
<?php
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
if (!function_exists('mysqli_debug'))
die("skip: mysqli_debug() not available");

View File

@ -4,6 +4,7 @@ mysqli_debug() - append to trace file
<?php
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
if (!function_exists('mysqli_debug'))
die("skip: mysqli_debug() not available");

View File

@ -4,6 +4,7 @@ mysqli_debug() - invalid debug control strings
<?php
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
if (!function_exists('mysqli_debug'))
die("skip: mysqli_debug() not available");

View File

@ -4,6 +4,7 @@ mysqli_debug() - all control string options supported by both mysqlnd and libmys
<?php
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
if (!function_exists('mysqli_debug'))
die("skip: mysqli_debug() not available");

View File

@ -4,6 +4,7 @@ mysqli_debug() - mysqlnd only control strings
<?php
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
require_once('connect.inc');
if (!function_exists('mysqli_debug'))

View File

@ -7,6 +7,7 @@ if (ini_get('unicode.semantics'))
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
require_once('connect.inc');
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {

View File

@ -7,6 +7,7 @@ if (ini_get('unicode.semantics'))
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
require_once('connect.inc');
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {

View File

@ -7,6 +7,7 @@ if (ini_get('unicode.semantics'))
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
require_once('connect.inc');
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {

View File

@ -7,6 +7,7 @@ if (ini_get('unicode.semantics'))
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
require_once('connect.inc');
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {

View File

@ -7,6 +7,7 @@ if (ini_get('unicode.semantics'))
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
require_once('connect.inc');
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {

View File

@ -1,5 +1,5 @@
<?php
$skip_on_connect_failure = getenv("MYSQL_TEST_SKIP_CONNECT_FAILURE") ? getenv("MYSQL_TEST_SKIP_CONNECT_FAILURE") : false;
require_once('connect.inc');
if ($skip_on_connect_failure) {
include_once('connect.inc');
$link = @mysqli_connect($host, $user, $passwd, $db, $port, $socket);