Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Makefile, check-filter.rb: reduce verbosity of testing output.

Makefile: comment targets
subcmd: document how save_command is supposed to work.
  • Loading branch information...
commit 2326442aa80771379ad08e551d2f02969a745658 1 parent c9b83fc
@rocky authored
View
7 Makefile
@@ -4,8 +4,15 @@
all: test
+#: Run all tests without bloated output
+check-short:
+ $(MAKE) check 2>&1 | ruby check-filter.rb
+
+#: Run all tests (same as "test")
check:
rake test
+
+#: Run all tests (same as "check")
test:
rake test
View
18 check-filter.rb
@@ -0,0 +1,18 @@
+#!/usr/bin/env ruby
+# Use this to cut out the crud from make check.
+# Use like this:
+# make check 2>&1 | ruby ../make-check-filter.rb
+# See Makefile.am
+pats = ["^(?:Loaded",
+ 'Started',
+ "Making check in",
+ 'Test run options',
+ "^trepan: That",
+ ].join('|') + ')'
+# puts pats
+skip_re = /#{pats}/
+
+while gets()
+ next if $_ =~ skip_re
+ puts $_
+end
View
5 processor/command/base/subcmd.rb
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
+# Copyright (C) 2010-2012 Rocky Bernstein <rockyb@rubyforge.net>
# A base class for debugger subcommands.
#
# Note: don't end classname with Command (capital C) since main
@@ -164,6 +164,9 @@ def run(args)
run_set_bool(args)
end
+ # Returns an Array of commands needed to save this setting.
+ # Here it is simply:
+ # set xx ... {on|off}
def save_command
val = settings[subcmd_setting_key] ? 'on' : 'off'
["#{subcmd_prefix_string} #{val}"]
View
4 processor/command/set_subcmd/auto_subcmd/eval.rb
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
+# Copyright (C) 2010-2012 Rocky Bernstein <rockyb@rubyforge.net>
require_relative '../../base/subsubcmd'
class Trepan::SubSubcommand::SetAutoEval < Trepan::SetBoolSubSubcommand
@@ -53,5 +53,5 @@ class Trepan::SubSubcommand::SetAutoEval < Trepan::SetBoolSubSubcommand
eval_cmd = Trepan::SubSubcommand::SetAutoEval.new(cmd, auto_cmd, 'eval');
%w(off on 0 1).each { |arg| eval_cmd.run([eval_cmd.name, arg]) }
puts '-' * 10
- puts eval_cmd.save_command.join("\n")
+ puts eval_cmd.save_command
end
View
2  processor/command/set_subcmd/auto_subcmd/irb.rb
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
+# Copyright (C) 2010-2012 Rocky Bernstein <rockyb@rubyforge.net>
require_relative '../../base/subsubcmd'
class Trepan::Subcommand::SetAutoIrb < Trepan::SetBoolSubSubcommand
View
2  processor/command/set_subcmd/auto_subcmd/list.rb
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
+# Copyright (C) 2010-2012 Rocky Bernstein <rockyb@rubyforge.net>
require_relative '../../base/subsubcmd'
class Trepan::Subcommand::SetAutoList < Trepan::SetBoolSubSubcommand
View
19 test/unit/test-cmd-set-auto-eval.rb.try
@@ -0,0 +1,19 @@
+#!/usr/bin/env ruby
+require 'test/unit'
+require_relative '../../processor/command/set_subcmd/auto'
+require_relative '../../processor/mock'
+
+class TestCommandStep < Test::Unit::TestCase
+
+ include MockDebugger
+ def test_set_autoeval_save
+ dbgr, cmd = Trepan::MockDebugger::setup('set', false)
+ cmds = dbgr.core.processor.commands
+ set_cmd = cmds['set']
+ auto_cmd = Trepan::SubSubcommand::SetAuto.new(dbgr.core.processor,
+ set_cmd)
+ eval_cmd = Trepan::SubSubcommand::SetAutoEval.new(cmd, auto_cmd, 'eval');
+ eval_cmd.run([eval_cmd.name, 'on'])
+ assert_equal(["set auto eval on"], eval_cmd.save_command)
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.