2 # Copyright 2001, 2003 Red Hat, Inc.
4 # This Program Is Free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 # This file was written by Keith Seitz (keiths@cygnus.com)
20 # Read in the standard defs file
21 if {![gdbtk_read_defs]} {
25 global objdir test_ran
28 # FIXME: TfindArgs needs to be updated before it can go in the list...
29 set windows [list BpWin BrowserWin Console DebugWin KodWin LocalsWin \
30 MemWin ProcessWin RegWin StackWin TdumpWin WatchWin]
33 # FIXME: ActionhDlg,TraceDlg cannot be independently opened
34 set dialogs [list About AttachDlg GlobalPref SrcPref TargetSelection]
36 # Helper proc to do all the testing
37 proc do_open_close {num winlist} {
39 foreach win $winlist {
41 # Test: windows-$num.*
42 # Desc: Open each window before running
44 gdbtk_test windows-$num.$i "open $win before running" {
45 set err [catch {ManagedWin::open $win} txt]
59 # Test: windows-{$num+1}.*
60 # Desc: Close each window before running
61 gdbtk_test windows-[expr {$num+1}].$i "close $win before running" {
62 set err [catch {delete object $win_obj} txt]
82 # Counter for tests. Increment by 2 after each call to do_open_close.
86 # Check if all windows open with no file loaded
88 do_open_close $num $windows
91 # Sadly, there is no good way to unpost dialogs (except for setting
92 # an after callback). Until something better comes along, skip them.
93 # do_open_close $num $dialogs
97 # Check if all windows open with file loaded
101 set program [file join $objdir c_variable]
102 if {[catch {gdbtk_test_file $program} t]} {
103 # This isn't a test case, since if this fails, we're hosed.
104 gdbtk_test_error "loading \"$program\": $t"
107 do_open_close $num $windows
109 #do_open_close $num $dialogs
113 # Check if all windows open after running
116 # Break in main and run
120 do_open_close $num $windows
122 #do_open_close $num $dialogs