[Groonga-commit] groonga/groonga-test [master] [test] add

Back to archive index

null+****@clear***** null+****@clear*****
2012年 3月 6日 (火) 16:37:55 JST


Kouhei Sutou	2012-03-06 16:37:55 +0900 (Tue, 06 Mar 2012)

  New Revision: 79712462e7989a010e871bdba8d522ab7468df3c

  Log:
    [test] add

  Added files:
    test/run-test.rb
    test/test-executor.rb

  Added: test/run-test.rb (+28 -0) 100755
===================================================================
--- /dev/null
+++ test/run-test.rb    2012-03-06 16:37:55 +0900 (a5eeaa1)
@@ -0,0 +1,28 @@
+#!/usr/bin/env ruby
+#
+# Copyright (C) 2012  Kouhei Sutou <kou****@clear*****>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+$VERBOSE = true
+
+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)
+
+require 'test-unit'
+
+exit(Test::Unit::AutoRunner.run(true))

  Added: test/test-executor.rb (+41 -0) 100644
===================================================================
--- /dev/null
+++ test/test-executor.rb    2012-03-06 16:37:55 +0900 (676575f)
@@ -0,0 +1,41 @@
+# Copyright (C) 2012  Kouhei Sutou <kou****@clear*****>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+require "stringio"
+require "groonga/tester"
+
+class TestExecutor < Test::Unit::TestCase
+  def setup
+    @groonga = StringIO.new
+    @executor = Groonga::Tester::Executor.new(@groonga)
+    @context =****@execu*****
+    @script = Tempfile.new("test-executor")
+  end
+
+  private
+  def execute(command)
+    @script.print(command)
+    @script.close
+    @executor.execute(Pathname(@script.path))
+  end
+
+  class TestComment < self
+    def test_disable_logging
+      assert_predicate(@context, :logging?)
+      execute("# disable-logging")
+      assert_not_predicate(@context, :logging?)
+    end
+  end
+end




Groonga-commit メーリングリストの案内
Back to archive index