Permalink
Browse files

Use reference debugger for --spec-debug if rbx is running.

  • Loading branch information...
1 parent c9737e6 commit 2e0868606f34498a1fb689764741fd2c489b95ee @brixen brixen committed Jan 6, 2011
View
@@ -1,6 +1,10 @@
-require 'spec/custom/utils/script'
-require 'spec/custom/matchers/compile_as'
-require 'spec/custom/helpers/generator'
-require 'spec/custom/guards/profiler'
-require 'spec/custom/runner/relates'
-require 'spec/custom/runner/actions/gcstats'
+if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
+ require 'spec/custom/utils/options'
+ require 'spec/custom/matchers/compile_as'
+ require 'spec/custom/helpers/generator'
+ require 'spec/custom/guards/profiler'
+ require 'spec/custom/runner/relates'
+ require 'spec/custom/runner/actions/gcstats'
+ require 'spec/custom/runner/actions/debug'
+ require 'spec/custom/utils/script'
+end
@@ -0,0 +1,10 @@
+class DebugAction < ActionFilter
+ def initialize(tags=nil, descs=nil)
+ super
+ require 'rubinius/debugger'
+ end
+
+ def before(state)
+ Rubinius::Debugger.start if self === state.description
+ end
+end
@@ -2,12 +2,6 @@
#
class MSpecOptions
def compiler
- # The require is inside the method because this file has to be able to be
- # loaded in MRI and there are parts of the custom ensemble that are
- # Rubinius specific (primarily iseq, which could potentially be fixed by
- # better structuring the compiler).
- require 'spec/custom/runner/relates'
-
on("--compiler", "Run only the compile part of the compiler specs") do
SpecDataRelation.enable :compiler
end
@@ -1,7 +1,3 @@
-require 'spec/custom/utils/options'
-require 'spec/custom/runner/actions/gcstats'
-require 'spec/custom/runner/actions/profiler'
-
# Registers custom actions, etc. for all MSpec scripts
#
class MSpecScript
View
@@ -1,5 +1,5 @@
# vim: filetype=ruby
-require 'spec/custom/utils/script'
+require 'spec/custom/mspec'
class MSpecScript
# Language features specs
View
@@ -1,7 +1,3 @@
$: << File.expand_path('../', __FILE__)
require 'spec/ruby/spec_helper'
-
-if Object.const_defined?(:RUBY_ENGINE) and Object.const_get(:RUBY_ENGINE) == 'rbx'
- require 'spec/custom/mspec'
-end

0 comments on commit 2e08686

Please sign in to comment.