public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Delete Console:get_text and add Console:test
@ 2002-01-18  9:23 Keith Seitz
  0 siblings, 0 replies; only message in thread
From: Keith Seitz @ 2002-01-18  9:23 UTC (permalink / raw)
  To: Insight Maling List

Hi,

Since "event generate" doesn't seem to work too well for the testsuites,
I'm revamping Console to add a method which will call any other method.

I wish event genrate would work, but we'll just assume that the key
bindings are working until we find a way to get the events delivered.

At least these tests will now test _something_.

If anyone knows a proper fix, I'd love to hear it.

Keith


ChangeLog
2002-01-18  Keith Seitz  <keiths@redhat.com>

	* library/console.ith (get_text): Delete.
	(test): New public method.
	* library/console.itb (get_text): Delete.
	(test): New public method.

Patch
Index: library/console.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/console.itb,v
retrieving revision 1.18
diff -p -r1.18 console.itb
*** library/console.itb	2002/01/15 19:52:01	1.18
--- library/console.itb	2002/01/18 17:21:01
*************** body Console::_paste {{check_primary 1}}
*** 552,562 ****
    }
  }

- # public method for testing only
- body Console::get_text {} {
-   return $_twin
- }
-
  # ------------------------------------------------------------------
  #  METHOD:  _find_lcp - Return the longest common prefix in SLIST.
  #              Can be empty string.
--- 552,557 ----
*************** body Console::_update_option {name value
*** 692,694 ****
--- 687,708 ----
      }
    }
  }
+
+ # ------------------------------------------------------------------
+ #  NAME:         public method Console::test
+ #  DESCRIPTION:  Executes the given command
+ #
+ #  ARGUMENTS:    Command to run
+ #  RETURNS:      Return value of command
+ #
+ #  NOTES:        This will only run if env(GDBTK_TEST_RUNNING)==1.
+ #                FOR TESTING ONLY
+ # ------------------------------------------------------------------
+ body Console::test {args} {
+   global env
+
+   if {[info exists env(GDBTK_TEST_RUNNING)] && $env(GDBTK_TEST_RUNNING) == 1} {
+     return [eval $args]
+   }
+ }
+
Index: library/console.ith
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/console.ith,v
retrieving revision 1.9
diff -p -r1.9 console.ith
*** library/console.ith	2002/01/15 19:52:01	1.9
--- library/console.ith	2002/01/18 17:21:01
*************** class Console {
*** 29,36 ****
      method insert {line {tag ""}}
      method invoke {}
      method _insertion {args}
-     method get_text {}
      method activate {{prompt {}}}

      #
      # GDB Events
--- 29,36 ----
      method insert {line {tag ""}}
      method invoke {}
      method _insertion {args}
      method activate {{prompt {}}}
+     method test {args}

      #
      # GDB Events

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-01-18 17:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-18  9:23 [PATCH] Delete Console:get_text and add Console:test Keith Seitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).