[Groonga-commit] groonga/fluent-plugin-droonga [master] Create test runner

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Mar 28 14:35:54 JST 2013


Kouhei Sutou	2013-03-28 14:35:54 +0900 (Thu, 28 Mar 2013)

  New Revision: 1b4482a1b4039655e18e92b96f46123fbe988783
  https://github.com/groonga/fluent-plugin-droonga/commit/1b4482a1b4039655e18e92b96f46123fbe988783

  Message:
    Create test runner
    
    Move test preparations to test/run-test.rb. test/helper.rb has only
    definitions.

  Added files:
    test/run-test.rb
  Modified files:
    Rakefile
    test/helper.rb

  Modified: Rakefile (+3 -5)
===================================================================
--- Rakefile    2013-03-28 10:12:13 +0900 (b1491ed)
+++ Rakefile    2013-03-28 14:35:54 +0900 (054ef49)
@@ -16,12 +16,10 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 require "bundler/gem_tasks"
-require "rake/testtask"
 
-Rake::TestTask.new(:test) do |test|
-  test.libs << 'lib' << 'test'
-  test.pattern = 'test/**/test_*.rb'
-  test.verbose = true
+desc "Run test"
+task :test do
+  ruby(File.join(File.dirname(__FILE__), "test", "run-test.rb"))
 end
 
 task :default => :test

  Modified: test/helper.rb (+0 -28)
===================================================================
--- test/helper.rb    2013-03-28 10:12:13 +0900 (0f2c50c)
+++ test/helper.rb    2013-03-28 14:35:54 +0900 (a5830b2)
@@ -13,34 +13,6 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-require "pathname"
-
-require 'rubygems'
-require 'bundler'
-begin
-  Bundler.setup(:default, :development)
-rescue Bundler::BundlerError => e
-  $stderr.puts e.message
-  $stderr.puts "Run `bundle install` to install missing gems"
-  exit e.status_code
-end
-
-require "test-unit"
-require "test/unit/notify"
-
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
-$LOAD_PATH.unshift(File.dirname(__FILE__))
-require 'fluent/test'
-unless ENV.has_key?('VERBOSE')
-  null_logger = Object.new
-  null_logger.instance_eval do |obj|
-    def method_missing(method, *args)
-      # pass
-    end
-  end
-  $log = null_logger
-end
-
 module Sandbox
   class << self
     def included(base)

  Added: test/run-test.rb (+54 -0) 100755
===================================================================
--- /dev/null
+++ test/run-test.rb    2013-03-28 14:35:54 +0900 (52e8d4e)
@@ -0,0 +1,54 @@
+#!/usr/bin/env ruby
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2013 droonga project
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1 as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+require "pathname"
+
+require "rubygems"
+require "bundler"
+begin
+  Bundler.setup(:default, :development)
+rescue Bundler::BundlerError => e
+  $stderr.puts e.message
+  $stderr.puts "Run `bundle install` to install missing gems"
+  exit e.status_code
+end
+
+require "test-unit"
+require "test/unit/notify"
+
+require "fluent/test"
+unless ENV.has_key?("VERBOSE")
+  null_logger = Object.new
+  null_logger.instance_eval do |obj|
+    def method_missing(method, *args)
+      # pass
+    end
+  end
+  $log = null_logger
+end
+
+base_dir = File.expand_path(File.join(File.dirname(__FILE__), ".."))
+lib_dir = File.join(base_dir, "lib")
+test_dir = File.join(base_dir, "test")
+
+$LOAD_PATH.unshift(lib_dir)
+$LOAD_PATH.unshift(test_dir)
+
+require "helper"
+
+exit Test::Unit::AutoRunner.run(true, base_dir)
-------------- next part --------------
HTML����������������������������...
다운로드 



More information about the Groonga-commit mailing list
Back to archive index