* testcase for "absolute source" patch
@ 2004-08-16 14:41 Baurzhan Ismagulov
2004-08-16 15:56 ` Michael Chastain
2004-08-16 19:15 ` Michael Chastain
0 siblings, 2 replies; 32+ messages in thread
From: Baurzhan Ismagulov @ 2004-08-16 14:41 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1164 bytes --]
Hello,
Here is the test file for the patch described in
http://sources.redhat.com/ml/gdb-patches/2004-04/msg00463.html .
The patch fixes the case s2-da -- the source was compiled using absolute
name and is not available at that location any more; gdb should be able
to find it in the same directory relative to a directory mentioned in
the argument for the "directory" command (see the link above for a
typescript). This used to work in 5.3 but was broken when fixing the
case b4- -- the binary is specified as dot-slash-basename but does not
exist in the current directory; gdb should not look for it in PATH (see
http://sources.redhat.com/ml/gdb/2004-01/msg00244.html for an example).
I am not sure what we want to do in cases s1-da, s3-da, s4-da and s5-da
(the source was compiled using a non-absolute name; should gdb look for
them under <source path>/$cdir, where <source path> is one of the
arguments to the "directory" command?), so I describe the present
behaviour as FAIL for now.
The file was tested on gdb 6.2 under Debian unstable. I would welcome
any comments about the test and suggestions about the mentioned cases.
With kind regards,
Baurjan.
[-- Attachment #2: openp.exp --]
[-- Type: text/plain, Size: 11997 bytes --]
# Copyright (C) 2004 Free Software Foundation, 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
# This file was written by Baurjan Ismagulov <ibr@ata.cs.hun.edu.tr>.
# $Id: openp.exp,v 1.2 2004/08/16 13:57:54 ibr Exp $
# This file tests whether gdb finds the files properly given the
# following file names:
# 1. basename: file
# 2. absolute: /dir/file
# 3. relative: dir/file
# 4. in current: ./file
# 5. in upper: ../file
# XXX: We assume that build == host.
proc canonize_path {dir} {
set tmp [pwd]
cd ${dir}
set new [pwd]
cd ${tmp}
return ${new}
}
proc cdir_compile {cdir src bin} {
set tmp [pwd]
cd ${cdir}
if {[gdb_compile "${src}" "${bin}" executable \
{debug additional_flags=-w}] != ""} {
gdb_suppress_entire_file "Testcase compile failed."
}
cd ${tmp}
}
proc test_bin {gdb_wd gdb_test_cmd gdb_resp txt} {
set tmp [pwd]
cd ${gdb_wd}
gdb_start
gdb_test ${gdb_test_cmd} ${gdb_resp} ${txt}
gdb_exit
cd ${tmp}
}
proc test_src {comp_dir comp_srcfile comp_binfile srcfile_dir
gdb_wd cmd1 cmd2 gdb_test_cmd gdb_resp txt} {
global srcname;
global srcfile;
set tmp [pwd]
cdir_compile ${comp_dir} ${comp_srcfile} ${comp_binfile}
if {${srcfile_dir} != ""} {
system "mv ${srcfile} ${srcfile_dir}"
}
cd ${gdb_wd}
gdb_start
if {${cmd1} != ""} {
gdb_test ${cmd1} ""
}
if {${cmd2} != ""} {
gdb_test ${cmd2} ""
}
gdb_test ${gdb_test_cmd} ${gdb_resp} ${txt}
gdb_exit
cd ${tmp}
if {${srcfile_dir} != ""} {
system "mv ${srcfile_dir}/${srcname} ${srcfile}"
}
}
if $tracelevel then {
strace $tracelevel
}
set prms_id 0
set bug_id 0
set testname "openp"
set srcname ${testname}.c
set binname ${testname}.bin
set testtmpdir [canonize_path ${objdir}/${subdir}]/${testname}
set srcfile ${testtmpdir}/subdir/src/${srcname}
set binfile ${testtmpdir}/subdir/bin/${binname}
system "mkdir -p ${testtmpdir}/subdir/src/subdir"
system "mkdir -p ${testtmpdir}/subdir/bin/subdir"
system "mkdir -p ${testtmpdir}/subdir/cwd/src"
system "mkdir -p ${testtmpdir}/subdir/dir${testtmpdir}/subdir/src/subdir"
system "mkdir -p ${testtmpdir}/subdir/dir/src"
system "echo \"main(){}\" >${srcfile}"
cdir_compile ${testtmpdir} ${srcfile} ${binfile}
# b1+
test_bin ${testtmpdir}/subdir/bin \
"file ${binname}" \
"Reading symbols from ${binfile}\\.\\.\\.done\\..*" \
"openp b1+ (existing binary, basename)"
# b1-
# XXX: Don't know how to modify the PATH in order to test with our
# sample. Have to assume that:
# * ls exists, is executable and is in PATH;
# * there is no ls binary in the current dir.
test_bin ${testtmpdir}/subdir/cwd \
"file ls" \
"Reading symbols from [which ls]\\.\\.\\..*done\\..*" \
"openp b1- (non-existent binary, basename, find in PATH)"
# b2+
test_bin ${testtmpdir}/subdir/cwd \
"file ${binfile}" \
"Reading symbols from ${binfile}\\.\\.\\.done\\..*" \
"openp b2+ (existing binary, absolute name)"
# b2-
# XXX: Should we match locale-specific messages?
test_bin ${testtmpdir}/subdir/cwd \
"file ${testtmpdir}/subdir/bin/ls" \
"${testtmpdir}/subdir/bin/ls: .*" \
"openp b2- (non-existent binary, absolute name, don't look in PATH)"
# b3+
test_bin ${testtmpdir}/subdir \
"file bin/${binname}" \
"Reading symbols from ${binfile}\\.\\.\\.done\\..*" \
"openp b3+ (existing binary, relative name)"
# b3-
# XXX: locale
test_bin ${testtmpdir}/subdir \
"file bin/ls" \
"bin/ls: .*" \
"openp b3- (non-existent binary, relative name, don't look in PATH)"
# b4+
test_bin ${testtmpdir}/subdir/bin \
"file ./${binname}" \
"Reading symbols from ${binfile}\\.\\.\\.done\\..*" \
"openp b4+ (existing binary, in the current dir)"
# b4-
# XXX: locale
test_bin ${testtmpdir}/subdir/bin \
"file ./ls" \
"\\./ls: .*" \
"openp b4- (non-existent binary, in the current dir, don't look in PATH)"
# b5+
test_bin ${testtmpdir}/subdir/bin/subdir \
"file ../${binname}" \
"Reading symbols from ${binfile}\\.\\.\\.done\\..*" \
"openp b5+ (existing binary, in the upper dir)"
# b5-
# XXX: locale
test_bin ${testtmpdir}/subdir/bin/subdir \
"file ../ls" \
"\\.\\./ls: .*" \
"openp b5- (non-existent binary, in the upper dir name, don't look in PATH)"
# s1+
test_src ${testtmpdir}/subdir/src ${srcname} ${binfile} \
"" \
${testtmpdir}/subdir/cwd \
"file ${binfile}" "" \
"l main" \
{1.main\(\){}.*} \
"openp s1+ (existing source, basename)"
# s1-.
test_src ${testtmpdir}/subdir/src ${srcname} ${binfile} \
${testtmpdir}/subdir/cwd \
${testtmpdir}/subdir/cwd \
"file ${binfile}" ""\
"l main" \
{1.main\(\){}.*} \
"openp s1-. (non-existent source, basename, find in \$cwd/basename)"
# s1-da
test_src ${testtmpdir}/subdir/src ${srcname} ${binfile} \
${testtmpdir}/subdir/dir${testtmpdir}/subdir/src \
${testtmpdir}/subdir/cwd \
"dir ${testtmpdir}/subdir/dir" "file ${binfile}" \
"l main" \
{1.main\(\){}.*} \
"openp s1-da (non-existent source, basename, find in <dir>/\$cdir/basename)"
# s1-d
test_src ${testtmpdir}/subdir/src ${srcname} ${binfile} \
${testtmpdir}/subdir/dir \
${testtmpdir}/subdir/cwd \
"dir ${testtmpdir}/subdir/dir" "file ${binfile}" \
"l main" \
{1.main\(\){}.*} \
"openp s1-d (non-existent source, basename, find in <dir>/basename)"
# s2+
test_src ${testtmpdir} ${srcfile} ${binfile} \
"" \
${testtmpdir}/subdir/cwd \
"file ${binfile}" ""\
"l main" \
{1.main\(\){}.*} \
"openp s2+ (existing source, absolute name)"
# s2-.
test_src ${testtmpdir} ${srcfile} ${binfile} \
${testtmpdir}/subdir/cwd \
${testtmpdir}/subdir/cwd \
"file ${binfile}" "" \
"l main" \
{1.main\(\){}.*} \
"openp s2-. (non-existent source, absolute name, find in \$cwd/basename)"
# s2-da
test_src ${testtmpdir} ${srcfile} ${binfile} \
${testtmpdir}/subdir/dir${testtmpdir}/subdir/src \
${testtmpdir}/subdir/cwd \
"dir ${testtmpdir}/subdir/dir" "file ${binfile}" \
"l main" \
{1.main\(\){}.*} \
"openp s2-da (non-existent source, absolute name, find in <dir>/absolute)"
# s2-d
test_src ${testtmpdir} ${srcfile} ${binfile} \
${testtmpdir}/subdir/dir \
${testtmpdir}/subdir/cwd \
"dir ${testtmpdir}/subdir/dir" "file ${binfile}" \
"l main" \
{1.main\(\){}.*} \
"openp s2-d (non-existent source, absolute name, find in <dir>/basename)"
# s3+
test_src ${testtmpdir}/subdir src/${srcname} ${binfile} \
"" \
${testtmpdir}/subdir/cwd \
"file ${binfile}" "" \
"l main" \
{1.main\(\){}.*} \
"openp s3+ (existing source, relative name)"
# s3-.r
test_src ${testtmpdir}/subdir src/${srcname} ${binfile} \
${testtmpdir}/subdir/cwd/src \
${testtmpdir}/subdir/cwd \
"file ${binfile}" "" \
"l main" \
{1.main\(\){}.*} \
"openp s3-.r (non-existent source, relative name, find in \$cwd/relative)"
# s3-c
test_src ${testtmpdir}/subdir src/${srcname} ${binfile} \
${testtmpdir}/subdir \
${testtmpdir}/subdir/cwd \
"file ${binfile}" "" \
"l main" \
{1.main\(\){}.*} \
"openp s3-c (non-existent source, relative name, find in \$cdir/basename)"
# s3-.
test_src ${testtmpdir}/subdir src/${srcname} ${binfile} \
${testtmpdir}/subdir/cwd \
${testtmpdir}/subdir/cwd \
"file ${binfile}" "" \
"l main" \
{1.main\(\){}.*} \
"openp s3-. (non-existent source, relative name, find in \$cwd/basename)"
# s3-da
test_src ${testtmpdir}/subdir src/${srcname} ${binfile} \
${testtmpdir}/subdir/dir${testtmpdir}/subdir \
${testtmpdir}/subdir/cwd \
"dir ${testtmpdir}/subdir/dir" "file ${binfile}" \
"l main" \
{1.main\(\){}.*} \
"openp s3-da (non-existent source, relative name, find in <dir>/\$cdir/relative)"
# s3-dr
test_src ${testtmpdir}/subdir src/${srcname} ${binfile} \
${testtmpdir}/subdir/dir/src \
${testtmpdir}/subdir/cwd \
"dir ${testtmpdir}/subdir/dir" "file ${binfile}" \
"l main" \
{1.main\(\){}.*} \
"openp s3-dr (non-existent source, relative name, find in <dir>/relative)"
# s3-d
test_src ${testtmpdir}/subdir src/${srcname} ${binfile} \
${testtmpdir}/subdir/dir \
${testtmpdir}/subdir/cwd \
"dir ${testtmpdir}/subdir/dir" "file ${binfile}" \
"l main" \
{1.main\(\){}.*} \
"openp s3-d (non-existent source, relative name, find in <dir>/basename)"
# s4+
test_src ${testtmpdir}/subdir/src ./${srcname} ${binfile} \
"" \
${testtmpdir}/subdir/cwd \
"file ${binfile}" "" \
"l main" \
{1.main\(\){}.*} \
"openp s4+ (existing source, in the current dir)"
# s4-.
test_src ${testtmpdir}/subdir/src ./${srcname} ${binfile} \
${testtmpdir}/subdir/cwd \
${testtmpdir}/subdir/cwd \
"file ${binfile}" "" \
"l main" \
{1.main\(\){}.*} \
"openp s4-. (non-existent source, in the current dir, find in \$cwd/basename)"
# s4-da
test_src ${testtmpdir}/subdir/src ./${srcname} ${binfile} \
${testtmpdir}/subdir/dir${testtmpdir}/subdir/src \
${testtmpdir}/subdir/cwd \
"dir ${testtmpdir}/subdir/dir" "file ${binfile}" \
"l main" \
{1.main\(\){}.*} \
"openp s4-da (non-existent source, in the current dir, find in <dir>/\$cdir/basename)"
# s4-d
test_src ${testtmpdir}/subdir/src ./${srcname} ${binfile} \
${testtmpdir}/subdir/dir \
${testtmpdir}/subdir/cwd \
"dir ${testtmpdir}/subdir/dir" "file ${binfile}" \
"l main" \
{1.main\(\){}.*} \
"openp s4-d (non-existent source, in the current dir, find in <dir>/basename)"
# s5+
test_src ${testtmpdir}/subdir/src/subdir ../${srcname} ${binfile} \
"" \
${testtmpdir}/subdir/cwd \
"file ${binfile}" "" \
"l main" \
{1.main\(\){}.*} \
"openp s5+ (existing source, in the upper dir)"
# s5-.r
test_src ${testtmpdir}/subdir/src/subdir ../${srcname} ${binfile} \
${testtmpdir}/subdir \
${testtmpdir}/subdir/cwd \
"file ${binfile}" "" \
"l main" \
{1.main\(\){}.*} \
"openp s5-.r (non-existent source, in the upper dir, find in \$cwd/relative)"
# s5-c
test_src ${testtmpdir}/subdir/src/subdir ../${srcname} ${binfile} \
${testtmpdir}/subdir/src/subdir \
${testtmpdir}/subdir/cwd \
"file ${binfile}" "" \
"l main" \
{1.main\(\){}.*} \
"openp s5-c (non-existent source, in the upper dir, find in \$cdir/basename)"
# s5-.
test_src ${testtmpdir}/subdir/src/subdir ../${srcname} ${binfile} \
${testtmpdir}/subdir/cwd \
${testtmpdir}/subdir/cwd \
"file ${binfile}" "" \
"l main" \
{1.main\(\){}.*} \
"openp s5-. (non-existent source, in the upper dir, find in \$cdir/basename)"
# s5-da
test_src ${testtmpdir}/subdir/src/subdir ../${srcname} ${binfile} \
${testtmpdir}/subdir/dir${testtmpdir}/subdir/src/subdir \
${testtmpdir}/subdir/cwd \
"dir ${testtmpdir}/subdir/dir" "file ${binfile}" \
"l main" \
{1.main\(\){}.*} \
"openp s5-da (non-existent source, in the upper dir, find in <dir>/\$cdir/relative)"
# s5-dr
test_src ${testtmpdir}/subdir/src/subdir ../${srcname} ${binfile} \
${testtmpdir}/subdir \
${testtmpdir}/subdir/cwd \
"dir ${testtmpdir}/subdir/dir" "file ${binfile}" \
"l main" \
{1.main\(\){}.*} \
"openp s5-dr (non-existent source, in the upper dir, find in <dir>/relative)"
# s5-d
test_src ${testtmpdir}/subdir/src/subdir ../${srcname} ${binfile} \
${testtmpdir}/subdir/dir \
${testtmpdir}/subdir/cwd \
"dir ${testtmpdir}/subdir/dir" "file ${binfile}" \
"l main" \
{1.main\(\){}.*} \
"openp s5-d (non-existent source, in the upper dir, find in <dir>/basename)"
system "rm -rf ${testtmpdir}"
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-16 14:41 testcase for "absolute source" patch Baurzhan Ismagulov
@ 2004-08-16 15:56 ` Michael Chastain
2004-08-16 18:21 ` Baurjan Ismagulov
2004-08-16 19:15 ` Michael Chastain
1 sibling, 1 reply; 32+ messages in thread
From: Michael Chastain @ 2004-08-16 15:56 UTC (permalink / raw)
To: gdb-patches, baurzhan.ismagulov
Hi Baurjan,
Thanks very much for your contribution. It will be my job to
merge it into gdb.
Before we go any further, I need to ask: have you executed a
copyright assignment with the FSF for gdb?
If you already have an assignment, just let me know.
If you haven't made an assignment yet, you need to make an assignment
before I can do anything. If you have a job writing software, the FSF
will also need an assignment or a disclaimer from your employer.
Send e-mail to assign@gnu.org to talk to the assignments clerk.
Mention these things: that you want to make an assignment for gdb,
what country you live in, and what your day job is. The clerk will
take it from there.
The copyright assignment process involves some time and paperwork,
but it's essential for the legal protection of our source code.
Michael Chastain
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-16 15:56 ` Michael Chastain
@ 2004-08-16 18:21 ` Baurjan Ismagulov
0 siblings, 0 replies; 32+ messages in thread
From: Baurjan Ismagulov @ 2004-08-16 18:21 UTC (permalink / raw)
To: gdb-patches
On Mon, Aug 16, 2004 at 11:56:00AM -0400, Michael Chastain wrote:
> Before we go any further, I need to ask: have you executed a
> copyright assignment with the FSF for gdb?
Yes. The copyright clerk confirmed that the copyright assignment and
the employer disclaimer were received by the FSF.
With kind regards,
Baurjan.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-16 14:41 testcase for "absolute source" patch Baurzhan Ismagulov
2004-08-16 15:56 ` Michael Chastain
@ 2004-08-16 19:15 ` Michael Chastain
2004-08-16 20:38 ` Andreas Schwab
2004-08-18 13:03 ` Baurzhan Ismagulov
1 sibling, 2 replies; 32+ messages in thread
From: Michael Chastain @ 2004-08-16 19:15 UTC (permalink / raw)
To: gdb-patches, baurzhan.ismagulov
Okay, here's a bunch of feedback on superficial stuff.
I haven't gotten to the substantive level of the test yet,
but it looks very useful.
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
This e-mail address is obsolete, so drop this.
# XXX: We assume that build == host.
Not good. You have to at least try to work in a build != host
environment.
gdb_compile already downloads the srcfile from build to host.
You can do "remote_download host" for more files, and
"remote_exec host" to make directories and stuff.
Style notes:
Put a comment before each proc. It can be as short as one line.
Set the indentation level to 4 spaces.
But tabs are still always eight spaces.
(shiftwidth=4 tabstob=8 in vi)
(i don't know the emacs settings)
Check for errors on every system call, including cd.
See lib/gdb.exp proc gdb_get_line_number for one way to do this;
if { [ catch { cd ... } message ] } then {
perror "$message"
return -1
}
You don't need as many quotes and braces as you've been using.
This works just fine:
if { [gdb_compile $src $bin executable \
It works even if $src or $bin have magic characters or spaces
in them. Unlike shell syntax, Tcl figures out the word boundaries
first and then expands $src . So $src always expands to exactly
one word.
If you look at gdb_get_line_number again, you will see that I
did not know that either when I wrote it!
Please don't name your variable "tmp". Conceptually it's not
even temporary; its value is the permanent directory that you
keep coming back to. How about "old_pwd" or "dir_current"
or "oldpwd" or just about anything but "tmp".
system
Don't use system; use "remote_exec build ..." to run on the
build machine or "remote_exec host ..." to run on the host
machine. You usually want "remote_exec host ...".
echo
Change this so that openp.c is a real file. This makes it
easier to find things.
Also "main(){}" is not a legal Ansi C program. Change it to "int
main(){return 0;}" at least. You can arrange the spacing any way
you want -- it's explicitly encouraged to have a diversity of
program formatting in the test programs. But make it Ansi C. Then
you can drop the "-w" flag in gdb_compile. Then I won't have
problems later with hpux ansi c or ibm aix xlc.
It's cool to have a one-line C program. It's a trivial program
so it does not need a copyright notice or license.
Don't bother removing testtmpdir at the end unless it's really
large, and it's nowhere near that large. If somebody is
investigating what happened with your test, they will want this
directory to exist.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-16 19:15 ` Michael Chastain
@ 2004-08-16 20:38 ` Andreas Schwab
2004-08-18 13:03 ` Baurzhan Ismagulov
1 sibling, 0 replies; 32+ messages in thread
From: Andreas Schwab @ 2004-08-16 20:38 UTC (permalink / raw)
To: Michael Chastain; +Cc: gdb-patches, baurzhan.ismagulov
Michael Chastain <mec.gnu@mindspring.com> writes:
> Set the indentation level to 4 spaces.
> But tabs are still always eight spaces.
> (shiftwidth=4 tabstob=8 in vi)
> (i don't know the emacs settings)
Just use the Emacs defaults.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, MaxfeldstraÃe 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-16 19:15 ` Michael Chastain
2004-08-16 20:38 ` Andreas Schwab
@ 2004-08-18 13:03 ` Baurzhan Ismagulov
2004-08-18 15:31 ` Michael Chastain
1 sibling, 1 reply; 32+ messages in thread
From: Baurzhan Ismagulov @ 2004-08-18 13:03 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1120 bytes --]
Hello, Michael!
Attached is the new version.
I've got a couple of questions:
1. Just for my knowledge: I've found the "int main" requirement in C99
5.1.2.2.1. But I couldn't find anything about function definitions
without a return type defaulting to int (i.e., should the compiler
treat the return type as int if it isn't specified?). Does C99 and
previous standards say anything about that? Is it different for
declarations and definitions?
2. As far as I could see, remote_exec host starts a new shell each time.
How should one do the following right?
remote_exec host cd ...
remote_exec host gdb_compile ...
remote_exec host cd ...
I'm reluctant to write scripts since I have to do the same with
gdb_test, too.
Changes:
* Remove the obsolete e-mail address.
* Add partial build != host support.
* Add comments before each proc.
* Fix indentation.
* Check for errors on system calls.
* Remove excessive quoting.
* Name the variables better.
* Save openp.c as a file.
* Make openp.c ANSI-compliant.
* Drop removing the test directory hierarchy.
With kind regards,
Baurjan.
[-- Attachment #2: openp.exp --]
[-- Type: text/plain, Size: 14454 bytes --]
# Copyright (C) 2004 Free Software Foundation, 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# This file was written by Baurjan Ismagulov <ibr@ata.cs.hun.edu.tr>.
# $Id: openp.exp,v 1.4 2004/08/18 12:45:58 ibr Exp $
# This file tests whether gdb finds the files properly given the
# following file names:
# 1. basename: file
# 2. absolute: /dir/file
# 3. relative: dir/file
# 4. in current: ./file
# 5. in upper: ../file
# Called in case of error.
proc handle_error {msg} {
perror $msg
}
# Resolve possibe /./ and /../ within the given path. We are paranoid
# about cases like "mkdir -p a/../b" (although GNU coreutils and Solaris
# 8 seem to handle this particular case).
# XXX: Can this be replaced with tcl path manipulation routines?
proc canonize_path {dir} {
set old_dir [pwd]
cd $dir
set new_dir [pwd]
cd $old_dir
return $new_dir
}
# Compile $src to $bin in $cdir.
# XXX: build == host.
proc cdir_compile {cdir src bin} {
if [catch {set old_dir [pwd]} msg] {
handle_error $msg
}
if [catch {cd $cdir} msg] {
handle_error $msg
}
if {[gdb_compile $src $bin executable debug] != ""} {
gdb_suppress_entire_file "Testcase compile failed."
}
if [catch {cd $old_dir} msg] {
handle_error $msg
}
}
# Move the binary to $bin_dir, add $path_dir to PATH, gdb_test in the
# $gdb_wd directory.
# XXX: build == host.
proc test_bin {gdb_wd bin_dir path_dir gdb_test_cmd gdb_resp txt} {
global binname
global binfile
global env
if {$bin_dir != ""} {
remote_exec host "mv $binfile $bin_dir"
}
if {$path_dir != "" && [info exists env(PATH)]} {
if [catch {set old_path $env(PATH)} msg] {
handle_error $msg
}
# XXX: Directory separator in PATH?
if [catch {set env(PATH) $env(PATH):$path_dir} msg] {
handle_error $msg
}
}
if [catch {set old_dir [pwd]} msg] {
handle_error $msg
}
if [catch {cd $gdb_wd} msg] {
handle_error $msg
}
gdb_start
gdb_test $gdb_test_cmd $gdb_resp $txt
gdb_exit
if [catch {cd $old_dir} msg] {
handle_error $msg
}
if [info exists old_path] {
if [catch {set env(PATH) $old_path} msg] {
handle_error $msg
}
}
if {$bin_dir != ""} {
remote_exec host "mv $bin_dir/$binname $binfile"
}
}
# Compile in $comp_dir, move the source to $srcfile_dir, perform $cmd1
# and $cmd2, gdb_test in gdb_wd.
# XXX: build == host.
proc test_src {comp_dir comp_srcfile comp_binfile srcfile_dir
gdb_wd cmd1 cmd2 gdb_test_cmd gdb_resp txt} {
global srcname;
global srcfile;
if [catch {set old_dir [pwd]} msg] {
handle_error $msg
}
cdir_compile $comp_dir $comp_srcfile $comp_binfile
if {$srcfile_dir != ""} {
remote_exec host "mv $srcfile $srcfile_dir"
}
if [catch {cd $gdb_wd} msg] {
handle_error $msg
}
gdb_start
if {$cmd1 != ""} {
gdb_test $cmd1 ""
}
if {$cmd2 != ""} {
gdb_test $cmd2 ""
}
gdb_test $gdb_test_cmd $gdb_resp $txt
gdb_exit
if [catch {cd $old_dir} msg] {
handle_error $msg
}
if {$srcfile_dir != ""} {
remote_exec host "mv $srcfile_dir/$srcname $srcfile"
}
}
if $tracelevel then {
strace $tracelevel
}
set prms_id 0
set bug_id 0
set testname "openp"
set srcname $testname.c
set binname $testname.bin
set testtmpdir [canonize_path $objdir/$subdir]/$testname
set srcfile $testtmpdir/subdir/src/$srcname
set binfile $testtmpdir/subdir/bin/$binname
set src_txt {1.int main\(\){return 0;}.*}
remote_exec host "mkdir -p $testtmpdir/subdir/src/subdir"
remote_exec host "mkdir -p $testtmpdir/subdir/bin/subdir"
remote_exec host "mkdir -p $testtmpdir/subdir/cwd/bin"
remote_exec host "mkdir -p $testtmpdir/subdir/cwd/src"
remote_exec host "mkdir -p $testtmpdir/subdir/dir$testtmpdir/subdir/src/subdir"
remote_exec host "mkdir -p $testtmpdir/subdir/dir$testtmpdir/subdir/bin"
remote_exec host "mkdir -p $testtmpdir/subdir/dir/src"
remote_exec host "mv $objdir/$subdir/$testname.c $srcfile"
cdir_compile $testtmpdir $srcfile $binfile
# b1+
test_bin $testtmpdir/subdir/bin \
"" \
"" \
"file $binname" \
"Reading symbols from $binfile\\.\\.\\.done\\..*" \
"openp b1+ (existing binary, basename)"
# b1-
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir/bin \
"file $binname" \
"Reading symbols from $binfile\\.\\.\\..*done\\..*" \
"openp b1- (non-existent binary, basename, find in PATH)"
# b2+
test_bin $testtmpdir/subdir/cwd \
"" \
"" \
"file $binfile" \
"Reading symbols from $binfile\\.\\.\\.done\\..*" \
"openp b2+ (existing binary, absolute name)"
# b2-a
# XXX: Should we match locale-specific messages?
test_bin $testtmpdir/subdir/cwd \
$testtmpdir/subdir/dir$testtmpdir/subdir/bin \
$testtmpdir/subdir/dir \
"file $binfile" \
"$binfile: .*" \
"openp b2-a (non-existent binary, absolute name, don't look in <PATH_dir>/absolute)"
# b2-
# XXX: Should we match locale-specific messages?
test_bin $testtmpdir/subdir/cwd \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/dir \
"file $binfile" \
"$binfile: .*" \
"openp b2- (non-existent binary, absolute name, don't look for <PATH_dir>/basename)"
# b3+
test_bin $testtmpdir/subdir \
"" \
"" \
"file bin/$binname" \
"Reading symbols from $binfile\\.\\.\\.done\\..*" \
"openp b3+ (existing binary, relative name)"
# b3-r
# XXX: locale
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir \
"file bin/$binname" \
"bin/$binname: .*" \
"openp b3-r (non-existent binary, relative name, don't look in <PATH_dir>/relative)"
# b3-
# XXX: locale
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir/bin \
"file bin/$binname" \
"bin/$binname: .*" \
"openp b3- (non-existent binary, relative name, don't look in <PATH_dir>/basename)"
# b4+
test_bin $testtmpdir/subdir/bin \
"" \
"" \
"file ./$binname" \
"Reading symbols from $binfile\\.\\.\\.done\\..*" \
"openp b4+ (existing binary, in the current dir)"
# b4-
# XXX: locale
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir/bin \
"file ./$binname" \
"\\./$binname: .*" \
"openp b4- (non-existent binary, in the current dir, don't look in PATH)"
# b5+
test_bin $testtmpdir/subdir/bin/subdir \
"" \
"" \
"file ../$binname" \
"Reading symbols from $binfile\\.\\.\\.done\\..*" \
"openp b5+ (existing binary, in the upper dir)"
# b5-r
# XXX: locale
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir/bin/subdir \
"file ../$binname" \
"\\.\\./$binname: .*" \
"openp b5-r (non-existent binary, in the upper dir name, don't look in <PATH_dir>/relative)"
# b5-
# XXX: locale
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir/bin \
"file ../$binname" \
"\\.\\./$binname: .*" \
"openp b5- (non-existent binary, in the upper dir name, don't look in <PATH_dir>/basename)"
# s1+
test_src $testtmpdir/subdir/src $srcname $binfile \
"" \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s1+ (existing source, basename)"
# s1-.
test_src $testtmpdir/subdir/src $srcname $binfile \
$testtmpdir/subdir/cwd \
$testtmpdir/subdir/cwd \
"file $binfile" ""\
"l main" \
$src_txt \
"openp s1-. (non-existent source, basename, find in \$cwd/basename)"
# s1-da
test_src $testtmpdir/subdir/src $srcname $binfile \
$testtmpdir/subdir/dir$testtmpdir/subdir/src \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s1-da (non-existent source, basename, find in <dir>/\$cdir/basename)"
# s1-d
test_src $testtmpdir/subdir/src $srcname $binfile \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s1-d (non-existent source, basename, find in <dir>/basename)"
# s2+
test_src $testtmpdir $srcfile $binfile \
"" \
$testtmpdir/subdir/cwd \
"file $binfile" ""\
"l main" \
$src_txt \
"openp s2+ (existing source, absolute name)"
# s2-.
test_src $testtmpdir $srcfile $binfile \
$testtmpdir/subdir/cwd \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s2-. (non-existent source, absolute name, find in \$cwd/basename)"
# s2-da
test_src $testtmpdir $srcfile $binfile \
$testtmpdir/subdir/dir$testtmpdir/subdir/src \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s2-da (non-existent source, absolute name, find in <dir>/absolute)"
# s2-d
test_src $testtmpdir $srcfile $binfile \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s2-d (non-existent source, absolute name, find in <dir>/basename)"
# s3+
test_src $testtmpdir/subdir src/$srcname $binfile \
"" \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s3+ (existing source, relative name)"
# s3-.r
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir/cwd/src \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s3-.r (non-existent source, relative name, find in \$cwd/relative)"
# s3-c
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s3-c (non-existent source, relative name, find in \$cdir/basename)"
# s3-.
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir/cwd \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s3-. (non-existent source, relative name, find in \$cwd/basename)"
# s3-da
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir/dir$testtmpdir/subdir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s3-da (non-existent source, relative name, find in <dir>/\$cdir/relative)"
# s3-dr
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir/dir/src \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s3-dr (non-existent source, relative name, find in <dir>/relative)"
# s3-d
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s3-d (non-existent source, relative name, find in <dir>/basename)"
# s4+
test_src $testtmpdir/subdir/src ./$srcname $binfile \
"" \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s4+ (existing source, in the current dir)"
# s4-.
test_src $testtmpdir/subdir/src ./$srcname $binfile \
$testtmpdir/subdir/cwd \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s4-. (non-existent source, in the current dir, find in \$cwd/basename)"
# s4-da
test_src $testtmpdir/subdir/src ./$srcname $binfile \
$testtmpdir/subdir/dir$testtmpdir/subdir/src \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s4-da (non-existent source, in the current dir, find in <dir>/\$cdir/basename)"
# s4-d
test_src $testtmpdir/subdir/src ./$srcname $binfile \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s4-d (non-existent source, in the current dir, find in <dir>/basename)"
# s5+
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
"" \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s5+ (existing source, in the upper dir)"
# s5-.r
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s5-.r (non-existent source, in the upper dir, find in \$cwd/relative)"
# s5-c
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir/src/subdir \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s5-c (non-existent source, in the upper dir, find in \$cdir/basename)"
# s5-.
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir/cwd \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s5-. (non-existent source, in the upper dir, find in \$cdir/basename)"
# s5-da
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir/dir$testtmpdir/subdir/src/subdir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s5-da (non-existent source, in the upper dir, find in <dir>/\$cdir/relative)"
# s5-dr
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s5-dr (non-existent source, in the upper dir, find in <dir>/relative)"
# s5-d
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s5-d (non-existent source, in the upper dir, find in <dir>/basename)"
remote_exec host "mv $srcfile $objdir/$subdir"
[-- Attachment #3: openp.c --]
[-- Type: text/x-csrc, Size: 22 bytes --]
int main(){return 0;}
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-18 13:03 ` Baurzhan Ismagulov
@ 2004-08-18 15:31 ` Michael Chastain
2004-08-18 15:50 ` Baurzhan Ismagulov
2004-08-18 15:50 ` Daniel Jacobowitz
0 siblings, 2 replies; 32+ messages in thread
From: Michael Chastain @ 2004-08-18 15:31 UTC (permalink / raw)
To: gdb-patches, baurzhan.ismagulov
Hi Baurzhan,
bi> 1. Just for my knowledge: I've found the "int main" requirement in C99
bi> 5.1.2.2.1. But I couldn't find anything about function definitions
bi> without a return type defaulting to int (i.e., should the compiler
bi> treat the return type as int if it isn't specified?). Does C99 and
bi> previous standards say anything about that? Is it different for
bi> declarations and definitions?
I don't have copies of the standards documents, so I'm working from
The C++ Programming Language 2nd Edition, Kernighan and Ritchie.
To my surprise, I found out that in this book, and presumably in
the C89 standard, a function with no return type defaults to "int".
From section 1.9:
"This line also declares that getline returns an int;
since int is the default return type, it could be omitted."
I don't think it's different for declarations and definitions.
In a normal program, the FSF coding standards would apply. But a test
suite is contra-variant. Anything that is legal C89 and that doesn't
make gcc give a warning is okay in a test program, and variation is good
because it exercises different parts of gdb.
So it's okay to leave your "main" with no return type.
But take out the "-w" from gdb_compile.
bi> 2. As far as I could see, remote_exec host starts a new shell each time.
bi> How should one do the following right?
bi>
bi> remote_exec host cd ...
bi> remote_exec host gdb_compile ...
bi> remote_exec host cd ...
bi>
bi> I'm reluctant to write scripts since I have to do the same with
bi> gdb_test, too.
I don't know.
Dejagnu's desire to manage the filenames on the host machine conflicts
with your desire for explicit control of the filenames.
Normally you would call gdb_compile (not remote_exec host gdb_compile).
gdb_compile calls target_compile, which calls default_target_compile,
which calls remote_exec, which calls call_remote. You would need a
hook inside call_remote to send several commands to the same shell.
Ick!
Alternatively, you would need to forsake gdb_compile and do everything
at the "remote_exec host cd ... && gcc ... && cd ...", basically
duplicating the machinery inside default_target_compile to process
the options (but you know what your own options are) and to find the
name of the c compiler.
I have another issue which demands that I clean up the machinery
that locates compilers. The issue is how to run the test suite
with non-fsf compilers, especially for fortran.
Let me think about this, and I will get back to tonight or tomorrow,
also with detailed feedback on your version #2.
Michael
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-18 15:31 ` Michael Chastain
2004-08-18 15:50 ` Baurzhan Ismagulov
@ 2004-08-18 15:50 ` Daniel Jacobowitz
2004-08-18 15:56 ` Baurjan Ismagulov
1 sibling, 1 reply; 32+ messages in thread
From: Daniel Jacobowitz @ 2004-08-18 15:50 UTC (permalink / raw)
To: Michael Chastain; +Cc: gdb-patches, baurzhan.ismagulov
On Wed, Aug 18, 2004 at 11:31:08AM -0400, Michael Chastain wrote:
> Hi Baurzhan,
>
> bi> 1. Just for my knowledge: I've found the "int main" requirement in C99
> bi> 5.1.2.2.1. But I couldn't find anything about function definitions
> bi> without a return type defaulting to int (i.e., should the compiler
> bi> treat the return type as int if it isn't specified?). Does C99 and
> bi> previous standards say anything about that? Is it different for
> bi> declarations and definitions?
>
> I don't have copies of the standards documents, so I'm working from
> The C++ Programming Language 2nd Edition, Kernighan and Ritchie.
> To my surprise, I found out that in this book, and presumably in
> the C89 standard, a function with no return type defaults to "int".
> >From section 1.9:
>
> "This line also declares that getline returns an int;
> since int is the default return type, it could be omitted."
>
> I don't think it's different for declarations and definitions.
>
> In a normal program, the FSF coding standards would apply. But a test
> suite is contra-variant. Anything that is legal C89 and that doesn't
> make gcc give a warning is okay in a test program, and variation is good
> because it exercises different parts of gdb.
>
> So it's okay to leave your "main" with no return type.
> But take out the "-w" from gdb_compile.
Yes, C89 allows this, and C99 doesn't.
--
Daniel Jacobowitz
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-18 15:31 ` Michael Chastain
@ 2004-08-18 15:50 ` Baurzhan Ismagulov
2004-08-18 17:10 ` Michael Chastain
2004-08-18 19:00 ` Michael Chastain
2004-08-18 15:50 ` Daniel Jacobowitz
1 sibling, 2 replies; 32+ messages in thread
From: Baurzhan Ismagulov @ 2004-08-18 15:50 UTC (permalink / raw)
To: gdb-patches
Hello Michael,
On Wed, Aug 18, 2004 at 11:31:08AM -0400, Michael Chastain wrote:
> So it's okay to leave your "main" with no return type.
> But take out the "-w" from gdb_compile.
I've already specified the return type and removed the flag. I just
wanted to know what I'm doing.
> You would need a hook inside call_remote to send several commands to
> the same shell. Ick!
What about just having pre_cmd and post_cmd in call_remote? Can the same
technique be applied to whatever gets called from gdb_test?
> Alternatively, you would need to forsake gdb_compile and do everything
> at the "remote_exec host cd ... && gcc ... && cd ...", basically
> duplicating the machinery inside default_target_compile to process
> the options (but you know what your own options are) and to find the
> name of the c compiler.
This would work for the compilation, but I'm not sure about gdb_test. Is
there an introduction about the build and host interaction during
gdb_start, gdb_test and gdb_exit?
With kind regards,
Baurjan.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-18 15:50 ` Daniel Jacobowitz
@ 2004-08-18 15:56 ` Baurjan Ismagulov
2004-08-18 16:04 ` Andreas Schwab
0 siblings, 1 reply; 32+ messages in thread
From: Baurjan Ismagulov @ 2004-08-18 15:56 UTC (permalink / raw)
To: gdb-patches
Hello, Daniel!
On Wed, Aug 18, 2004 at 11:50:43AM -0400, Daniel Jacobowitz wrote:
> Yes, C89 allows this, and C99 doesn't.
Is it disallowed for all functions, or just for main?
With kind regards,
Baurjan.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-18 15:56 ` Baurjan Ismagulov
@ 2004-08-18 16:04 ` Andreas Schwab
0 siblings, 0 replies; 32+ messages in thread
From: Andreas Schwab @ 2004-08-18 16:04 UTC (permalink / raw)
To: gdb-patches
Baurjan Ismagulov <ibr@ata.cs.hun.edu.tr> writes:
> Hello, Daniel!
>
> On Wed, Aug 18, 2004 at 11:50:43AM -0400, Daniel Jacobowitz wrote:
>> Yes, C89 allows this, and C99 doesn't.
>
> Is it disallowed for all functions, or just for main?
It is disallowed for everything.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, MaxfeldstraÃe 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-18 15:50 ` Baurzhan Ismagulov
@ 2004-08-18 17:10 ` Michael Chastain
2004-08-18 19:00 ` Michael Chastain
1 sibling, 0 replies; 32+ messages in thread
From: Michael Chastain @ 2004-08-18 17:10 UTC (permalink / raw)
To: gdb-patches, baurzhan.ismagulov
Baurzhan Ismagulov <baurzhan.ismagulov@sbs.com.tr> wrote:
> I've already specified the return type and removed the flag. I just
> wanted to know what I'm doing.
Yeah, it's a tiny issue, and either way is okay.
> What about just having pre_cmd and post_cmd in call_remote? Can the same
> technique be applied to whatever gets called from gdb_test?
And this is a big issue, and no known way is okay.
I haven't spent much time at this level of the code yet.
Basically I have to understand this code, then probably
re-design parts of it to add more features.
> This would work for the compilation, but I'm not sure about gdb_test.
> Is there an introduction about the build and host interaction during
> gdb_start, gdb_test and gdb_exit?
No, there isn't.
Michael
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-18 15:50 ` Baurzhan Ismagulov
2004-08-18 17:10 ` Michael Chastain
@ 2004-08-18 19:00 ` Michael Chastain
2004-08-18 22:03 ` Baurjan Ismagulov
1 sibling, 1 reply; 32+ messages in thread
From: Michael Chastain @ 2004-08-18 19:00 UTC (permalink / raw)
To: gdb-patches, baurzhan.ismagulov
Hi Barjuan,
I have to defer this test script for a while.
The problem is default_target_compile in dejagnu.
default_target_compile really wants to be in charge of downloading files
from build to host and managing the filenames on the host. This
directly conflicts with your script, which wants to manage the names
on the host.
default_target_compile has at least two other problems. First, it needs
to support tester-specified compilers for arbitrary languages. Second,
it has an annoying habit of printing any compiler messages two or
three times.
I don't have time to work on default_target_compile right now. And it
will be hard because it's part of dejagnu, an external package.
I might end up actually copying the 300 lines of default_target_compile
into gdb_compile and then working on it from there.
But I can't start a task to do that much infrastructure work right now.
Sorry,
Michael
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-18 19:00 ` Michael Chastain
@ 2004-08-18 22:03 ` Baurjan Ismagulov
2004-08-18 22:46 ` Michael Chastain
2004-08-18 23:33 ` Michael Chastain
0 siblings, 2 replies; 32+ messages in thread
From: Baurjan Ismagulov @ 2004-08-18 22:03 UTC (permalink / raw)
To: gdb-patches
Hello Michael,
On Wed, Aug 18, 2004 at 03:00:06PM -0400, Michael Chastain wrote:
> The problem is default_target_compile in dejagnu.
> default_target_compile really wants to be in charge of downloading files
> from build to host and managing the filenames on the host. This
> directly conflicts with your script, which wants to manage the names
> on the host.
As far as I could understand, there are also other tests that do not
work well in build != host scenario. I don't remember any decision from
the recent thread on this issue. OTOH, this test functions locally and
checks a number of cases, at least two of which have been subject to
regressions. I think this was the reason why Andrew asked for it in the
first place. While I agree that fixing the infrastructure is also
important, may I suggest that we have at least local checking in the
trunk? After all, whatever the state of the infrastructure, we still
want to check for bugs; a non-ideal test is better than no test at all,
IMHO. I also don't see any problem in modifying the test as the
infrastructure changes, whereas not having the test is going to lead to
bugs, especially given an open PR involving the respective subsystem.
To summarize: the test is working probably for 95% of the users. I'm
willing to make the test as close to the ideal in your head as possible,
and I can do it only now. I suggest that we improve what can be improved
and leave the rest for better times.
What do you think?
With kind regards,
Baurjan.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-18 22:03 ` Baurjan Ismagulov
@ 2004-08-18 22:46 ` Michael Chastain
2004-08-18 23:33 ` Michael Chastain
1 sibling, 0 replies; 32+ messages in thread
From: Michael Chastain @ 2004-08-18 22:46 UTC (permalink / raw)
To: ibr, gdb-patches
Baurjan Ismagulov <ibr@ata.cs.hun.edu.tr> wrote:
> I don't remember any decision from the recent thread on this issue.
That's true. The last time I posted about it, I was leaning towards
requiring that build != host work, partly because Dan Kegel's
documentation on testing cross-gcc explicitly describes how to
set up build != host, and partly because Felix Lee stepped up and
said that he had used it in the past.
But I failed to announce a decision. "leaning towards" is not
really a decision.
> As far as I could understand, there are also other tests that do not
> work well in build != host scenario.
And that's also true. I posted a list of 11 test scripts that don't
work with build != host because they neglect to download their .h files.
There are probably others that fail for other reasons as well.
> While I agree that fixing the infrastructure is also important, may I
> suggest that we have at least local checking in the trunk?
I'm going to reject that argument. I don't want the test suite
to add more stuff that runs in some conditions but not others.
That becomes a source of unending maintenance work.
To me, a flawed test *is* sometimes worse than no test at all, because
then I have to maintain it. I would rather have more time (and more of
other people's time) actually running the test suite, reporting the
results, analyzing the failures, and creating good PR's, rather than
adding test scripts that don't work in some supported environments.
As long as we have a "build != host" requirement, I won't accept any
scripts that obviously won't run in that environment.
I'm still open to killing that requirement. You've exhibited a test
script that (a) is useful and (b) has a hard time meeting that
requirement. That balances against the usefulness of keeping
build != host.
Michael
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-18 22:03 ` Baurjan Ismagulov
2004-08-18 22:46 ` Michael Chastain
@ 2004-08-18 23:33 ` Michael Chastain
2004-08-19 4:03 ` Eli Zaretskii
` (3 more replies)
1 sibling, 4 replies; 32+ messages in thread
From: Michael Chastain @ 2004-08-18 23:33 UTC (permalink / raw)
To: ibr; +Cc: gdb-patches
Okay. I went and stared into space for a while about this. Here is
what I am going to do.
I had a public comment period about build != host. So everybody's had
a chance to provide input. Well, everybody who as active in gdb at a
certain time last month.
I'm going to sleep on it. Tomorrow morning, I'll make a final decision
about build != host, one way or the other.
If I kill build != host, and Eli accepts my doco patch, then we can
proceed with openp.exp. openp.exp will get a lot simpler too. (BTW,
when I ran the last version you sent me, I got 39 ERROR results and zero
PASS, so it needs some more work). It still might run into
infrastructure problems, but they will be much less complex when
you can actually use "cd" in the test script.
If I keep build != host, then openp.exp is dead until we have more
infrastructure, probably a replacement for default_target_compile will
be needed.
I know it's very discouraging to work on a patch and then have it
rejected. I've had patches rejected. I hope this doesn't make you
forsake gdb.
Michael
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-18 23:33 ` Michael Chastain
@ 2004-08-19 4:03 ` Eli Zaretskii
2004-08-19 8:34 ` Michael Chastain
2004-08-19 8:56 ` Michael Chastain
` (2 subsequent siblings)
3 siblings, 1 reply; 32+ messages in thread
From: Eli Zaretskii @ 2004-08-19 4:03 UTC (permalink / raw)
To: Michael Chastain; +Cc: ibr, gdb-patches
> Date: Wed, 18 Aug 2004 19:33:29 -0400
> From: Michael Chastain <mec.gnu@mindspring.com>
>
> If I kill build != host, and Eli accepts my doco patch, then we can
> proceed with openp.exp. openp.exp will get a lot simpler too.
Sorry, what doco patch? Did I miss some patch that I didn't review?
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-19 4:03 ` Eli Zaretskii
@ 2004-08-19 8:34 ` Michael Chastain
0 siblings, 0 replies; 32+ messages in thread
From: Michael Chastain @ 2004-08-19 8:34 UTC (permalink / raw)
To: eliz; +Cc: ibr, gdb-patches
Eli Zaretskii <eliz@gnu.org> wrote:
> Sorry, what doco patch? Did I miss some patch that I didn't review?
No, it was only a proposal, not an RFA.
http://sources.redhat.com/ml/gdb/2004-07/msg00306.html
The proposal died out but it's back on the table now.
Michael
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-18 23:33 ` Michael Chastain
2004-08-19 4:03 ` Eli Zaretskii
@ 2004-08-19 8:56 ` Michael Chastain
2004-08-19 9:37 ` Baurjan Ismagulov
2004-08-19 9:34 ` Baurjan Ismagulov
2004-08-26 20:32 ` Baurjan Ismagulov
3 siblings, 1 reply; 32+ messages in thread
From: Michael Chastain @ 2004-08-19 8:56 UTC (permalink / raw)
To: ibr; +Cc: gdb-patches
Michael Chastain <mec.gnu@mindspring.com> wrote:
> I'm going to sleep on it. Tomorrow morning, I'll make a final decision
> about build != host, one way or the other.
My decision is: build != host is a supported way to run the
test suite. However, individual test scripts can drop out with
UNSUPPORTED if they want, with this code:
if { [is_remote host] } {
unresolved "This test script does not work on a remote host."
return -1
}
The dejagnu documentation for UNRESOLVED says:
This message is also used for any test that requires human
intervention because it is beyond the abilities of the testing
framework.
I will write a doco patch for build != host and post it for
Eli's review.
Michael
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-18 23:33 ` Michael Chastain
2004-08-19 4:03 ` Eli Zaretskii
2004-08-19 8:56 ` Michael Chastain
@ 2004-08-19 9:34 ` Baurjan Ismagulov
2004-08-19 9:55 ` Michael Chastain
2004-08-26 20:32 ` Baurjan Ismagulov
3 siblings, 1 reply; 32+ messages in thread
From: Baurjan Ismagulov @ 2004-08-19 9:34 UTC (permalink / raw)
To: gdb-patches
On Wed, Aug 18, 2004 at 07:33:29PM -0400, Michael Chastain wrote:
> (BTW,
> when I ran the last version you sent me, I got 39 ERROR results and zero
> PASS, so it needs some more work).
Which version of gdb are you using? Are you compiling in another
directory?
> I hope this doesn't make you forsake gdb.
No, it is really just a matter of time -- I'm going to switch to a new
project (at work) and won't have much time for a few months.
With kind regards,
Baurjan.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-19 8:56 ` Michael Chastain
@ 2004-08-19 9:37 ` Baurjan Ismagulov
0 siblings, 0 replies; 32+ messages in thread
From: Baurjan Ismagulov @ 2004-08-19 9:37 UTC (permalink / raw)
To: gdb-patches
On Thu, Aug 19, 2004 at 04:56:19AM -0400, Michael Chastain wrote:
> My decision is: build != host is a supported way to run the
> test suite. However, individual test scripts can drop out with
> UNSUPPORTED if they want, with this code:
I think that this is a reasonable compromise.
With kind regards,
Baurjan.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-19 9:34 ` Baurjan Ismagulov
@ 2004-08-19 9:55 ` Michael Chastain
2004-08-19 10:10 ` Baurjan Ismagulov
2004-08-26 20:36 ` Baurjan Ismagulov
0 siblings, 2 replies; 32+ messages in thread
From: Michael Chastain @ 2004-08-19 9:55 UTC (permalink / raw)
To: ibr, gdb-patches
Baurjan Ismagulov <ibr@ata.cs.hun.edu.tr> wrote:
> Which version of gdb are you using?
native i686-pc-linux-gnu, red hat 8.0
gdb HEAD 2004-08-17
gcc 3.4.1, binutils 2.15, dwarf-2
> Are you compiling in another directory?
Yes.
I do build gdb in a different directory from the source.
My configuration commands are:
newtree /berman/fsf/_current_/berman/build/target/native/gdb/HEAD
newtree /berman/fsf/_current_/berman/install/target/native/gdb/HEAD
newtree /berman/fsf/_current_/berman/log/target/native/gdb/HEAD
chdir /berman/fsf/_current_/berman/build/target/native/gdb/HEAD
/berman/fsf/_current_/source/gdb/HEAD/src/configure --prefix=/berman/fsf/_current_/berman/install/target/native/gdb/HEAD > /berman/fsf/_current_/berman/log/target/native/gdb/HEAD/configure.log 2>&1
(newtree is like: rm -rf + mkdir -p).
> No, it is really just a matter of time -- I'm going to switch to a new
> project (at work) and won't have much time for a few months.
When you run out of time, you can do this somewhere near the top,
like gdb.cp/exception.exp does:
# This test script is not finished yet.
continue
So we can get it into CVS, although not hooked up yet.
Michael
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-19 9:55 ` Michael Chastain
@ 2004-08-19 10:10 ` Baurjan Ismagulov
2004-08-19 10:20 ` Michael Chastain
2004-08-26 20:36 ` Baurjan Ismagulov
1 sibling, 1 reply; 32+ messages in thread
From: Baurjan Ismagulov @ 2004-08-19 10:10 UTC (permalink / raw)
To: gdb-patches
On Thu, Aug 19, 2004 at 05:56:00AM -0400, Michael Chastain wrote:
Sorry for off-topic, but do you sleep sometimes?
With kind regards,
Baurjan.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-19 10:10 ` Baurjan Ismagulov
@ 2004-08-19 10:20 ` Michael Chastain
0 siblings, 0 replies; 32+ messages in thread
From: Michael Chastain @ 2004-08-19 10:20 UTC (permalink / raw)
To: ibr, gdb-patches
> Sorry for off-topic, but do you sleep sometimes?
Yes. I live in New York City (EST5EDT), and these days
I go to sleep around 7:00 PM to 9:00 PM, and get up
between 3:00 AM and 4:00 AM.
I think I should post less, especially in the evenings
when I'm tired. :-/
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-18 23:33 ` Michael Chastain
` (2 preceding siblings ...)
2004-08-19 9:34 ` Baurjan Ismagulov
@ 2004-08-26 20:32 ` Baurjan Ismagulov
2004-08-27 14:16 ` Michael Chastain
3 siblings, 1 reply; 32+ messages in thread
From: Baurjan Ismagulov @ 2004-08-26 20:32 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 335 bytes --]
Hello Michael,
On Wed, Aug 18, 2004 at 07:33:29PM -0400, Michael Chastain wrote:
> (BTW,
> when I ran the last version you sent me, I got 39 ERROR results and zero
> PASS, so it needs some more work).
I was able to reproduce the problem. Could you please test the attached
file, it should work properly?
With kind regards,
Baurjan.
[-- Attachment #2: openp.exp --]
[-- Type: text/plain, Size: 14454 bytes --]
# Copyright (C) 2004 Free Software Foundation, 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# This file was written by Baurjan Ismagulov <ibr@ata.cs.hun.edu.tr>.
# $Id: openp.exp,v 1.4 2004/08/18 12:45:58 ibr Exp $
# This file tests whether gdb finds the files properly given the
# following file names:
# 1. basename: file
# 2. absolute: /dir/file
# 3. relative: dir/file
# 4. in current: ./file
# 5. in upper: ../file
# Called in case of error.
proc handle_error {msg} {
perror $msg
}
# Resolve possibe /./ and /../ within the given path. We are paranoid
# about cases like "mkdir -p a/../b" (although GNU coreutils and Solaris
# 8 seem to handle this particular case).
# XXX: Can this be replaced with tcl path manipulation routines?
proc canonize_path {dir} {
set old_dir [pwd]
cd $dir
set new_dir [pwd]
cd $old_dir
return $new_dir
}
# Compile $src to $bin in $cdir.
# XXX: build == host.
proc cdir_compile {cdir src bin} {
if [catch {set old_dir [pwd]} msg] {
handle_error $msg
}
if [catch {cd $cdir} msg] {
handle_error $msg
}
if {[gdb_compile $src $bin executable debug] != ""} {
gdb_suppress_entire_file "Testcase compile failed."
}
if [catch {cd $old_dir} msg] {
handle_error $msg
}
}
# Move the binary to $bin_dir, add $path_dir to PATH, gdb_test in the
# $gdb_wd directory.
# XXX: build == host.
proc test_bin {gdb_wd bin_dir path_dir gdb_test_cmd gdb_resp txt} {
global binname
global binfile
global env
if {$bin_dir != ""} {
remote_exec host "mv $binfile $bin_dir"
}
if {$path_dir != "" && [info exists env(PATH)]} {
if [catch {set old_path $env(PATH)} msg] {
handle_error $msg
}
# XXX: Directory separator in PATH?
if [catch {set env(PATH) $env(PATH):$path_dir} msg] {
handle_error $msg
}
}
if [catch {set old_dir [pwd]} msg] {
handle_error $msg
}
if [catch {cd $gdb_wd} msg] {
handle_error $msg
}
gdb_start
gdb_test $gdb_test_cmd $gdb_resp $txt
gdb_exit
if [catch {cd $old_dir} msg] {
handle_error $msg
}
if [info exists old_path] {
if [catch {set env(PATH) $old_path} msg] {
handle_error $msg
}
}
if {$bin_dir != ""} {
remote_exec host "mv $bin_dir/$binname $binfile"
}
}
# Compile in $comp_dir, move the source to $srcfile_dir, perform $cmd1
# and $cmd2, gdb_test in gdb_wd.
# XXX: build == host.
proc test_src {comp_dir comp_srcfile comp_binfile srcfile_dir
gdb_wd cmd1 cmd2 gdb_test_cmd gdb_resp txt} {
global srcname;
global srcfile;
if [catch {set old_dir [pwd]} msg] {
handle_error $msg
}
cdir_compile $comp_dir $comp_srcfile $comp_binfile
if {$srcfile_dir != ""} {
remote_exec host "mv $srcfile $srcfile_dir"
}
if [catch {cd $gdb_wd} msg] {
handle_error $msg
}
gdb_start
if {$cmd1 != ""} {
gdb_test $cmd1 ""
}
if {$cmd2 != ""} {
gdb_test $cmd2 ""
}
gdb_test $gdb_test_cmd $gdb_resp $txt
gdb_exit
if [catch {cd $old_dir} msg] {
handle_error $msg
}
if {$srcfile_dir != ""} {
remote_exec host "mv $srcfile_dir/$srcname $srcfile"
}
}
if $tracelevel then {
strace $tracelevel
}
set prms_id 0
set bug_id 0
set testname "openp"
set srcname $testname.c
set binname $testname.bin
set testtmpdir [canonize_path $objdir/$subdir]/$testname
set srcfile $testtmpdir/subdir/src/$srcname
set binfile $testtmpdir/subdir/bin/$binname
set src_txt {1.int main\(\){return 0;}.*}
remote_exec host "mkdir -p $testtmpdir/subdir/src/subdir"
remote_exec host "mkdir -p $testtmpdir/subdir/bin/subdir"
remote_exec host "mkdir -p $testtmpdir/subdir/cwd/bin"
remote_exec host "mkdir -p $testtmpdir/subdir/cwd/src"
remote_exec host "mkdir -p $testtmpdir/subdir/dir$testtmpdir/subdir/src/subdir"
remote_exec host "mkdir -p $testtmpdir/subdir/dir$testtmpdir/subdir/bin"
remote_exec host "mkdir -p $testtmpdir/subdir/dir/src"
remote_exec host "mv $srcdir/$subdir/$testname.c $srcfile"
cdir_compile $testtmpdir $srcfile $binfile
# b1+
test_bin $testtmpdir/subdir/bin \
"" \
"" \
"file $binname" \
"Reading symbols from $binfile\\.\\.\\.done\\..*" \
"openp b1+ (existing binary, basename)"
# b1-
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir/bin \
"file $binname" \
"Reading symbols from $binfile\\.\\.\\..*done\\..*" \
"openp b1- (non-existent binary, basename, find in PATH)"
# b2+
test_bin $testtmpdir/subdir/cwd \
"" \
"" \
"file $binfile" \
"Reading symbols from $binfile\\.\\.\\.done\\..*" \
"openp b2+ (existing binary, absolute name)"
# b2-a
# XXX: Should we match locale-specific messages?
test_bin $testtmpdir/subdir/cwd \
$testtmpdir/subdir/dir$testtmpdir/subdir/bin \
$testtmpdir/subdir/dir \
"file $binfile" \
"$binfile: .*" \
"openp b2-a (non-existent binary, absolute name, don't look in <PATH_dir>/absolute)"
# b2-
# XXX: Should we match locale-specific messages?
test_bin $testtmpdir/subdir/cwd \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/dir \
"file $binfile" \
"$binfile: .*" \
"openp b2- (non-existent binary, absolute name, don't look for <PATH_dir>/basename)"
# b3+
test_bin $testtmpdir/subdir \
"" \
"" \
"file bin/$binname" \
"Reading symbols from $binfile\\.\\.\\.done\\..*" \
"openp b3+ (existing binary, relative name)"
# b3-r
# XXX: locale
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir \
"file bin/$binname" \
"bin/$binname: .*" \
"openp b3-r (non-existent binary, relative name, don't look in <PATH_dir>/relative)"
# b3-
# XXX: locale
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir/bin \
"file bin/$binname" \
"bin/$binname: .*" \
"openp b3- (non-existent binary, relative name, don't look in <PATH_dir>/basename)"
# b4+
test_bin $testtmpdir/subdir/bin \
"" \
"" \
"file ./$binname" \
"Reading symbols from $binfile\\.\\.\\.done\\..*" \
"openp b4+ (existing binary, in the current dir)"
# b4-
# XXX: locale
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir/bin \
"file ./$binname" \
"\\./$binname: .*" \
"openp b4- (non-existent binary, in the current dir, don't look in PATH)"
# b5+
test_bin $testtmpdir/subdir/bin/subdir \
"" \
"" \
"file ../$binname" \
"Reading symbols from $binfile\\.\\.\\.done\\..*" \
"openp b5+ (existing binary, in the upper dir)"
# b5-r
# XXX: locale
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir/bin/subdir \
"file ../$binname" \
"\\.\\./$binname: .*" \
"openp b5-r (non-existent binary, in the upper dir name, don't look in <PATH_dir>/relative)"
# b5-
# XXX: locale
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir/bin \
"file ../$binname" \
"\\.\\./$binname: .*" \
"openp b5- (non-existent binary, in the upper dir name, don't look in <PATH_dir>/basename)"
# s1+
test_src $testtmpdir/subdir/src $srcname $binfile \
"" \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s1+ (existing source, basename)"
# s1-.
test_src $testtmpdir/subdir/src $srcname $binfile \
$testtmpdir/subdir/cwd \
$testtmpdir/subdir/cwd \
"file $binfile" ""\
"l main" \
$src_txt \
"openp s1-. (non-existent source, basename, find in \$cwd/basename)"
# s1-da
test_src $testtmpdir/subdir/src $srcname $binfile \
$testtmpdir/subdir/dir$testtmpdir/subdir/src \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s1-da (non-existent source, basename, find in <dir>/\$cdir/basename)"
# s1-d
test_src $testtmpdir/subdir/src $srcname $binfile \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s1-d (non-existent source, basename, find in <dir>/basename)"
# s2+
test_src $testtmpdir $srcfile $binfile \
"" \
$testtmpdir/subdir/cwd \
"file $binfile" ""\
"l main" \
$src_txt \
"openp s2+ (existing source, absolute name)"
# s2-.
test_src $testtmpdir $srcfile $binfile \
$testtmpdir/subdir/cwd \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s2-. (non-existent source, absolute name, find in \$cwd/basename)"
# s2-da
test_src $testtmpdir $srcfile $binfile \
$testtmpdir/subdir/dir$testtmpdir/subdir/src \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s2-da (non-existent source, absolute name, find in <dir>/absolute)"
# s2-d
test_src $testtmpdir $srcfile $binfile \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s2-d (non-existent source, absolute name, find in <dir>/basename)"
# s3+
test_src $testtmpdir/subdir src/$srcname $binfile \
"" \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s3+ (existing source, relative name)"
# s3-.r
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir/cwd/src \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s3-.r (non-existent source, relative name, find in \$cwd/relative)"
# s3-c
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s3-c (non-existent source, relative name, find in \$cdir/basename)"
# s3-.
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir/cwd \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s3-. (non-existent source, relative name, find in \$cwd/basename)"
# s3-da
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir/dir$testtmpdir/subdir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s3-da (non-existent source, relative name, find in <dir>/\$cdir/relative)"
# s3-dr
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir/dir/src \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s3-dr (non-existent source, relative name, find in <dir>/relative)"
# s3-d
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s3-d (non-existent source, relative name, find in <dir>/basename)"
# s4+
test_src $testtmpdir/subdir/src ./$srcname $binfile \
"" \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s4+ (existing source, in the current dir)"
# s4-.
test_src $testtmpdir/subdir/src ./$srcname $binfile \
$testtmpdir/subdir/cwd \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s4-. (non-existent source, in the current dir, find in \$cwd/basename)"
# s4-da
test_src $testtmpdir/subdir/src ./$srcname $binfile \
$testtmpdir/subdir/dir$testtmpdir/subdir/src \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s4-da (non-existent source, in the current dir, find in <dir>/\$cdir/basename)"
# s4-d
test_src $testtmpdir/subdir/src ./$srcname $binfile \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s4-d (non-existent source, in the current dir, find in <dir>/basename)"
# s5+
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
"" \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s5+ (existing source, in the upper dir)"
# s5-.r
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s5-.r (non-existent source, in the upper dir, find in \$cwd/relative)"
# s5-c
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir/src/subdir \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s5-c (non-existent source, in the upper dir, find in \$cdir/basename)"
# s5-.
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir/cwd \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s5-. (non-existent source, in the upper dir, find in \$cdir/basename)"
# s5-da
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir/dir$testtmpdir/subdir/src/subdir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s5-da (non-existent source, in the upper dir, find in <dir>/\$cdir/relative)"
# s5-dr
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s5-dr (non-existent source, in the upper dir, find in <dir>/relative)"
# s5-d
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s5-d (non-existent source, in the upper dir, find in <dir>/basename)"
remote_exec host "mv $srcfile $objdir/$subdir"
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-19 9:55 ` Michael Chastain
2004-08-19 10:10 ` Baurjan Ismagulov
@ 2004-08-26 20:36 ` Baurjan Ismagulov
2004-08-26 20:52 ` Michael Chastain
1 sibling, 1 reply; 32+ messages in thread
From: Baurjan Ismagulov @ 2004-08-26 20:36 UTC (permalink / raw)
To: gdb-patches
Hello Michael,
On Thu, Aug 19, 2004 at 05:56:00AM -0400, Michael Chastain wrote:
> gdb HEAD 2004-08-17
I've tried gdb HEAD, it fails on make check:
Making check in libdejagnu
make[5]: Entering directory `/mnt/hda5/ibr/f/gdb/src0/dejagnu/testsuite/libdejagnu'
c++ -DPACKAGE=\"dejagnu\" -DVERSION=\"1.4.2\" -I. -I../../../../src/dejagnu/testsuite/libdejagnu -g -O2 -c ../../../../src/dejagnu/testsuite/libdejagnu/unit.cc
/usr/include/c++/3.3/streambuf: In function `int main(int, char**)':
/usr/include/c++/3.3/streambuf:713: error: `std::basic_streambuf<_CharT,
_Traits>* std::basic_streambuf<_CharT, _Traits>::setbuf(_CharT*, int) [with
_CharT = char, _Traits = std::char_traits<char>]' is protected
../../../../src/dejagnu/testsuite/libdejagnu/unit.cc:56: error: within this
context
make[5]: *** [unit.o] Fehler 1
Any idea?
I'm using Debian sid, gcc 3.3.4.
With kind regards,
Baurjan.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-26 20:36 ` Baurjan Ismagulov
@ 2004-08-26 20:52 ` Michael Chastain
0 siblings, 0 replies; 32+ messages in thread
From: Michael Chastain @ 2004-08-26 20:52 UTC (permalink / raw)
To: ibr, gdb-patches
It looks like you are using the "gdb+dejagnu" package
and then running "make check" at the top level,
which checks everything.
Go into the gdb/testsuite directory in your build tree and do
"make check" there. That tests only gdb.
I don't want to get into the crumbling C++ code in dejagnu's
own test suite.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-26 20:32 ` Baurjan Ismagulov
@ 2004-08-27 14:16 ` Michael Chastain
2004-08-27 16:45 ` Baurjan Ismagulov
0 siblings, 1 reply; 32+ messages in thread
From: Michael Chastain @ 2004-08-27 14:16 UTC (permalink / raw)
To: ibr, gdb-patches
The first time I run openp.exp, I get 4 non-PASS results:
FAIL: gdb.base/openp.exp: openp s1-da (non-existent source, basename, find in <dir>/$cdir/basename)
FAIL: gdb.base/openp.exp: openp s3-da (non-existent source, relative name, find in <dir>/$cdir/relative)
FAIL: gdb.base/openp.exp: openp s4-da (non-existent source, in the current dir, find in <dir>/$cdir/basename)
FAIL: gdb.base/openp.exp: openp s5-da (non-existent source, in the upper dir, find in <dir>/$cdir/relative)
The second time I run openp.exp, it crashes and burns:
Running /berman/fsf/_current_/source/gdb/HEAD/src/gdb/testsuite/gdb.base/openp.exp ...
gdb compile failed, gcc: /tmp/migbat-testgdb-BqdGwxc7/test/gdb.base/openp/subdir/src/openp.c: No such file or directory
WARNING: Testcase compile failed.
ERROR: (timeout) GDB never initialized after 10 seconds.
UNRESOLVED: gdb.base/openp.exp: openp b1+ (existing binary, basename)
...
I suspect this line is at fault:
remote_exec host "mv $srcdir/$subdir/$testname.c $srcfile"
$srcdir is read-only.
More feedback:
. add a ChangeLog entry
. add some code at the top to check for build != host
if { [is_remote host] } {
unresolved "This test script does not work on a remote host."
return -1
}
. since the script does not work with build != host, you can simplify
all the "remote_exec host" calls to TCL primitives that run on the
build machine anyways. Like: "file mkdir ...". Your choice.
If you like "remote_exec host", you can keep it.
. error checking on every external call. Sometimes directory creation
does fail.
That's all the time I have for this round. I still haven't really
gotten into the substantive part of the script yet. :(
Michael
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-27 14:16 ` Michael Chastain
@ 2004-08-27 16:45 ` Baurjan Ismagulov
2004-08-29 11:56 ` Michael Chastain
2004-08-31 15:01 ` Michael Chastain
0 siblings, 2 replies; 32+ messages in thread
From: Baurjan Ismagulov @ 2004-08-27 16:45 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1144 bytes --]
Hello, Michael!
On Fri, Aug 27, 2004 at 10:16:21AM -0400, Michael Chastain wrote:
> The first time I run openp.exp, I get 4 non-PASS results:
This is what I've asked in
http://sources.redhat.com/ml/gdb-patches/2004-08/msg00539.html .
> The second time I run openp.exp, it crashes and burns:
The attached version should fix that.
> . add a ChangeLog entry
* gdb.base/openp.c:
gdb.base/openp.exp: New test checking where gdb looks for binary
and source files.
> . add some code at the top to check for build != host
Done.
> . since the script does not work with build != host, you can simplify
> all the "remote_exec host" calls to TCL primitives that run on the
> build machine anyways. Like: "file mkdir ...". Your choice.
> If you like "remote_exec host", you can keep it.
I like it, since it works now and marks clearly the commands for the
host. It can wait in the wings.
> . error checking on every external call. Sometimes directory creation
> does fail.
How does one do that? I've tried the following:
if [catch {remote_exec host "mkdir ...
It didn't fail when mkdir failed.
With kind regards,
Baurjan.
[-- Attachment #2: openp.exp --]
[-- Type: text/plain, Size: 14544 bytes --]
# Copyright (C) 2004 Free Software Foundation, 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# This file was written by Baurjan Ismagulov <ibr@ata.cs.hun.edu.tr>.
# $Id: openp.exp,v 1.5 2004/08/27 16:27:14 ibr Exp $
# This file tests whether gdb finds the files properly given the
# following file names:
# 1. basename: file
# 2. absolute: /dir/file
# 3. relative: dir/file
# 4. in current: ./file
# 5. in upper: ../file
# Called in case of error.
proc handle_error {msg} {
perror $msg
}
# Resolve possibe /./ and /../ within the given path. We are paranoid
# about cases like "mkdir -p a/../b" (although GNU coreutils and Solaris
# 8 seem to handle this particular case).
# XXX: Can this be replaced with tcl path manipulation routines?
proc canonize_path {dir} {
set old_dir [pwd]
cd $dir
set new_dir [pwd]
cd $old_dir
return $new_dir
}
# Compile $src to $bin in $cdir.
# XXX: build == host.
proc cdir_compile {cdir src bin} {
if [catch {set old_dir [pwd]} msg] {
handle_error $msg
}
if [catch {cd $cdir} msg] {
handle_error $msg
}
if {[gdb_compile $src $bin executable debug] != ""} {
gdb_suppress_entire_file "Testcase compile failed."
}
if [catch {cd $old_dir} msg] {
handle_error $msg
}
}
# Move the binary to $bin_dir, add $path_dir to PATH, gdb_test in the
# $gdb_wd directory.
# XXX: build == host.
proc test_bin {gdb_wd bin_dir path_dir gdb_test_cmd gdb_resp txt} {
global binname
global binfile
global env
if {$bin_dir != ""} {
remote_exec host "mv $binfile $bin_dir"
}
if {$path_dir != "" && [info exists env(PATH)]} {
if [catch {set old_path $env(PATH)} msg] {
handle_error $msg
}
# XXX: Directory separator in PATH?
if [catch {set env(PATH) $env(PATH):$path_dir} msg] {
handle_error $msg
}
}
if [catch {set old_dir [pwd]} msg] {
handle_error $msg
}
if [catch {cd $gdb_wd} msg] {
handle_error $msg
}
gdb_start
gdb_test $gdb_test_cmd $gdb_resp $txt
gdb_exit
if [catch {cd $old_dir} msg] {
handle_error $msg
}
if [info exists old_path] {
if [catch {set env(PATH) $old_path} msg] {
handle_error $msg
}
}
if {$bin_dir != ""} {
remote_exec host "mv $bin_dir/$binname $binfile"
}
}
# Compile in $comp_dir, move the source to $srcfile_dir, perform $cmd1
# and $cmd2, gdb_test in gdb_wd.
# XXX: build == host.
proc test_src {comp_dir comp_srcfile comp_binfile srcfile_dir
gdb_wd cmd1 cmd2 gdb_test_cmd gdb_resp txt} {
global srcname;
global srcfile;
if [catch {set old_dir [pwd]} msg] {
handle_error $msg
}
cdir_compile $comp_dir $comp_srcfile $comp_binfile
if {$srcfile_dir != ""} {
remote_exec host "mv $srcfile $srcfile_dir"
}
if [catch {cd $gdb_wd} msg] {
handle_error $msg
}
gdb_start
if {$cmd1 != ""} {
gdb_test $cmd1 ""
}
if {$cmd2 != ""} {
gdb_test $cmd2 ""
}
gdb_test $gdb_test_cmd $gdb_resp $txt
gdb_exit
if [catch {cd $old_dir} msg] {
handle_error $msg
}
if {$srcfile_dir != ""} {
remote_exec host "mv $srcfile_dir/$srcname $srcfile"
}
}
if {[is_remote host]} {
unresolved "This test script does not work on a remote host."
return -1
}
if $tracelevel then {
strace $tracelevel
}
set prms_id 0
set bug_id 0
set testname "openp"
set srcname $testname.c
set binname $testname.bin
set testtmpdir [canonize_path $objdir/$subdir]/$testname
set srcfile $testtmpdir/subdir/src/$srcname
set binfile $testtmpdir/subdir/bin/$binname
set src_txt {1.int main\(\){return 0;}.*}
remote_exec host "mkdir -p $testtmpdir/subdir/src/subdir"
remote_exec host "mkdir -p $testtmpdir/subdir/bin/subdir"
remote_exec host "mkdir -p $testtmpdir/subdir/cwd/bin"
remote_exec host "mkdir -p $testtmpdir/subdir/cwd/src"
remote_exec host "mkdir -p $testtmpdir/subdir/dir$testtmpdir/subdir/src/subdir"
remote_exec host "mkdir -p $testtmpdir/subdir/dir$testtmpdir/subdir/bin"
remote_exec host "mkdir -p $testtmpdir/subdir/dir/src"
remote_exec host "cp $srcdir/$subdir/$testname.c $srcfile"
cdir_compile $testtmpdir $srcfile $binfile
# b1+
test_bin $testtmpdir/subdir/bin \
"" \
"" \
"file $binname" \
"Reading symbols from $binfile\\.\\.\\.done\\..*" \
"openp b1+ (existing binary, basename)"
# b1-
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir/bin \
"file $binname" \
"Reading symbols from $binfile\\.\\.\\..*done\\..*" \
"openp b1- (non-existent binary, basename, find in PATH)"
# b2+
test_bin $testtmpdir/subdir/cwd \
"" \
"" \
"file $binfile" \
"Reading symbols from $binfile\\.\\.\\.done\\..*" \
"openp b2+ (existing binary, absolute name)"
# b2-a
# XXX: Should we match locale-specific messages?
test_bin $testtmpdir/subdir/cwd \
$testtmpdir/subdir/dir$testtmpdir/subdir/bin \
$testtmpdir/subdir/dir \
"file $binfile" \
"$binfile: .*" \
"openp b2-a (non-existent binary, absolute name, don't look in <PATH_dir>/absolute)"
# b2-
# XXX: Should we match locale-specific messages?
test_bin $testtmpdir/subdir/cwd \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/dir \
"file $binfile" \
"$binfile: .*" \
"openp b2- (non-existent binary, absolute name, don't look for <PATH_dir>/basename)"
# b3+
test_bin $testtmpdir/subdir \
"" \
"" \
"file bin/$binname" \
"Reading symbols from $binfile\\.\\.\\.done\\..*" \
"openp b3+ (existing binary, relative name)"
# b3-r
# XXX: locale
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir \
"file bin/$binname" \
"bin/$binname: .*" \
"openp b3-r (non-existent binary, relative name, don't look in <PATH_dir>/relative)"
# b3-
# XXX: locale
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir/bin \
"file bin/$binname" \
"bin/$binname: .*" \
"openp b3- (non-existent binary, relative name, don't look in <PATH_dir>/basename)"
# b4+
test_bin $testtmpdir/subdir/bin \
"" \
"" \
"file ./$binname" \
"Reading symbols from $binfile\\.\\.\\.done\\..*" \
"openp b4+ (existing binary, in the current dir)"
# b4-
# XXX: locale
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir/bin \
"file ./$binname" \
"\\./$binname: .*" \
"openp b4- (non-existent binary, in the current dir, don't look in PATH)"
# b5+
test_bin $testtmpdir/subdir/bin/subdir \
"" \
"" \
"file ../$binname" \
"Reading symbols from $binfile\\.\\.\\.done\\..*" \
"openp b5+ (existing binary, in the upper dir)"
# b5-r
# XXX: locale
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir/bin/subdir \
"file ../$binname" \
"\\.\\./$binname: .*" \
"openp b5-r (non-existent binary, in the upper dir name, don't look in <PATH_dir>/relative)"
# b5-
# XXX: locale
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir/bin \
"file ../$binname" \
"\\.\\./$binname: .*" \
"openp b5- (non-existent binary, in the upper dir name, don't look in <PATH_dir>/basename)"
# s1+
test_src $testtmpdir/subdir/src $srcname $binfile \
"" \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s1+ (existing source, basename)"
# s1-.
test_src $testtmpdir/subdir/src $srcname $binfile \
$testtmpdir/subdir/cwd \
$testtmpdir/subdir/cwd \
"file $binfile" ""\
"l main" \
$src_txt \
"openp s1-. (non-existent source, basename, find in \$cwd/basename)"
# s1-da
test_src $testtmpdir/subdir/src $srcname $binfile \
$testtmpdir/subdir/dir$testtmpdir/subdir/src \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s1-da (non-existent source, basename, find in <dir>/\$cdir/basename)"
# s1-d
test_src $testtmpdir/subdir/src $srcname $binfile \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s1-d (non-existent source, basename, find in <dir>/basename)"
# s2+
test_src $testtmpdir $srcfile $binfile \
"" \
$testtmpdir/subdir/cwd \
"file $binfile" ""\
"l main" \
$src_txt \
"openp s2+ (existing source, absolute name)"
# s2-.
test_src $testtmpdir $srcfile $binfile \
$testtmpdir/subdir/cwd \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s2-. (non-existent source, absolute name, find in \$cwd/basename)"
# s2-da
test_src $testtmpdir $srcfile $binfile \
$testtmpdir/subdir/dir$testtmpdir/subdir/src \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s2-da (non-existent source, absolute name, find in <dir>/absolute)"
# s2-d
test_src $testtmpdir $srcfile $binfile \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s2-d (non-existent source, absolute name, find in <dir>/basename)"
# s3+
test_src $testtmpdir/subdir src/$srcname $binfile \
"" \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s3+ (existing source, relative name)"
# s3-.r
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir/cwd/src \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s3-.r (non-existent source, relative name, find in \$cwd/relative)"
# s3-c
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s3-c (non-existent source, relative name, find in \$cdir/basename)"
# s3-.
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir/cwd \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s3-. (non-existent source, relative name, find in \$cwd/basename)"
# s3-da
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir/dir$testtmpdir/subdir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s3-da (non-existent source, relative name, find in <dir>/\$cdir/relative)"
# s3-dr
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir/dir/src \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s3-dr (non-existent source, relative name, find in <dir>/relative)"
# s3-d
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s3-d (non-existent source, relative name, find in <dir>/basename)"
# s4+
test_src $testtmpdir/subdir/src ./$srcname $binfile \
"" \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s4+ (existing source, in the current dir)"
# s4-.
test_src $testtmpdir/subdir/src ./$srcname $binfile \
$testtmpdir/subdir/cwd \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s4-. (non-existent source, in the current dir, find in \$cwd/basename)"
# s4-da
test_src $testtmpdir/subdir/src ./$srcname $binfile \
$testtmpdir/subdir/dir$testtmpdir/subdir/src \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s4-da (non-existent source, in the current dir, find in <dir>/\$cdir/basename)"
# s4-d
test_src $testtmpdir/subdir/src ./$srcname $binfile \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s4-d (non-existent source, in the current dir, find in <dir>/basename)"
# s5+
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
"" \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s5+ (existing source, in the upper dir)"
# s5-.r
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s5-.r (non-existent source, in the upper dir, find in \$cwd/relative)"
# s5-c
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir/src/subdir \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s5-c (non-existent source, in the upper dir, find in \$cdir/basename)"
# s5-.
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir/cwd \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s5-. (non-existent source, in the upper dir, find in \$cdir/basename)"
# s5-da
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir/dir$testtmpdir/subdir/src/subdir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s5-da (non-existent source, in the upper dir, find in <dir>/\$cdir/relative)"
# s5-dr
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s5-dr (non-existent source, in the upper dir, find in <dir>/relative)"
# s5-d
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s5-d (non-existent source, in the upper dir, find in <dir>/basename)"
remote_exec host "rm $srcfile"
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-27 16:45 ` Baurjan Ismagulov
@ 2004-08-29 11:56 ` Michael Chastain
2004-08-31 15:01 ` Michael Chastain
1 sibling, 0 replies; 32+ messages in thread
From: Michael Chastain @ 2004-08-29 11:56 UTC (permalink / raw)
To: ibr, gdb-patches
Hi Baurjan,
mec> . since the script does not work with build != host, you can simplify
mec> all the "remote_exec host" calls to TCL primitives that run on the
mec> build machine anyways. Like: "file mkdir ...". Your choice.
mec> If you like "remote_exec host", you can keep it.
bi> I like it, since it works now and marks clearly the commands for the
bi> host. It can wait in the wings.
If you like it that way, okay.
bi> How does one do that? I've tried the following:
remote_exec doesn't throw an error; it returns a list:
# A two-element list is returned. The first value is the exit status of the
# program (-1 if the exec failed). The second is any output produced by
# the program (which may or may not be empty if output from the program was
# redirected).
Go into the dejagnu installation directory and look for
share/dejagnu/remote.exp.
More feedback later (tonight or tomorrow) -- this is all I have time
for today.
Michael
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-27 16:45 ` Baurjan Ismagulov
2004-08-29 11:56 ` Michael Chastain
@ 2004-08-31 15:01 ` Michael Chastain
2004-09-25 21:12 ` Baurjan Ismagulov
1 sibling, 1 reply; 32+ messages in thread
From: Michael Chastain @ 2004-08-31 15:01 UTC (permalink / raw)
To: ibr, gdb-patches
Good morning Barjaun,
More feedback. This is all still shallow stuff. In another 1-2 rounds,
all the shallow stuff will be fixed, and also enough of the code will
have permeated my brain that I can actually talk about the real
contents.
. The script works for me now when I run it several times in a row
with different gdb's, gcc's, and debug formats.
. Include openp.c as a second attachment to your mail.
. ChangeLog entry
. if [is_remote host] {
unresolved "This test script does not work on a remote host."
return -1
}
. error checking on calls to remote_exec
. gdb_suppress_entire_file is rotten and obsolete.
if gdb_compile fails, just do:
if {[gdb_compile ...] != ""} {
perror "Testcase compile failed" 0
return -1
}
and then check the return value from cdir_compile
. the convention for gdb_start and gdb_exit is to assume that the
previous test script left a gdb running and to call gdb_exit
first, followed by gdb_start.
. in test_bin, don't move the file back and forth -- just copy
the file and then leave the copy in place. disk space is cheap,
and "mv $binfile $bin_dir ... $mv $bin_dir/$binname $binfile"
is vulnerable to cascade failures when you call test_bin 13
times in a row and one of them might de-synchronize.
same with test_src.
Or am i missing something and it will screw up some tests if
you let the prime copies of $srcfile and $binfile exist
all the time?
. in test_src, drop the semicolons here:
global srcname;
global srcfile;
. don't bother to do "remote_exec host rm $srcfile"
In general, for file handling, just create and copy things and don't
delete or move them. That makes it easier to debug your script or debug
gdb when something doesn't work. Just be prepared that an old copy of
something might exist, so plain "mkdir" does not work, but "mkdir -p"
is good.
^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: testcase for "absolute source" patch
2004-08-31 15:01 ` Michael Chastain
@ 2004-09-25 21:12 ` Baurjan Ismagulov
0 siblings, 0 replies; 32+ messages in thread
From: Baurjan Ismagulov @ 2004-09-25 21:12 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 2451 bytes --]
Hello Michael,
here is the new version.
On Tue, Aug 31, 2004 at 11:02:02AM -0400, Michael Chastain wrote:
> . ChangeLog entry
* gdb.base/openp.c: New testcase.
* gdb.base/openp.exp: New testcase checking for source, binary
and compilation directory handling.
> . error checking on calls to remote_exec
> . gdb_suppress_entire_file is rotten and obsolete.
> . the convention for gdb_start and gdb_exit is to assume that the
> previous test script left a gdb running and to call gdb_exit
> first, followed by gdb_start.
> . in test_src, drop the semicolons here:
> . don't bother to do "remote_exec host rm $srcfile"
Done.
> . in test_bin, don't move the file back and forth -- just copy
> the file and then leave the copy in place. disk space is cheap,
> and "mv $binfile $bin_dir ... $mv $bin_dir/$binname $binfile"
> is vulnerable to cascade failures when you call test_bin 13
> times in a row and one of them might de-synchronize.
> same with test_src.
>
> Or am i missing something and it will screw up some tests if
> you let the prime copies of $srcfile and $binfile exist
> all the time?
All tests verify whether gdb finds (doesn't find) the files as expected.
To achieve that, we place them in some specific locations, such as
compilation directory, $PATH, gdb source path ("directory" command),
etc. The files from previous tests could cause false failures for the
tests where gdb is supposed not to find the file (all tests with '-'),
or false passes for the tests where gdb could find the wrong file (e.g.,
in the compilation directory rather than in the source path).
Actually, I hadn't moved the files around as I first started writing the
test; I just had been removing the files before a test if it was
necessary. However, the tests were depending on the state left from the
previous one, thus making the process of modifying and adding new tests
very difficult: to add the 14th test, you have to trace the first 13
ones. That is why I decided to delete all files after each test, thus
making the tests independent of each other. It might seem difficult to
debug at the first glance, but it is easily trackable from the log once
you know that each test expects to find the directory hierarchy in some
"standard" state (created til the line 206, just before the first
test_bin) and has to leave it in the same state. This greatly simplifies
both debugging and maintenance.
With kind regards,
Baurjan.
[-- Attachment #2: openp.exp --]
[-- Type: text/plain, Size: 15257 bytes --]
# Copyright (C) 2004 Free Software Foundation, 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# This file was written by Baurjan Ismagulov <ibr@ata.cs.hun.edu.tr>.
# $Id: openp.exp,v 1.7 2004/09/25 21:14:05 ibr Exp $
# This file tests whether gdb finds the files properly given the
# following file names:
# 1. basename: file
# 2. absolute: /dir/file
# 3. relative: dir/file
# 4. in current: ./file
# 5. in upper: ../file
# Resolve possibe /./ and /../ within the given path. We are paranoid
# about cases like "mkdir -p a/../b" (although GNU coreutils and Solaris
# 8 seem to handle this particular case).
# XXX: Can this be replaced with tcl path manipulation routines?
proc canonize_path {dir} {
set old_dir [pwd]
cd $dir
set new_dir [pwd]
cd $old_dir
return $new_dir
}
# Compile $src to $bin in $cdir.
# XXX: build == host.
proc cdir_compile {cdir src bin} {
if [catch {set old_dir [pwd]} msg] {
perror $msg
return -1
}
if [catch {cd $cdir} msg] {
perror $msg
return -1
}
if {[gdb_compile $src $bin executable debug] != ""} {
perror "Testcase compile failed."
return -1
}
if [catch {cd $old_dir} msg] {
perror $msg
return -1
}
return 0
}
# Move the binary to $bin_dir, add $path_dir to PATH, gdb_test in the
# $gdb_wd directory.
# XXX: build == host.
proc test_bin {gdb_wd bin_dir path_dir gdb_test_cmd gdb_resp txt} {
global binname
global binfile
global env
if {$bin_dir != ""} {
if {[lindex [remote_exec host "mv $binfile $bin_dir"] 0] != 0} {
unresolved "Failed to move $binfile to $bin_dir."
return -1
}
}
if {$path_dir != "" && [info exists env(PATH)]} {
if [catch {set old_path $env(PATH)} msg] {
perror $msg
return -1
}
# XXX: Directory separator in PATH?
if [catch {set env(PATH) $env(PATH):$path_dir} msg] {
perror $msg
return -1
}
}
if [catch {set old_dir [pwd]} msg] {
perror $msg
return -1
}
if [catch {cd $gdb_wd} msg] {
perror $msg
return -1
}
gdb_start
gdb_test $gdb_test_cmd $gdb_resp $txt
gdb_exit
if [catch {cd $old_dir} msg] {
perror $msg
return -1
}
if [info exists old_path] {
if [catch {set env(PATH) $old_path} msg] {
perror $msg
return -1
}
}
if {$bin_dir != ""} {
if {[lindex [remote_exec host "mv $bin_dir/$binname $binfile"] 0] != 0} {
unresolved "Failed to move $bin_dir/$binname to $binfile."
return -1
}
}
return 0
}
# Compile in $comp_dir, move the source to $srcfile_dir, perform $cmd1
# and $cmd2, gdb_test in gdb_wd.
# XXX: build == host.
proc test_src {comp_dir comp_srcfile comp_binfile srcfile_dir
gdb_wd cmd1 cmd2 gdb_test_cmd gdb_resp txt} {
global srcname
global srcfile
if [catch {set old_dir [pwd]} msg] {
perror $msg
return -1
}
if {[cdir_compile $comp_dir $comp_srcfile $comp_binfile] != 0} {
unresolved "Failed to compile $comp_srcfile to $comp_binfile in $comp_dir."
return -1
}
if {$srcfile_dir != ""} {
if {[lindex [remote_exec host "mv $srcfile $srcfile_dir"] 0] != 0} {
unresolved "Failed to move $srcfile to $srcfile_dir."
return -1
}
}
if [catch {cd $gdb_wd} msg] {
perror $msg
return -1
}
gdb_start
if {$cmd1 != ""} {
gdb_test $cmd1 ""
}
if {$cmd2 != ""} {
gdb_test $cmd2 ""
}
gdb_test $gdb_test_cmd $gdb_resp $txt
gdb_exit
if [catch {cd $old_dir} msg] {
perror $msg
return -1
}
if {$srcfile_dir != ""} {
if {[lindex [remote_exec host "mv $srcfile_dir/$srcname $srcfile"] 0] != 0} {
unresolved "Failed to move $srcfile_dir/$srcname to $srcfile."
return -1
}
}
return 0
}
if {[is_remote host]} {
unresolved "This test script does not work on a remote host."
return -1
}
if $tracelevel then {
strace $tracelevel
}
set prms_id 0
set bug_id 0
set testname "openp"
set srcname $testname.c
set binname $testname.bin
set testtmpdir [canonize_path $objdir/$subdir]/$testname
set srcfile $testtmpdir/subdir/src/$srcname
set binfile $testtmpdir/subdir/bin/$binname
set src_txt {1.int main\(\){return 0;}.*}
if {[lindex [remote_exec host "mkdir -p \
$testtmpdir/subdir/src/subdir \
$testtmpdir/subdir/bin/subdir \
$testtmpdir/subdir/cwd/bin \
$testtmpdir/subdir/cwd/src \
$testtmpdir/subdir/dir$testtmpdir/subdir/src/subdir \
$testtmpdir/subdir/dir$testtmpdir/subdir/bin \
$testtmpdir/subdir/dir/src"] 0] != 0} {
unresolved "Failed to create the directories under $testtmpdir/subdir."
return -1
}
if {[lindex [remote_exec host "cp $srcdir/$subdir/$testname.c $srcfile"] 0] != 0} {
unresolved "Failed to copy $srcdir/$subdir/$testname.c to $srcfile."
return -1
}
if {[cdir_compile $testtmpdir $srcfile $binfile] != 0} {
unresolved "Failed to compile $srcfile to $binfile in $testtmpdir."
return -1
}
gdb_exit
# b1+
test_bin $testtmpdir/subdir/bin \
"" \
"" \
"file $binname" \
"Reading symbols from $binfile\\.\\.\\.done\\..*" \
"openp b1+ (existing binary, basename)"
# b1-
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir/bin \
"file $binname" \
"Reading symbols from $binfile\\.\\.\\..*done\\..*" \
"openp b1- (non-existent binary, basename, find in PATH)"
# b2+
test_bin $testtmpdir/subdir/cwd \
"" \
"" \
"file $binfile" \
"Reading symbols from $binfile\\.\\.\\.done\\..*" \
"openp b2+ (existing binary, absolute name)"
# b2-a
# XXX: Should we match locale-specific messages?
test_bin $testtmpdir/subdir/cwd \
$testtmpdir/subdir/dir$testtmpdir/subdir/bin \
$testtmpdir/subdir/dir \
"file $binfile" \
"$binfile: .*" \
"openp b2-a (non-existent binary, absolute name, don't look in <PATH_dir>/absolute)"
# b2-
# XXX: Should we match locale-specific messages?
test_bin $testtmpdir/subdir/cwd \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/dir \
"file $binfile" \
"$binfile: .*" \
"openp b2- (non-existent binary, absolute name, don't look for <PATH_dir>/basename)"
# b3+
test_bin $testtmpdir/subdir \
"" \
"" \
"file bin/$binname" \
"Reading symbols from $binfile\\.\\.\\.done\\..*" \
"openp b3+ (existing binary, relative name)"
# b3-r
# XXX: locale
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir \
"file bin/$binname" \
"bin/$binname: .*" \
"openp b3-r (non-existent binary, relative name, don't look in <PATH_dir>/relative)"
# b3-
# XXX: locale
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir/bin \
"file bin/$binname" \
"bin/$binname: .*" \
"openp b3- (non-existent binary, relative name, don't look in <PATH_dir>/basename)"
# b4+
test_bin $testtmpdir/subdir/bin \
"" \
"" \
"file ./$binname" \
"Reading symbols from $binfile\\.\\.\\.done\\..*" \
"openp b4+ (existing binary, in the current dir)"
# b4-
# XXX: locale
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir/bin \
"file ./$binname" \
"\\./$binname: .*" \
"openp b4- (non-existent binary, in the current dir, don't look in PATH)"
# b5+
test_bin $testtmpdir/subdir/bin/subdir \
"" \
"" \
"file ../$binname" \
"Reading symbols from $binfile\\.\\.\\.done\\..*" \
"openp b5+ (existing binary, in the upper dir)"
# b5-r
# XXX: locale
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir/bin/subdir \
"file ../$binname" \
"\\.\\./$binname: .*" \
"openp b5-r (non-existent binary, in the upper dir name, don't look in <PATH_dir>/relative)"
# b5-
# XXX: locale
test_bin $testtmpdir/subdir/cwd \
"" \
$testtmpdir/subdir/bin \
"file ../$binname" \
"\\.\\./$binname: .*" \
"openp b5- (non-existent binary, in the upper dir name, don't look in <PATH_dir>/basename)"
# s1+
test_src $testtmpdir/subdir/src $srcname $binfile \
"" \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s1+ (existing source, basename)"
# s1-.
test_src $testtmpdir/subdir/src $srcname $binfile \
$testtmpdir/subdir/cwd \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s1-. (non-existent source, basename, find in \$cwd/basename)"
# s1-da
test_src $testtmpdir/subdir/src $srcname $binfile \
$testtmpdir/subdir/dir$testtmpdir/subdir/src \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s1-da (non-existent source, basename, find in <dir>/\$cdir/basename)"
# s1-d
test_src $testtmpdir/subdir/src $srcname $binfile \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s1-d (non-existent source, basename, find in <dir>/basename)"
# s2+
test_src $testtmpdir $srcfile $binfile \
"" \
$testtmpdir/subdir/cwd \
"file $binfile" ""\
"l main" \
$src_txt \
"openp s2+ (existing source, absolute name)"
# s2-.
test_src $testtmpdir $srcfile $binfile \
$testtmpdir/subdir/cwd \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s2-. (non-existent source, absolute name, find in \$cwd/basename)"
# s2-da
test_src $testtmpdir $srcfile $binfile \
$testtmpdir/subdir/dir$testtmpdir/subdir/src \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s2-da (non-existent source, absolute name, find in <dir>/absolute)"
# s2-d
test_src $testtmpdir $srcfile $binfile \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s2-d (non-existent source, absolute name, find in <dir>/basename)"
# s3+
test_src $testtmpdir/subdir src/$srcname $binfile \
"" \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s3+ (existing source, relative name)"
# s3-.r
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir/cwd/src \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s3-.r (non-existent source, relative name, find in \$cwd/relative)"
# s3-c
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s3-c (non-existent source, relative name, find in \$cdir/basename)"
# s3-.
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir/cwd \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s3-. (non-existent source, relative name, find in \$cwd/basename)"
# s3-da
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir/dir$testtmpdir/subdir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s3-da (non-existent source, relative name, find in <dir>/\$cdir/relative)"
# s3-dr
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir/dir/src \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s3-dr (non-existent source, relative name, find in <dir>/relative)"
# s3-d
test_src $testtmpdir/subdir src/$srcname $binfile \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s3-d (non-existent source, relative name, find in <dir>/basename)"
# s4+
test_src $testtmpdir/subdir/src ./$srcname $binfile \
"" \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s4+ (existing source, in the current dir)"
# s4-.
test_src $testtmpdir/subdir/src ./$srcname $binfile \
$testtmpdir/subdir/cwd \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s4-. (non-existent source, in the current dir, find in \$cwd/basename)"
# s4-da
test_src $testtmpdir/subdir/src ./$srcname $binfile \
$testtmpdir/subdir/dir$testtmpdir/subdir/src \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s4-da (non-existent source, in the current dir, find in <dir>/\$cdir/basename)"
# s4-d
test_src $testtmpdir/subdir/src ./$srcname $binfile \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s4-d (non-existent source, in the current dir, find in <dir>/basename)"
# s5+
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
"" \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s5+ (existing source, in the upper dir)"
# s5-.r
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s5-.r (non-existent source, in the upper dir, find in \$cwd/relative)"
# s5-c
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir/src/subdir \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s5-c (non-existent source, in the upper dir, find in \$cdir/basename)"
# s5-.
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir/cwd \
$testtmpdir/subdir/cwd \
"file $binfile" "" \
"l main" \
$src_txt \
"openp s5-. (non-existent source, in the upper dir, find in \$cdir/basename)"
# s5-da
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir/dir$testtmpdir/subdir/src/subdir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s5-da (non-existent source, in the upper dir, find in <dir>/\$cdir/relative)"
# s5-dr
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s5-dr (non-existent source, in the upper dir, find in <dir>/relative)"
# s5-d
test_src $testtmpdir/subdir/src/subdir ../$srcname $binfile \
$testtmpdir/subdir/dir \
$testtmpdir/subdir/cwd \
"dir $testtmpdir/subdir/dir" "file $binfile" \
"l main" \
$src_txt \
"openp s5-d (non-existent source, in the upper dir, find in <dir>/basename)"
[-- Attachment #3: openp.c --]
[-- Type: text/x-csrc, Size: 22 bytes --]
int main(){return 0;}
^ permalink raw reply [flat|nested] 32+ messages in thread
end of thread, other threads:[~2004-09-25 21:12 UTC | newest]
Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-16 14:41 testcase for "absolute source" patch Baurzhan Ismagulov
2004-08-16 15:56 ` Michael Chastain
2004-08-16 18:21 ` Baurjan Ismagulov
2004-08-16 19:15 ` Michael Chastain
2004-08-16 20:38 ` Andreas Schwab
2004-08-18 13:03 ` Baurzhan Ismagulov
2004-08-18 15:31 ` Michael Chastain
2004-08-18 15:50 ` Baurzhan Ismagulov
2004-08-18 17:10 ` Michael Chastain
2004-08-18 19:00 ` Michael Chastain
2004-08-18 22:03 ` Baurjan Ismagulov
2004-08-18 22:46 ` Michael Chastain
2004-08-18 23:33 ` Michael Chastain
2004-08-19 4:03 ` Eli Zaretskii
2004-08-19 8:34 ` Michael Chastain
2004-08-19 8:56 ` Michael Chastain
2004-08-19 9:37 ` Baurjan Ismagulov
2004-08-19 9:34 ` Baurjan Ismagulov
2004-08-19 9:55 ` Michael Chastain
2004-08-19 10:10 ` Baurjan Ismagulov
2004-08-19 10:20 ` Michael Chastain
2004-08-26 20:36 ` Baurjan Ismagulov
2004-08-26 20:52 ` Michael Chastain
2004-08-26 20:32 ` Baurjan Ismagulov
2004-08-27 14:16 ` Michael Chastain
2004-08-27 16:45 ` Baurjan Ismagulov
2004-08-29 11:56 ` Michael Chastain
2004-08-31 15:01 ` Michael Chastain
2004-09-25 21:12 ` Baurjan Ismagulov
2004-08-18 15:50 ` Daniel Jacobowitz
2004-08-18 15:56 ` Baurjan Ismagulov
2004-08-18 16:04 ` Andreas Schwab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox