diff options
Diffstat (limited to 'activerecord/Rakefile')
-rwxr-xr-x | activerecord/Rakefile | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/activerecord/Rakefile b/activerecord/Rakefile index 129cdd8a7f..623dd5aaa5 100755 --- a/activerecord/Rakefile +++ b/activerecord/Rakefile @@ -27,7 +27,7 @@ task :default => [ :test_mysql, :test_sqlite, :test_postgresql ] # Run the unit tests -for adapter in %w( mysql postgresql sqlite sqlite3 firebird sqlserver sqlserver_odbc db2 oracle sybase openbase ) +for adapter in %w( mysql postgresql sqlite sqlite3 firebird sqlserver sqlserver_odbc db2 oracle sybase openbase frontbase ) Rake::TestTask.new("test_#{adapter}") { |t| t.libs << "test" << "test/connections/native_#{adapter}" t.pattern = "test/*_test{,_#{adapter}}.rb" @@ -71,6 +71,45 @@ end desc 'Rebuild the PostgreSQL test databases' task :rebuild_postgresql_databases => [:drop_postgresql_databases, :build_postgresql_databases] +desc 'Build the FrontBase test databases' +task :build_frontbase_databases => :rebuild_frontbase_databases + +desc 'Rebuild the FrontBase test databases' +task :rebuild_frontbase_databases do + build_frontbase_database = Proc.new do |db_name, sql_definition_file| + %( + STOP DATABASE #{db_name}; + DELETE DATABASE #{db_name}; + CREATE DATABASE #{db_name}; + + CONNECT TO #{db_name} AS SESSION_NAME USER _SYSTEM; + SET COMMIT FALSE; + + CREATE USER RAILS; + CREATE SCHEMA RAILS AUTHORIZATION RAILS; + COMMIT; + + SET SESSION AUTHORIZATION RAILS; + SCRIPT '#{sql_definition_file}'; + + COMMIT; + + DISCONNECT ALL; + ) + end + create_activerecord_unittest = build_frontbase_database['activerecord_unittest', File.join(SCHEMA_PATH, 'frontbase.sql')] + create_activerecord_unittest2 = build_frontbase_database['activerecord_unittest2', File.join(SCHEMA_PATH, 'frontbase2.sql')] + execute_frontbase_sql = Proc.new do |sql| + system(<<-SHELL) + /Library/FrontBase/bin/sql92 <<-SQL + #{sql} + SQL + SHELL + end + execute_frontbase_sql[create_activerecord_unittest] + execute_frontbase_sql[create_activerecord_unittest2] +end + # Generate the RDoc documentation Rake::RDocTask.new { |rdoc| |