This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: canonicalization of path names in test scripts
- From: Daniel Jacobowitz <drow at false dot org>
- To: Randolph Chung <randolph at tausq dot org>
- Cc: gdb at sources dot redhat dot com
- Date: Mon, 29 Nov 2004 09:06:40 -0500
- Subject: Re: canonicalization of path names in test scripts
- References: <20041123193249.GO9148@tausq.org>
On Tue, Nov 23, 2004 at 11:32:50AM -0800, Randolph Chung wrote:
> I'm seeing some FAILs with the testsuite because of different ways to
> expanding srcdir between the testsuite and gdb.
>
> for example, in gdb.mi/mi-basics.exp,
>
> set envirodir [string_to_regexp ${srcdir}/${subdir}]
>
> mi_gdb_test "202-environment-directory ${srcdir}/${subdir}" \
> "\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
> "environment-directory arg operation"
>
> envirodir expands to "\.\./\.\./\.\./gdb-cvs/gdb/testsuite/gdb\.mi.\$cdir.\$cwd"
>
> what gdb actually prints is:
> ^done,source-path="/home/tausq/gdb/build-cvs/gdb/testsuite/../../../gdb-cvs/gdb/testsuite/gdb.mi:$cdir:$cwd"
>
> (i am running the test from /home/tausq/gdb/build-cvs/gdb/testsuite)
>
> what is the best way to fix this? we can of course loosen the match to
> ".*${envirodir}", but that seems rather suboptimal.
I've been working around it by configuring using an absolute path :-)
Alternatively, you could detect this case in the test script. If the
first character of srcdir is not a directory separator, add `pwd`?
--
Daniel Jacobowitz