Permalink
Browse files

Fixed autotest support (needs latest version of zentest).

Minor clean up on bin/ci and kernel/core/module.rb.
Hacked mspec/matchers/base.rb to output with pretty print.
Fixed mspec's runner to output time BEFORE failures. Fixes unit_diff.
Updated Parser excludes.
Deleted a bunch of excludes.
Updated spec/parser/sexp_expectations.rb with latest ParseTreeTestCase.
Started adding a rewriter to make maintaining sexp_expectations easier.
  • Loading branch information...
1 parent d147f6f commit 76b393566f2a89001952dbf1ec46dd52a5750448 @zenspider zenspider committed Jan 26, 2008
Showing with 2,384 additions and 1,165 deletions.
  1. +15 −15 .autotest
  2. +6 −3 bin/ci
  3. +7 −3 kernel/core/module.rb
  4. +26 −20 mspec/matchers/base.rb
  5. +1 −1 mspec/runner/formatters/base.rb
  6. +65 −32 spec/data/parser/sexp_excludes.txt
  7. +2,229 −1,090 spec/parser/sexp_expectations.rb
  8. +35 −1 spec/parser/sexp_spec.rb
View
@@ -1,5 +1,7 @@
# -*- ruby -*-
+$q = true
+
Autotest.add_hook :run_command do |at|
system "rake"
end
@@ -9,31 +11,29 @@ class Autotest
alias :old_make_test_cmd :make_test_cmd
def ruby
- "MSPEC_RUNNER=1 AUTOTEST=1 shotgun/rubinius"
+ "bin/ci"
end
def make_test_cmd files_to_test
- cmds = []
- full, partial = files_to_test.partition { |k,v| v.empty? }
-
- unless full.empty? then
- classes = full.map {|k,v| k}.flatten.uniq.sort.join(' ')
-
- cmds << "#{ruby} -I#{@libs} -e \"puts 'Started autotest'; %w[#{classes}].each { |f| require f }\" | #{unit_diff}"
- end
-
- partial.each do |klass, methods|
- cmds << "#{ruby} -I#{@libs} #{klass} -n \"/^(#{Regexp.union(*methods).source})$/\" | #{unit_diff}"
- end
-
- return cmds.join("#{SEP} ")
+ # until bin/ci and bin/mspec allow for regexps, run the whole file again
+ classes = reorder(files_to_test).map { |k,v| k }.join(' ')
+ "#{ruby} #{classes} | #{unit_diff}"
end
end
Autotest.add_hook :initialize do |at|
+ at.order = :natural
+
at.add_exception(/\.rbc$/)
at.add_exception(/\.txt$/)
at.add_exception(/fixtures/)
+ at.add_exception(/\/data\//)
+
+ at.test_directories.clear
+ at.test_directories.push('spec/ruby/1.8/core',
+ 'spec/ruby/1.8/language',
+ 'spec/compiler',
+ 'spec/parser')
at.add_mapping %r%^spec/.*_spec\.rb$% do |filename, _|
filename
View
9 bin/ci
@@ -1,6 +1,9 @@
#!/usr/bin/env ruby
-CI_FILE_SPECS = ['spec/ruby/1.8/core', 'spec/ruby/1.8/language', 'spec/compiler', 'spec/parser']
-CI_EXCLUDES_DIR = File.expand_path(File.dirname(__FILE__) + '/../spec/data')
+CI_FILE_SPECS = ['spec/ruby/1.8/core',
+ 'spec/ruby/1.8/language',
+ 'spec/compiler',
+ 'spec/parser']
+CI_EXCLUDES_DIR = File.expand_path('spec/data')
-require File.dirname(__FILE__) + '/../mspec/scripts/ci'
+require File.expand_path('mspec/scripts/ci')
View
@@ -433,7 +433,7 @@ def set_visibility(meth, vis)
def set_class_visibility(meth, vis)
# HACK this is called again in set_visibility
unless find_class_method_in_hierarchy meth.to_sym then
- raise NoMethodError, "Unknown class method '#{name}' to make #{vis.to_s}"
+ raise NoMethodError, "Unknown class method '#{name}' to make #{vis}"
end
metaclass.set_visibility meth, vis
@@ -468,12 +468,16 @@ def public(*args)
end
def private_class_method(*args)
- args.each { |meth| set_class_visibility(meth, :private) }
+ args.each do |meth|
+ set_class_visibility(meth, :private)
+ end
self
end
def public_class_method(*args)
- args.each { |meth| set_class_visibility(meth, :public) }
+ args.each do |meth|
+ set_class_visibility(meth, :public)
+ end
self
end
View
@@ -1,45 +1,49 @@
+require 'pp'
+
class PositiveOperatorMatcher
def initialize(actual)
@actual = actual
end
def ==(expected)
unless @actual == expected
- Expectation.fail_with("Expected #{@actual.inspect}", "to equal #{expected.inspect}")
+ Expectation.fail_with("Expected #{@actual.pretty_inspect}",
+ "to equal #{expected.pretty_inspect}")
end
end
def <(expected)
unless @actual < expected
- Expectation.fail_with("Expected #{@actual.inspect}",
- "to be less than #{expected.inspect}")
+ Expectation.fail_with("Expected #{@actual.pretty_inspect}",
+ "to be less than #{expected.pretty_inspect}")
end
end
def <=(expected)
unless @actual <= expected
- Expectation.fail_with("Expected #{@actual.inspect}",
- "to be less than or equal to #{expected.inspect}")
+ Expectation.fail_with("Expected #{@actual.pretty_inspect}",
+ "to be less than or equal to #{expected.pretty_inspect}")
end
end
def >(expected)
unless @actual > expected
- Expectation.fail_with("Expected #{@actual.inspect}",
- "to be greater than #{expected.inspect}")
+ Expectation.fail_with("Expected #{@actual.pretty_inspect}",
+ "to be greater than #{expected.pretty_inspect}")
end
end
def >=(expected)
unless @actual >= expected
- Expectation.fail_with("Expected #{@actual.inspect}",
- "to be greater than or equal to #{expected.inspect}")
+ Expectation.fail_with("Expected #{@actual.pretty_inspect}",
+ "to be greater than or equal to #{expected.pretty_inspect}")
end
end
def =~(expected)
unless @actual =~ expected
- Expectation.fail_with("Expected #{@actual.inspect}", "to match #{expected.inspect}")
+ Expectation.fail_with("Expected #{@actual.pretty_inspect}",
+ "to match #{expected.pretty_inspect}")
end
end
end
@@ -51,41 +55,43 @@ def initialize(actual)
def ==(expected)
if @actual == expected
- Expectation.fail_with("Expected #{@actual.inspect}", "not to equal #{expected.inspect}")
+ Expectation.fail_with("Expected #{@actual.pretty_inspect}",
+ "not to equal #{expected.pretty_inspect}")
end
end
def <(expected)
if @actual < expected
- Expectation.fail_with("Expected #{@actual.inspect}",
- "not to be less than #{expected.inspect}")
+ Expectation.fail_with("Expected #{@actual.pretty_inspect}",
+ "not to be less than #{expected.pretty_inspect}")
end
end
def <=(expected)
if @actual <= expected
- Expectation.fail_with("Expected #{@actual.inspect}",
- "not to be less than or equal to #{expected.inspect}")
+ Expectation.fail_with("Expected #{@actual.pretty_inspect}",
+ "not to be less than or equal to #{expected.pretty_inspect}")
end
end
def >(expected)
if @actual > expected
- Expectation.fail_with("Expected #{@actual.inspect}",
- "not to be greater than #{expected.inspect}")
+ Expectation.fail_with("Expected #{@actual.pretty_inspect}",
+ "not to be greater than #{expected.pretty_inspect}")
end
end
def >=(expected)
if @actual >= expected
- Expectation.fail_with("Expected #{@actual.inspect}",
- "not to be greater than or equal to #{expected.inspect}")
+ Expectation.fail_with("Expected #{@actual.pretty_inspect}",
+ "not to be greater than or equal to #{expected.pretty_inspect}")
end
end
def =~(expected)
if @actual =~ expected
- Expectation.fail_with("Expected #{@actual.inspect}", "not to match #{expected.inspect}")
+ Expectation.fail_with("Expected #{@actual.pretty_inspect}",
+ "not to match #{expected.pretty_inspect}")
end
end
end
@@ -183,11 +183,11 @@ def print_summary
def summary
unless @summarized
@out.print "\n\n"
+ print_time
@exceptions.each_with_index do |r,i|
print_failure(i+1,r)
print_backtrace(r.exception)
end
- print_time
print_summary
@summarized = true
end
@@ -1,85 +1,118 @@
Shotgun converts a class definition to an sexp
-Producing sexps from source code succeeds for a node of type :defn_empty
+Producing sexps from source code succeeds for a node of type :dasgn_icky
+Producing sexps from source code succeeds for a node of type :defn_args_mand_opt_splat_block
Producing sexps from source code succeeds for a node of type :defn_rescue
+Producing sexps from source code succeeds for a node of type :iteration9
+Producing sexps from source code succeeds for a node of type :lit_regexp_i_wwtt
+Producing sexps from source code succeeds for a node of type :masgn_splat_no_name_trailing
Producing sexps from source code succeeds for a node of type :match3
Producing sexps from source code succeeds for a node of type :rescue
-Producing sexps from source code succeeds for a node of type :bmethod
+Producing sexps from source code succeeds for a node of type :str_interp_file
+Producing sexps from source code succeeds for a node of type :dasgn_2
Producing sexps from source code succeeds for a node of type :defn_or
Producing sexps from source code succeeds for a node of type :dsym
-Producing sexps from source code succeeds for a node of type :ivar
-Producing sexps from source code succeeds for a node of type :lasgn_call
+Producing sexps from source code succeeds for a node of type :iteration8
Producing sexps from source code succeeds for a node of type :lit_regexp
+Producing sexps from source code succeeds for a node of type :lit_regexp_once
Producing sexps from source code succeeds for a node of type :match2
+Producing sexps from source code succeeds for a node of type :op_asgn2_self
+Producing sexps from source code succeeds for a node of type :structure_unused_literal_wwtt
Producing sexps from source code succeeds for a node of type :block_pass_omgwtf
Producing sexps from source code succeeds for a node of type :conditional4
-Producing sexps from source code succeeds for a node of type :dmethod
+Producing sexps from source code succeeds for a node of type :dasgn_1
+Producing sexps from source code succeeds for a node of type :dstr_heredoc_yet_again
Producing sexps from source code succeeds for a node of type :flip3
Producing sexps from source code succeeds for a node of type :rescue_exceptions
-Producing sexps from source code succeeds for a node of type :undef
-Producing sexps from source code succeeds for a node of type :class_plain
-Producing sexps from source code succeeds for a node of type :dasgn
+Producing sexps from source code succeeds for a node of type :begin_rescue_twice
+Producing sexps from source code succeeds for a node of type :dasgn_0
+Producing sexps from source code succeeds for a node of type :defn_args_mand_opt_splat
+Producing sexps from source code succeeds for a node of type :defn_args_mand_opt_splat_no_name
Producing sexps from source code succeeds for a node of type :flip2
Producing sexps from source code succeeds for a node of type :masgn
-Producing sexps from source code succeeds for a node of type :proc_args
Producing sexps from source code succeeds for a node of type :block_pass_splat
Producing sexps from source code succeeds for a node of type :case_nested
Producing sexps from source code succeeds for a node of type :case_no_expr
Producing sexps from source code succeeds for a node of type :class_super_expr
Producing sexps from source code succeeds for a node of type :conditional2
-Producing sexps from source code succeeds for a node of type :cvasgn
-Producing sexps from source code succeeds for a node of type :defn_args
+Producing sexps from source code succeeds for a node of type :defn_args_opt_block
Producing sexps from source code succeeds for a node of type :defs
+Producing sexps from source code succeeds for a node of type :lvar_def_boundary
Producing sexps from source code succeeds for a node of type :masgn_iasgn
-Producing sexps from source code succeeds for a node of type :masgn_splat
+Producing sexps from source code succeeds for a node of type :splat
Producing sexps from source code succeeds for a node of type :conditional3
+Producing sexps from source code succeeds for a node of type :defn_empty_args
Producing sexps from source code succeeds for a node of type :dregx_once
-Producing sexps from source code succeeds for a node of type :dxstr
+Producing sexps from source code succeeds for a node of type :iteration_dasgn_curr_dasgn_madness
Producing sexps from source code succeeds for a node of type :masgn_attrasgn
-Producing sexps from source code succeeds for a node of type :bmethod_splat
+Producing sexps from source code succeeds for a node of type :proc_args_1
Producing sexps from source code succeeds for a node of type :class_super_array
+Producing sexps from source code succeeds for a node of type :defn_optargs
Producing sexps from source code succeeds for a node of type :dregx
+Producing sexps from source code succeeds for a node of type :proc_args_2
+Producing sexps from source code succeeds for a node of type :block_mystery_block
Producing sexps from source code succeeds for a node of type :conditional1
+Producing sexps from source code succeeds for a node of type :defn_lvar_boundary
+Producing sexps from source code succeeds for a node of type :hash_rescue
+Producing sexps from source code succeeds for a node of type :iteration_double_var
+Producing sexps from source code succeeds for a node of type :structure_extra_block_for_dvar_scoping
Producing sexps from source code succeeds for a node of type :yield
-Producing sexps from source code succeeds for a node of type :attrset
-Producing sexps from source code succeeds for a node of type :defn_is_something
-Producing sexps from source code succeeds for a node of type :fbody
-Producing sexps from source code succeeds for a node of type :dstr
-Producing sexps from source code succeeds for a node of type :lasgn_array
+Producing sexps from source code succeeds for a node of type :block_stmt_before
+Producing sexps from source code succeeds for a node of type :block_stmt_both
+Producing sexps from source code succeeds for a node of type :defn_splat_no_name
+Producing sexps from source code succeeds for a node of type :defs_args_mand_opt_splat_block
+Producing sexps from source code succeeds for a node of type :defs_empty
+Producing sexps from source code succeeds for a node of type :defs_empty_args
+Producing sexps from source code succeeds for a node of type :call_arglist_norm_hash
Producing sexps from source code succeeds for a node of type :op_asgn_or
-Producing sexps from source code succeeds for a node of type :super
-Producing sexps from source code succeeds for a node of type :zarray
+Producing sexps from source code succeeds for a node of type :undef_block_wtf
+Producing sexps from source code succeeds for a node of type :call_arglist_hash
+Producing sexps from source code succeeds for a node of type :cvasgn_cls_method
+Producing sexps from source code succeeds for a node of type :dregx_interp
Producing sexps from source code succeeds for a node of type :iteration3
Producing sexps from source code succeeds for a node of type :lit_range3
Producing sexps from source code succeeds for a node of type :match
-Producing sexps from source code succeeds for a node of type :svalue
+Producing sexps from source code succeeds for a node of type :sclass_trailing_class
Producing sexps from source code succeeds for a node of type :to_ary
Producing sexps from source code succeeds for a node of type :valias
Producing sexps from source code succeeds for a node of type :yield_arg
Producing sexps from source code succeeds for a node of type :attrasgn
Producing sexps from source code succeeds for a node of type :cdecl
+Producing sexps from source code succeeds for a node of type :defn_args_opt_splat_no_name
+Producing sexps from source code succeeds for a node of type :fcall_arglist_hash
Producing sexps from source code succeeds for a node of type :iteration2
Producing sexps from source code succeeds for a node of type :lit_range2
-Producing sexps from source code succeeds for a node of type :undef_multi
-Producing sexps from source code succeeds for a node of type :zsuper
+Producing sexps from source code succeeds for a node of type :lit_regexp_n
+Producing sexps from source code succeeds for a node of type :alias_ugh
+Producing sexps from source code succeeds for a node of type :block_pass_args_and_splat
+Producing sexps from source code succeeds for a node of type :dasgn_mixed
Producing sexps from source code succeeds for a node of type :ensure
-Producing sexps from source code succeeds for a node of type :iteration5
+Producing sexps from source code succeeds for a node of type :fcall_arglist_norm_hash_splat
+Producing sexps from source code succeeds for a node of type :lit_long_negative
+Producing sexps from source code succeeds for a node of type :masgn_masgn
+Producing sexps from source code succeeds for a node of type :masgn_splat_no_name_to_ary
+Producing sexps from source code succeeds for a node of type :block_stmt_after
+Producing sexps from source code succeeds for a node of type :call_arglist_norm_hash_splat
Producing sexps from source code succeeds for a node of type :case
-Producing sexps from source code succeeds for a node of type :cvdecl
-Producing sexps from source code succeeds for a node of type :for
+Producing sexps from source code succeeds for a node of type :dstr_str_lit_start
Producing sexps from source code succeeds for a node of type :iteration4
Producing sexps from source code succeeds for a node of type :op_asgn1
Producing sexps from source code succeeds for a node of type :op_asgn_and
+Producing sexps from source code succeeds for a node of type :op_asgn_or_block
Producing sexps from source code succeeds for a node of type :sclass
-Producing sexps from source code succeeds for a node of type :super_multi
-Producing sexps from source code succeeds for a node of type :argscat
+Producing sexps from source code succeeds for a node of type :structure_remove_begin_1
Producing sexps from source code succeeds for a node of type :back_ref
+Producing sexps from source code succeeds for a node of type :case_splat
Producing sexps from source code succeeds for a node of type :class_super_object
Producing sexps from source code succeeds for a node of type :dasgn_curr
+Producing sexps from source code succeeds for a node of type :defn_args_mand_opt_block
Producing sexps from source code succeeds for a node of type :defn_zarray
+Producing sexps from source code succeeds for a node of type :fcall_arglist_norm_hash
+Producing sexps from source code succeeds for a node of type :iteration7
+Producing sexps from source code succeeds for a node of type :iteration_masgn
Producing sexps from source code succeeds for a node of type :op_asgn2
Producing sexps from source code succeeds for a node of type :rescue_block_body
-Producing sexps from source code succeeds for a node of type :rescue_block_nada
-Producing sexps from source code succeeds for a node of type :yield_args
+Producing sexps from source code succeeds for a node of type :structure_remove_begin_2
Producing sexps from source code succeeds for a node of type :alias
+Producing sexps from source code succeeds for a node of type :case_nested_inner_no_expr
+Producing sexps from source code succeeds for a node of type :dstr_the_revenge
Producing sexps from source code succeeds for a node of type :iteration6
-Producing sexps from source code succeeds for a node of type :module
Oops, something went wrong.

0 comments on commit 76b3935

Please sign in to comment.