Menu

[r129]: / trunk / testing / unit-tests.php  Maximize  Restore  History

Download this file

41 lines (32 with data), 1.2 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**@file
* Script for unit testing, allows for more fine grained error reporting
* when things go wrong.
* @author Edward Z. Yang <admin@htmlpurifier.org>
*/
error_reporting(E_ALL);
// Configuration
$simpletest_location = 'simpletest/';
if (file_exists('../test-settings.php')) include_once '../test-settings.php';
// Includes
require_once '../class.csstidy.php';
require_once 'Text/Diff.php';
require_once 'Text/Diff/Renderer.php';
require_once $simpletest_location . 'unit_tester.php';
require_once $simpletest_location . 'reporter.php';
require_once 'unit-tests/class.csstidy_reporter.php';
require_once 'unit-tests/class.csstidy_harness.php';
require_once 'unit-tests.inc';
// Test files
$test_files = array();
require 'unit-tests/_files.php';
// Setup test files
$test = new GroupTest('CSSTidy unit tests');
foreach ($test_files as $test_file) {
require_once "unit-tests/$test_file";
list($x, $class_suffix) = explode('.', $test_file);
$test->addTestClass("csstidy_test_$class_suffix");
}
if (SimpleReporter::inCli()) $reporter = new TextReporter();
else $reporter = new csstidy_reporter('UTF-8');
$test->run($reporter);
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.