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] console.test: make it do something


Hi,

This patch "fixes" console.test, as I reported in my patch to
console.ith/console.itb.

Keith

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

	* console.test: Don't rely on "event generate" to do
	keystrokes. It just doesn't work. Use the console window's
	"test" method instead.
	Use Console::test instead of Console::get_text.

Patch
Index: console.test
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.gdbtk/console.test,v
retrieving revision 1.2
diff -p -r1.2 console.test
*** console.test	2001/05/07 20:39:32	1.2
--- console.test	2002/01/18 17:28:16
***************
*** 1,4 ****
! #   Copyright (C) 1998, 1999 Cygnus Solutions
  #
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
--- 1,4 ----
! #   Copyright (C) 1998, 1999, 2002 Red Hat, Inc.
  #
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
*************** if {![gdbtk_read_defs]} {
*** 28,34 ****
  global objdir test_ran
  global console text
  set console [ManagedWin::open Console]
! set text [$console get_text]

  #####                            #####
  #                                    #
--- 28,34 ----
  global objdir test_ran
  global console text
  set console [ManagedWin::open Console]
! set text [$console test set _twin]

  #####                            #####
  #                                    #
*************** gdbtk_test console-history-1.1 {up histo
*** 150,156 ****
    console_command {show remotelogbase}
    console_command {help quit}
    console_command {help si}
!   event generate $text <Up>
    get_cmd_line
  } {(gdb) help si}
  if {$test_ran} {
--- 150,157 ----
    console_command {show remotelogbase}
    console_command {help quit}
    console_command {help si}
!   # this doesn't seem to work reliably: event generate $text <Up>
!   $console test _previous
    get_cmd_line
  } {(gdb) help si}
  if {$test_ran} {
*************** gdbtk_test console-history-1.2 {up histo
*** 175,182 ****
    console_command {show remotelogbase}
    console_command {help quit}
    console_command {help si}
!   event generate $text <Up>
!   event generate $text <Up>
    get_cmd_line
  } {(gdb) help quit}
  if {$test_ran} {
--- 176,185 ----
    console_command {show remotelogbase}
    console_command {help quit}
    console_command {help si}
!   # this doesn't seem to work reliably: event generate $text <Up>
!   # this doesn't seem to work reliably: event generate $text <Up>
!   $console test _previous
!   $console test _previous
    get_cmd_line
  } {(gdb) help quit}
  if {$test_ran} {
*************** gdbtk_test console-history-1.3 {up histo
*** 203,209 ****
    console_command {help si}

    for {set i 0} {$i < 4} {incr i} {
!     event generate $text <Up>
    }
    get_cmd_line
  } {(gdb) show remotedevice}
--- 206,213 ----
    console_command {help si}

    for {set i 0} {$i < 4} {incr i} {
!     # this doesn't seem to work reliably: event generate $text <Up>
!     $console test _previous
    }
    get_cmd_line
  } {(gdb) show remotedevice}
*************** gdbtk_test console-history-1.4 {up fourt
*** 230,236 ****
    console_command {help quit}
    console_command {help si}
    for {set i 0} {$i < 14} {incr i} {
!     event generate $text <Up>
    }
    get_cmd_line
  } {(gdb) show annotate}
--- 234,241 ----
    console_command {help quit}
    console_command {help si}
    for {set i 0} {$i < 14} {incr i} {
!     # this doesn't seem to work reliably: event generate $text <Up>
!     $console test _previous
    }
    get_cmd_line
  } {(gdb) show annotate}
*************** gdbtk_test console-history-1.5 {up searc
*** 251,259 ****
    console_command {help si}

    $text insert end "sh"
!   event generate $text <Shift-Up>
!   event generate $text <Shift-Up>
!   event generate $text <Shift-Up>
    get_cmd_line
  } {(gdb) show annotate}

--- 256,267 ----
    console_command {help si}

    $text insert end "sh"
!   # this doesn't seem to work reliably: event generate $text <Shift-Up>
!   # this doesn't seem to work reliably: event generate $text <Shift-Up>
!   # this doesn't seem to work reliably: event generate $text <Shift-Up>
!   $console test _search_history
!   $console test _search_history
!   $console test _search_history
    get_cmd_line
  } {(gdb) show annotate}

