[Rt-commit] r7147 - in rt/branches/3.7-EXPERIMENTAL-TUNIS: . lib/RT t t/api

clkao at bestpractical.com clkao at bestpractical.com
Mon Mar 5 08:50:08 EST 2007


Author: clkao
Date: Mon Mar  5 08:50:08 2007
New Revision: 7147

Added:
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/
   rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/date.t
      - copied, changed from r7141, /rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/t/regression/09-api-date.t
Removed:
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/t/regression/09-api-date.t
Modified:
   rt/branches/3.7-EXPERIMENTAL-TUNIS/Makefile.in
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Test.pm

Log:
"make test" starts working.

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/Makefile.in
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/Makefile.in	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/Makefile.in	Mon Mar  5 08:50:08 2007
@@ -347,8 +347,11 @@
 
 	@echo "Installed configuration. about to install rt in  $(RT_PATH)"
 
+TEST_FILES = t/*.t t/*/*.t
+TEST_VERBOSE = 0
+
 test: 
-	$(PERL) -Ilib lib/t/00smoke.t
+	$(PERL) "-MExtUtils::Command::MM" $(HARNESS_PERL_SWITCHES) -e "test_harness($(TEST_VERBOSE), 'lib')" $(TEST_FILES)
 
 regression-install: config-install
 	$(PERL) -pi -e 's/Set\(\$$DatabaseName.*\);/Set\(\$$DatabaseName, "rt3regression"\);/' $(DESTDIR)/$(CONFIG_FILE)

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Test.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Test.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Test.pm	Mon Mar  5 08:50:08 2007
@@ -33,14 +33,17 @@
 my @server;
 
 sub import {
+    my $class = shift;
     require RT::Handle;
-    RT::Handle->drop_db(undef, { force => 1});
-    RT::Handle->create_db;
+    unless ( $_[0] eq 'nodb' ) {
+        RT::Handle->drop_db( undef, { force => 1 } );
+        RT::Handle->create_db;
 
-    RT->ConnectToDatabase;
-    $RT::Handle->insert_schema($dbh);
-    $RT::Handle->insert_initial_data();
-    $RT::Handle->insert_data( $RT::EtcPath . "/initialdata" );
+        RT->ConnectToDatabase;
+        $RT::Handle->insert_schema($dbh);
+        $RT::Handle->insert_initial_data();
+        $RT::Handle->insert_data( $RT::EtcPath . "/initialdata" );
+    }
     RT::Init;
 }
 

Copied: rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/date.t (from r7141, /rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/t/regression/09-api-date.t)
==============================================================================
--- /rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/t/regression/09-api-date.t	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/t/api/date.t	Mon Mar  5 08:50:08 2007
@@ -1,13 +1,9 @@
 #!/usr/bin/perl
 
-use Test::More qw/no_plan/;
-#use Test::More tests => 25;
+use Test::More tests => 164;
 
 use warnings; use strict;
-use RT;
-RT::LoadConfig();
-RT::Init();
-
+use RT::Test;
 use RT::User;
 
 use_ok('RT::Date');


More information about the Rt-commit mailing list