This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Delete Console:get_text and add Console:test


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]