OSDN Git Service

*** empty log message ***
[pf3gnuchains/pf3gnuchains4x.git] / gdb / testsuite / gdb.gdbtk / srcwin.exp
1 # Copyright 1999, 2001 Red Hat, Inc.
2 #
3 # This program is free software; you can redistribute it and/or modify it
4 # under the terms of the GNU General Public License (GPL) as published by
5 # the Free Software Foundation; either version 2 of the License, or (at
6 # your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12
13 load_lib ../gdb.gdbtk/insight-support.exp
14
15 if {[gdbtk_initialize_display]} {
16   if {$tracelevel} {
17     strace $tracelevel
18   }
19
20   #
21   # test source window
22   #
23   set prms_id 0
24   set bug_id 0
25   
26   set testfile "list"
27   set s1 "$srcdir/$subdir/list0.c"
28   set sources "$s1 $srcdir/$subdir/list1.c"
29   set binfile $objdir/$subdir/$testfile
30   if {[file exists $s1.save]} {
31     catch {file delete $s1}
32     file rename $s1.save $s1
33   }
34   set r [gdb_compile $sources "$binfile" executable debug]
35   if  { $r != "" } {
36     gdb_suppress_entire_file \
37       "Testcase compile failed, so some tests in this file will automatically fail."
38   }
39
40   # Start with a fresh gdbtk
41   gdb_exit
42   set results [gdbtk_start [file join $srcdir $subdir srcwin.test]]
43   set results [split $results \n]
44   set all_results $results
45
46   # move file with "main" out of the way
47   file rename $s1 $s1.save
48
49   # run slightly different set of tests
50   gdb_exit
51   set results [gdbtk_start [file join $srcdir $subdir srcwin2.test]]
52   set results [split $results \n]
53   set all_results [concat $all_results $results]
54
55   # restore file
56   file rename $s1.save $s1
57
58   set r [gdb_compile $sources "$binfile" executable ""]
59   if  { $r != "" } {
60     gdb_suppress_entire_file \
61       "Testcase compile failed, so some tests in this file will automatically fail."
62   }
63   # run slightly different set of tests
64   gdb_exit
65   set results [gdbtk_start [file join $srcdir $subdir srcwin3.test]]
66   set results [split $results \n]
67   set all_results [concat $all_results $results]
68
69   # Analyze results
70   gdbtk_done $all_results
71 }