diff options
author | Josh Hoyt <josh@janrain.com> | 2006-09-20 18:28:27 +0000 |
---|---|---|
committer | Josh Hoyt <josh@janrain.com> | 2006-09-20 18:28:27 +0000 |
commit | b42521174e7a8c4713284a1ca05b9491ab463cb4 (patch) | |
tree | 17e9b246558934a373b15195ce2aa8135624b783 | |
parent | d248528fa62f77b57464e29ed39b0c67839b4f66 (diff) | |
download | php-openid-b42521174e7a8c4713284a1ca05b9491ab463cb4.zip php-openid-b42521174e7a8c4713284a1ca05b9491ab463cb4.tar.gz php-openid-b42521174e7a8c4713284a1ca05b9491ab463cb4.tar.bz2 |
[project @ Add math library selection support to the test suite]
-rw-r--r-- | admin/texttest.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/admin/texttest.php b/admin/texttest.php index 40145ce..0f7d1ad 100644 --- a/admin/texttest.php +++ b/admin/texttest.php @@ -43,6 +43,40 @@ function microtime_float() // Drop $argv[0] (command name) array_shift($argv); +// ******** Math library selection *********** + +$t = array_search('--no-math', $argv); +if ($t !== false && $t !== null) { + define('Auth_OpenID_NO_MATH_SUPPORT', true); +} else { + $math_libs = array(); + foreach ($argv as $arg) { + $ret = preg_match('/^--math-lib=(.*)$/', $arg, $matches); + if ($ret) { + $math_libs[] = $matches[1]; + } + } + + if ($math_libs) { + require_once('Auth/OpenID/BigMath.php'); + $new_extensions = array(); + foreach ($math_libs as $lib) { + foreach ($_Auth_OpenID_math_extensions as $ext) { + if ($ext['extension'] == $lib) { + $new_extensions[] = $ext; + } + } + } + if ($new_extensions) { + $_Auth_OpenID_math_extensions = $new_extensions; + } else { + trigger_error(var_export($math_libs, true), E_USER_ERROR); + } + } +} + +// ******** End math library selection ********** + $t = array_search('--thorough', $argv); if ($t !== false && $t !== null) { define('Tests_Auth_OpenID_thorough', true); |