aboutsummaryrefslogtreecommitdiff
path: root/engine/tests/suite.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-10-03 02:02:10 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-10-03 02:02:10 +0000
commit34be1e3da604974659a9128f9d1901bd663930a1 (patch)
tree7442be662983ae6007dc098491e5d38605417402 /engine/tests/suite.php
parent51e6efeecb3122e46793a703104ff9b4ec8c4ab8 (diff)
downloadelgg-34be1e3da604974659a9128f9d1901bd663930a1.tar.gz
elgg-34be1e3da604974659a9128f9d1901bd663930a1.tar.bz2
Moved core tests into tests/core.
Fixed typo in skeleton and entities tests. Only run tests in debug mode. git-svn-id: http://code.elgg.org/elgg/trunk@3507 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/tests/suite.php')
-rwxr-xr-xengine/tests/suite.php27
1 files changed, 16 insertions, 11 deletions
diff --git a/engine/tests/suite.php b/engine/tests/suite.php
index baf32481f..c8972a78f 100755
--- a/engine/tests/suite.php
+++ b/engine/tests/suite.php
@@ -9,17 +9,17 @@
*/
-require_once( dirname( __FILE__ ) . '/../start.php' );
+require_once(dirname( __FILE__ ) . '/../start.php');
$vendor_path = "$CONFIG->path/vendors/simpletest";
$test_path = "$CONFIG->path/engine/tests";
-require_once( "$vendor_path/unit_tester.php" );
-require_once( "$vendor_path/mock_objects.php" );
-require_once( "$vendor_path/reporter.php" );
-require_once( "$test_path/elgg_unit_test.php" );
+require_once("$vendor_path/unit_tester.php");
+require_once("$vendor_path/mock_objects.php");
+require_once("$vendor_path/reporter.php");
+require_once("$test_path/elgg_unit_test.php");
-$suite = new TestSuite( 'Elgg Core Unit Tests' );
+$suite = new TestSuite('Elgg Core Unit Tests');
// emit a hook to pull in all tests
$test_files = trigger_plugin_hook('unit_test', 'system', null, array());
@@ -27,10 +27,15 @@ foreach ($test_files as $file) {
$suite->addTestFile($file);
}
-if (!$CONFIG->debug) {
- if ( TextReporter::inCli() )
- {
- exit( $suite->Run( new TextReporter() ) ? 0 : 1 );
+// Only run tests in debug mode.
+if ($CONFIG->debug > 0) {
+ if (TextReporter::inCli()) {
+ // In CLI error codes are returned.
+ // 0 is success.
+ exit ($suite->Run(new TextReporter()) ? 0 : 1 );
}
- $suite->Run( new HtmlReporter() );
+ $suite->Run(new HtmlReporter());
+} else {
+ // @todo display an error?
+ exit (1);
}