* [PATCH] Fix mi-basics.exp
@ 2007-01-10 23:11 Nick Roberts
2007-01-12 18:03 ` Daniel Jacobowitz
0 siblings, 1 reply; 3+ messages in thread
From: Nick Roberts @ 2007-01-10 23:11 UTC (permalink / raw)
To: gdb-patches
[2nd attempt, I'm not sure where the first post ended up]
This is to fix the annoying fails that occur in mi-basics.exp when srcdir is a
relative pathname in site.exp. It uses objdir instead of srcdir for the tests
which always seems to be an absolute filename, although I don't know where
runtest gets its value.
If approved, I'll make the same change for mi2-basics.exp.
--
Nick http://www.inet.net.nz/~nickrob
2007-01-10 Nick Roberts <nickrob@snap.net.nz>
* gdb.mi/mi-basics.exp (test_dir_specification)
(test_path_specification): Use objdir instead of srcdir
to always get an absolute filename.
*** mi-basics.exp 10 Jan 2007 11:57:17 +1300 1.16
--- mi-basics.exp 10 Jan 2007 23:09:08 +1300
*************** set testfile "basics"
*** 42,48 ****
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
set escapedobjdir [string_to_regexp ${objdir}]
! set escapedsrcdir [string_to_regexp ${srcdir}]
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
untested mi-basics.exp
--- 42,48 ----
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
set escapedobjdir [string_to_regexp ${objdir}]
! set envirodir [string_to_regexp ${objdir}/${subdir}]
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
untested mi-basics.exp
*************** proc test_breakpoints_deletion {} {
*** 150,157 ****
proc test_dir_specification {} {
global mi_gdb_prompt
! global srcdir
global subdir
# Add to the search directories, display, then reset back to default
# Tests:
--- 150,159 ----
proc test_dir_specification {} {
global mi_gdb_prompt
! global objdir
global subdir
+ global envirodir
+
# Add to the search directories, display, then reset back to default
# Tests:
*************** proc test_dir_specification {} {
*** 159,167 ****
# -environment-directory
# -environment-directory -r
! set envirodir [string_to_regexp ${srcdir}/${subdir}]
!
! mi_gdb_test "202-environment-directory ${srcdir}/${subdir}" \
"202\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
"environment-directory arg operation"
--- 161,167 ----
# -environment-directory
# -environment-directory -r
! mi_gdb_test "202-environment-directory ${objdir}/${subdir}" \
"202\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
"environment-directory arg operation"
*************** proc test_path_specification {} {
*** 198,206 ****
global mi_gdb_prompt
global orig_path
global objdir
! global srcdir
global escapedobjdir
! global escapedsrcdir
# Add to the path, display, then reset
# Tests:
--- 198,206 ----
global mi_gdb_prompt
global orig_path
global objdir
! global subdir
global escapedobjdir
! global envirodir
# Add to the path, display, then reset
# Tests:
*************** proc test_path_specification {} {
*** 221,233 ****
}
set orig_path [string_to_regexp ${orig_path}]
mi_gdb_test "207-environment-path" \
"207\\\^done,path=\"$orig_path\"" \
"environment-path no-args operation"
! mi_gdb_test "208-environment-path $srcdir $objdir" \
! "208\\\^done,path=\"$escapedsrcdir.$escapedobjdir.$orig_path\"" \
"environment-path dir1 dir2 operation"
mi_gdb_test "209-environment-path -r $objdir" \
--- 221,234 ----
}
set orig_path [string_to_regexp ${orig_path}]
+ set pathdir [string_to_regexp ${objdir}/${subdir}]
mi_gdb_test "207-environment-path" \
"207\\\^done,path=\"$orig_path\"" \
"environment-path no-args operation"
! mi_gdb_test "208-environment-path $objdir ${objdir}/${subdir}" \
! "208\\\^done,path=\"$escapedobjdir.${envirodir}.$orig_path\"" \
"environment-path dir1 dir2 operation"
mi_gdb_test "209-environment-path -r $objdir" \
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] Fix mi-basics.exp
2007-01-10 23:11 [PATCH] Fix mi-basics.exp Nick Roberts
@ 2007-01-12 18:03 ` Daniel Jacobowitz
2007-01-12 21:40 ` Nick Roberts
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2007-01-12 18:03 UTC (permalink / raw)
To: Nick Roberts; +Cc: gdb-patches
On Thu, Jan 11, 2007 at 12:10:48PM +1300, Nick Roberts wrote:
> [2nd attempt, I'm not sure where the first post ended up]
>
> This is to fix the annoying fails that occur in mi-basics.exp when srcdir is a
> relative pathname in site.exp. It uses objdir instead of srcdir for the tests
> which always seems to be an absolute filename, although I don't know where
> runtest gets its value.
>
> If approved, I'll make the same change for mi2-basics.exp.
OK, and thanks a lot for fixing this. objdir is fine; it seems that
dejagnu always arranges to set that to a full path (unless you specify
it yourself in site.exp or on the command line, which we don't).
> --- 221,234 ----
> }
>
> set orig_path [string_to_regexp ${orig_path}]
> + set pathdir [string_to_regexp ${objdir}/${subdir}]
>
> mi_gdb_test "207-environment-path" \
> "207\\\^done,path=\"$orig_path\"" \
> "environment-path no-args operation"
>
> ! mi_gdb_test "208-environment-path $objdir ${objdir}/${subdir}" \
> ! "208\\\^done,path=\"$escapedobjdir.${envirodir}.$orig_path\"" \
> "environment-path dir1 dir2 operation"
>
> mi_gdb_test "209-environment-path -r $objdir" \
I think pathdir is unused.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] Fix mi-basics.exp
2007-01-12 18:03 ` Daniel Jacobowitz
@ 2007-01-12 21:40 ` Nick Roberts
0 siblings, 0 replies; 3+ messages in thread
From: Nick Roberts @ 2007-01-12 21:40 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
> > If approved, I'll make the same change for mi2-basics.exp.
>
> OK, and thanks a lot for fixing this. objdir is fine; it seems that
> dejagnu always arranges to set that to a full path (unless you specify
> it yourself in site.exp or on the command line, which we don't).
Committed. Below is what I committed for mi2-basics.exp
--
Nick http://www.inet.net.nz/~nickrob
2007-01-13 Nick Roberts <nickrob@snap.net.nz>
* gdb.mi/mi-basics.exp, gdb.mi/mi2-basics.exp (test_dir_specification)
(test_path_specification): Use objdir instead of srcdir to always
get an absolute filename.
Index: mi2-basics.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-basics.exp,v
retrieving revision 1.8
retrieving revision 1.9
diff -c -p -c -p -r1.8 -r1.9
*** mi2-basics.exp 9 Jan 2007 17:59:13 -0000 1.8
--- mi2-basics.exp 12 Jan 2007 21:31:35 -0000 1.9
*************** set testfile "basics"
*** 42,48 ****
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
set escapedobjdir [string_to_regexp ${objdir}]
! set escapedsrcdir [string_to_regexp ${srcdir}]
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
untested mi2-basics.exp
--- 42,48 ----
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
set escapedobjdir [string_to_regexp ${objdir}]
! set envirodir [string_to_regexp ${objdir}/${subdir}]
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
untested mi2-basics.exp
*************** proc test_breakpoints_deletion {} {
*** 150,157 ****
proc test_dir_specification {} {
global mi_gdb_prompt
! global srcdir
global subdir
# Add to the search directories, display, then reset back to default
# Tests:
--- 150,158 ----
proc test_dir_specification {} {
global mi_gdb_prompt
! global objdir
global subdir
+ global envirodir
# Add to the search directories, display, then reset back to default
# Tests:
*************** proc test_dir_specification {} {
*** 159,167 ****
# -environment-directory
# -environment-directory -r
! set envirodir [string_to_regexp ${srcdir}/${subdir}]
!
! mi_gdb_test "202-environment-directory ${srcdir}/${subdir}" \
"202\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
"environment-directory arg operation"
--- 160,166 ----
# -environment-directory
# -environment-directory -r
! mi_gdb_test "202-environment-directory ${objdir}/${subdir}" \
"202\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
"environment-directory arg operation"
*************** proc test_path_specification {} {
*** 200,208 ****
global mi_gdb_prompt
global orig_path
global objdir
! global srcdir
global escapedobjdir
! global escapedsrcdir
# Add to the path, display, then reset
# Tests:
--- 199,207 ----
global mi_gdb_prompt
global orig_path
global objdir
! global subdir
global escapedobjdir
! global envirodir
# Add to the path, display, then reset
# Tests:
*************** proc test_path_specification {} {
*** 223,235 ****
}
set orig_path [string_to_regexp ${orig_path}]
mi_gdb_test "207-environment-path" \
"207\\\^done,path=\"$orig_path\"" \
"environment-path no-args operation"
! mi_gdb_test "208-environment-path $srcdir $objdir" \
! "208\\\^done,path=\"$escapedsrcdir.$escapedobjdir.$orig_path\"" \
"environment-path dir1 dir2 operation"
mi_gdb_test "209-environment-path -r $objdir" \
--- 222,235 ----
}
set orig_path [string_to_regexp ${orig_path}]
+ set pathdir [string_to_regexp ${objdir}/${subdir}]
mi_gdb_test "207-environment-path" \
"207\\\^done,path=\"$orig_path\"" \
"environment-path no-args operation"
! mi_gdb_test "208-environment-path $objdir ${objdir}/${subdir}" \
! "208\\\^done,path=\"$escapedobjdir.${envirodir}.$orig_path\"" \
"environment-path dir1 dir2 operation"
mi_gdb_test "209-environment-path -r $objdir" \
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-01-12 21:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-10 23:11 [PATCH] Fix mi-basics.exp Nick Roberts
2007-01-12 18:03 ` Daniel Jacobowitz
2007-01-12 21:40 ` Nick Roberts
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox