Skip to content
This repository
Browse code

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
R. Bernstein authored June 20, 2012
7  Makefile
@@ -4,8 +4,15 @@
4 4
 
5 5
 all: test
6 6
 
  7
+#: Run all tests without bloated output
  8
+check-short: 
  9
+	$(MAKE) check 2>&1  | ruby check-filter.rb
  10
+
  11
+#: Run all tests (same as "test")
7 12
 check: 
8 13
 	rake test
  14
+
  15
+#: Run all tests (same as "check")
9 16
 test: 
10 17
 	rake test
11 18
 
18  check-filter.rb
... ...
@@ -0,0 +1,18 @@
  1
+#!/usr/bin/env ruby
  2
+# Use this to cut out the crud from make check.
  3
+# Use like this:
  4
+#   make check 2>&1  | ruby ../make-check-filter.rb
  5
+# See Makefile.am
  6
+pats = ["^(?:Loaded",
  7
+        'Started',
  8
+        "Making check in",
  9
+        'Test run options',
  10
+        "^trepan: That",
  11
+       ].join('|') + ')'
  12
+# puts pats
  13
+skip_re = /#{pats}/
  14
+
  15
+while gets()
  16
+  next if $_ =~ skip_re
  17
+  puts $_
  18
+end
5  processor/command/base/subcmd.rb
... ...
@@ -1,5 +1,5 @@
1 1
 # -*- coding: utf-8 -*-
2  
-# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
  2
+# Copyright (C) 2010-2012 Rocky Bernstein <rockyb@rubyforge.net>
3 3
 # A base class for debugger subcommands.
4 4
 #
5 5
 # Note: don't end classname with Command (capital C) since main
@@ -164,6 +164,9 @@ def run(args)
164 164
       run_set_bool(args)
165 165
     end
166 166
 
  167
+    # Returns an Array of commands needed to save this setting. 
  168
+    # Here it is simply:
  169
+    # set xx ... {on|off}
167 170
     def save_command
168 171
       val     = settings[subcmd_setting_key] ? 'on' : 'off'
169 172
       ["#{subcmd_prefix_string} #{val}"]
4  processor/command/set_subcmd/auto_subcmd/eval.rb
... ...
@@ -1,5 +1,5 @@
1 1
 # -*- coding: utf-8 -*-
2  
-# Copyright (C) 2010 Rocky Bernstein <rockyb@rubyforge.net>
  2
+# Copyright (C) 2010-2012 Rocky Bernstein <rockyb@rubyforge.net>
3 3
 require_relative '../../base/subsubcmd'
4 4
 
5 5
 class Trepan::SubSubcommand::SetAutoEval < Trepan::SetBoolSubSubcommand
@@ -53,5 +53,5 @@ class Trepan::SubSubcommand::SetAutoEval < Trepan::SetBoolSubSubcommand
53 53
   eval_cmd = Trepan::SubSubcommand::SetAutoEval.new(cmd, auto_cmd, 'eval');
54 54
   %w(off on 0 1).each { |arg| eval_cmd.run([eval_cmd.name, arg]) }
55 55
   puts '-' * 10
56  
-  puts eval_cmd.save_command.join("\n")
  56
+  puts eval_cmd.save_command
57 57
 end
2  processor/command/set_subcmd/auto_subcmd/irb.rb
... ...
@@ -1,5 +1,5 @@
1 1
 # -*- coding: utf-8 -*-
2  
-# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
  2
+# Copyright (C) 2010-2012 Rocky Bernstein <rockyb@rubyforge.net>
3 3
 require_relative '../../base/subsubcmd'
4 4
 
5 5
 class Trepan::Subcommand::SetAutoIrb < Trepan::SetBoolSubSubcommand
2  processor/command/set_subcmd/auto_subcmd/list.rb
... ...
@@ -1,5 +1,5 @@
1 1
 # -*- coding: utf-8 -*-
2  
-# Copyright (C) 2010, 2011 Rocky Bernstein <rockyb@rubyforge.net>
  2
+# Copyright (C) 2010-2012 Rocky Bernstein <rockyb@rubyforge.net>
3 3
 require_relative '../../base/subsubcmd'
4 4
 
5 5
 class Trepan::Subcommand::SetAutoList < Trepan::SetBoolSubSubcommand
19  test/unit/test-cmd-set-auto-eval.rb.try
... ...
@@ -0,0 +1,19 @@
  1
+#!/usr/bin/env ruby
  2
+require 'test/unit'
  3
+require_relative '../../processor/command/set_subcmd/auto'
  4
+require_relative '../../processor/mock'
  5
+
  6
+class TestCommandStep < Test::Unit::TestCase
  7
+
  8
+  include MockDebugger
  9
+  def test_set_autoeval_save
  10
+    dbgr, cmd = Trepan::MockDebugger::setup('set', false)
  11
+    cmds = dbgr.core.processor.commands
  12
+    set_cmd = cmds['set']
  13
+    auto_cmd = Trepan::SubSubcommand::SetAuto.new(dbgr.core.processor, 
  14
+                                               set_cmd)
  15
+    eval_cmd = Trepan::SubSubcommand::SetAutoEval.new(cmd, auto_cmd, 'eval');
  16
+    eval_cmd.run([eval_cmd.name, 'on'])
  17
+    assert_equal(["set auto eval on"], eval_cmd.save_command)
  18
+  end
  19
+end

0 notes on commit 2326442

Please sign in to comment.
Something went wrong with that request. Please try again.