Kouhei Sutou
null+****@clear*****
Sat Aug 11 20:00:27 JST 2012
Kouhei Sutou 2012-08-11 20:00:27 +0900 (Sat, 11 Aug 2012) New Revision: 6d7784ceac1d72b8c0cde995f386890d898e3fb4 https://github.com/groonga/grntest/commit/6d7784ceac1d72b8c0cde995f386890d898e3fb4 Log: Add --exclude-test-suite Modified files: lib/groonga/tester.rb Modified: lib/groonga/tester.rb (+25 -6) =================================================================== --- lib/groonga/tester.rb 2012-08-11 19:56:16 +0900 (b737ceb) +++ lib/groonga/tester.rb 2012-08-11 20:00:27 +0900 (019afad) @@ -120,11 +120,14 @@ module Groonga "Exclude test that name is NAME", "If NAME is /.../, NAME is treated as regular expression", "This option can be used multiple times") do |name| - if /\A\/(.+)\/\z/ =~ name - tester.exclude_test_patterns << Regexp.new($1, Regexp::IGNORECASE) - else - tester.exclude_test_patterns << name - end + tester.exclude_test_patterns << parse_name_or_pattern(name) + end + + parser.on("--exclude-test-suite=NAME", + "Exclude test suite that name is NAME", + "If NAME is /.../, NAME is treated as regular expression", + "This option can be used multiple times") do |name| + tester.exclude_test_suite_patterns << parse_name_or_pattern(name) end parser.on("--n-workers=N", Integer, @@ -164,6 +167,14 @@ module Groonga parser end + + def parse_name_or_pattern(name) + if /\A\/(.+)\/\z/ =~ name + Regexp.new($1, Regexp::IGNORECASE) + else + name + end + end end attr_accessor :groonga, :groonga_httpd, :groonga_suggest_create_dataset @@ -173,7 +184,7 @@ module Groonga attr_accessor :output attr_accessor :gdb, :default_gdb attr_writer :reporter, :keep_database, :use_color - attr_reader :exclude_test_patterns + attr_reader :exclude_test_patterns, :exclude_test_suite_patterns def initialize @groonga = "groonga" @groonga_httpd = "groonga-httpd" @@ -187,6 +198,7 @@ module Groonga @keep_database = false @use_color = nil @exclude_test_patterns = [] + @exclude_test_suite_patterns = [] detect_suitable_diff initialize_debuggers end @@ -228,6 +240,12 @@ module Groonga end end + def exclude_test_suite?(test_suite_name) + @exclude_test_suite_patterns.any? do |pattern| + pattern === test_suite_name + end + end + private def load_tests(*targets) default_group_name = "." @@ -491,6 +509,7 @@ module Groonga def run_test_suites(test_suites) queue = Queue.new test_suites.each do |suite_name, test_script_paths| + next if****@teste*****_test_suite?(suite_name) test_script_paths.each do |test_script_path| test_name = test_script_path.basename(".*").to_s next if****@teste*****_test?(test_name) -------------- next part -------------- HTML����������������������������... 다운로드