*************** gdbtk_test console-history-1.5 {up searc
*** 261,268 ****
  # Test:  console-history-1.6
  # Desc:  Exercise the down-history search functionality
  gdbtk_test console-history-1.6 {down search} {
!   event generate $text <Shift-Down>
!   event generate $text <Shift-Down>
    get_cmd_line
  } {(gdb) show remotelogbase}

--- 269,278 ----
  # Test:  console-history-1.6
  # Desc:  Exercise the down-history search functionality
  gdbtk_test console-history-1.6 {down search} {
!   # this doesn't seem to work reliably: event generate $text <Shift-Down>
!   # this doesn't seem to work reliably: event generate $text <Shift-Down>
!   $console test _rsearch_history
!   $console test _rsearch_history
    get_cmd_line
  } {(gdb) show remotelogbase}

*************** gdbtk_test console-history-1.6 {down sea
*** 270,277 ****
  # Desc:  Down-history search to bottom
  # We go back down until the original partialcommand is displayed
  gdbtk_test console-history-1.7 {down search to bottom} {
!   event generate $text <Shift-Down>
!   event generate $text <Shift-Down>
    get_cmd_line
  } {(gdb) sh}

--- 280,289 ----
  # Desc:  Down-history search to bottom
  # We go back down until the original partialcommand is displayed
  gdbtk_test console-history-1.7 {down search to bottom} {
!   # this doesn't seem to work reliably: event generate $text <Shift-Down>
!   # this doesn't seem to work reliably: event generate $text <Shift-Down>
!   $console test _rsearch_history
!   $console test _rsearch_history
    get_cmd_line
  } {(gdb) sh}

*************** gdbtk_test console-history-1.7 {down sea
*** 280,286 ****
  # We go up until there are no matches
  gdbtk_test console-history-1.8 {up search to top} {
    for {set i 0} {$i < 100} {incr i} {
!     event generate $text <Shift-Up>
    }
    get_cmd_line
  } {(gdb) show annotate}
--- 292,299 ----
  # We go up until there are no matches
  gdbtk_test console-history-1.8 {up search to top} {
    for {set i 0} {$i < 100} {incr i} {
!     # this doesn't seem to work reliably: event generate $text <Shift-Up>
!     $console test _search_history
    }
    get_cmd_line
  } {(gdb) show annotate}
*************** gdbtk_test console-history-2.1 {down onc
*** 309,317 ****
    console_command {help si}

    for {set i 0} {$i < 14} {incr i} {
!     event generate $text <Up>
    }
!   event generate $text <Down>
    get_cmd_line
  } {(gdb) show complaints}
  if {$test_ran} {
--- 322,332 ----
    console_command {help si}

    for {set i 0} {$i < 14} {incr i} {
!     # this doesn't seem to work reliably: event generate $text <Up>
!     $console test _previous
    }
!   # this doesn't seem to work reliably: event generate $text <Down>
!   $console test _next
    get_cmd_line
  } {(gdb) show complaints}
  if {$test_ran} {
*************** gdbtk_test console-history-2.2 {down twi
*** 338,348 ****
    console_command {help si}

    for {set i 0} {$i < 14} {incr i} {
!     event generate $text <Up>
    }

!   event generate $text <Down>
!   event generate $text <Down>
    get_cmd_line
  } {(gdb) show confirm}
  if {$test_ran} {
--- 353,366 ----
    console_command {help si}

    for {set i 0} {$i < 14} {incr i} {
!     # this doesn't seem to work reliably: event generate $text <Up>
!     $console test _previous
    }

!   # this doesn't seem to work reliably: event generate $text <Down>
!   # this doesn't seem to work reliably: event generate $text <Down>
!   $console test _next
!   $console test _next
    get_cmd_line
  } {(gdb) show confirm}
  if {$test_ran} {
*************** gdbtk_test console-history-2.3 {down fou
*** 369,379 ****
    console_command {help si}

    for {set i 0} {$i < 14} {incr i} {
!     event generate $text <Up>
    }

    for {set i 0} {$i < 4} {incr i} {
!   event generate $text <Down>
    }
    get_cmd_line
  } {(gdb) show language}
--- 387,399 ----
    console_command {help si}

    for {set i 0} {$i < 14} {incr i} {
!     # this doesn't seem to work reliably: event generate $text <Up>
!     $console test _previous
    }

    for {set i 0} {$i < 4} {incr i} {
!     # this doesn't seem to work reliably: event generate $text <Down>
!     $console test _next
    }
    get_cmd_line
  } {(gdb) show language}
*************** gdbtk_test console-history-2.4 {down inf
*** 400,410 ****
    console_command {help quit}
    console_command {help si}
    for {set i 0} {$i < 14} {incr i} {
!     event generate $text <Up>
    }

    for {set i 0} {$i < 20} {incr i} {
!     event generate $text <Down>
    }
    get_cmd_line
  } {(gdb) }
--- 420,432 ----
    console_command {help quit}
    console_command {help si}
    for {set i 0} {$i < 14} {incr i} {
!     # this doesn't seem to work reliably: event generate $text <Up>
!     $console test _previous
    }

    for {set i 0} {$i < 20} {incr i} {
!     # this doesn't seem to work reliably: event generate $text <Down>
!     $console test _next
    }
    get_cmd_line
  } {(gdb) }


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