mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-31 03:10:09 +02:00
Various improvements to test script command line options, i.e. --type
The following changes were made: * Create --type parameter which accepts 'htmlpurifier', 'phpt', 'vtest', etc. in order to execute only that class of tests. This supercedes --only-phpt. * Create --quick parameter for multitest.php, run only the tips of each release series. * Create --distro parameter for multitest.php, supercedes --exclude-normal and --exclude-standalone. Also, a grep for htmlt tests was added, although add_tests() doesn't do anything with it yet. Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
This commit is contained in:
@@ -2,33 +2,42 @@
|
||||
|
||||
if (!defined('HTMLPurifierTest')) exit;
|
||||
|
||||
// define callable test files (sorted alphabetically)
|
||||
// These arrays are defined by this file and can be relied upon.
|
||||
$test_files = array();
|
||||
$test_dirs = array();
|
||||
$test_dirs_exclude = array();
|
||||
$vtest_dirs = array();
|
||||
$htmlt_dirs = array();
|
||||
$phpt_dirs = array();
|
||||
|
||||
if (!$AC['only-phpt']) {
|
||||
|
||||
// HTML Purifier main library
|
||||
$test_dirs[] = 'HTMLPurifier';
|
||||
$test_files[] = 'HTMLPurifierTest.php';
|
||||
|
||||
$test_dirs_exclude['HTMLPurifier/Filter/ExtractStyleBlocksTest.php'] = true;
|
||||
if ($csstidy_location) {
|
||||
$test_files[] = 'HTMLPurifier/Filter/ExtractStyleBlocksTest.php';
|
||||
}
|
||||
|
||||
// ConfigSchema Validator tests
|
||||
$vtest_dirs[] = 'HTMLPurifier/ConfigSchema/Validator';
|
||||
|
||||
// ConfigDoc auxiliary library
|
||||
if (version_compare(PHP_VERSION, '5.2', '>=')) {
|
||||
// $test_dirs[] = 'ConfigDoc'; // no test files currently!
|
||||
}
|
||||
|
||||
// FSTools auxiliary library
|
||||
$test_dirs[] = 'FSTools';
|
||||
$break = true;
|
||||
switch ($AC['type']) {
|
||||
case '':
|
||||
$break = false;
|
||||
case 'htmlpurifier':
|
||||
$test_dirs[] = 'HTMLPurifier';
|
||||
$test_files[] = 'HTMLPurifierTest.php';
|
||||
$test_dirs_exclude['HTMLPurifier/Filter/ExtractStyleBlocksTest.php'] = true;
|
||||
if ($csstidy_location) {
|
||||
$test_files[] = 'HTMLPurifier/Filter/ExtractStyleBlocksTest.php';
|
||||
}
|
||||
if ($break) break;
|
||||
case 'configdoc':
|
||||
if (version_compare(PHP_VERSION, '5.2', '>=')) {
|
||||
// $test_dirs[] = 'ConfigDoc'; // no test files currently!
|
||||
}
|
||||
if ($break) break;
|
||||
case 'fstools':
|
||||
$test_dirs[] = 'FSTools';
|
||||
case 'htmlt':
|
||||
$htmlt_dirs[] = 'HTMLPurifier/HTMLT';
|
||||
if ($break) break;
|
||||
case 'vtest':
|
||||
$vtest_dirs[] = 'HTMLPurifier/ConfigSchema/Validator';
|
||||
if ($break) break;
|
||||
|
||||
}
|
||||
|
||||
// PHPT tests
|
||||
if (!$AC['disable-phpt'] && version_compare(PHP_VERSION, '5.2', '>=')) {
|
||||
$phpt_dirs[] = 'HTMLPurifier/PHPT';
|
||||
case 'phpt':
|
||||
if (!$AC['disable-phpt'] && version_compare(PHP_VERSION, '5.2', '>=')) {
|
||||
$phpt_dirs[] = 'HTMLPurifier/PHPT';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user