From: Dave Brolley <brolley@redhat.com>
To: gdb-patches <gdb-patches@sources.redhat.com>
Subject: [patch][rfa] sim/testsuite/lib/sim-defs.exp - Allow multiline comments at the start of test cases
Date: Fri, 29 Aug 2003 20:03:00 -0000 [thread overview]
Message-ID: <3F4FB1C1.4090306@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 228 bytes --]
Hi,
This patch allows simulator test cases to have arbitrary multiline
comments at the beginning of the file, before the test case options. The
current implementation allows only one line.
Tested on frv. ok to commit?
Dave
[-- Attachment #2: sim-testsuite.patch.txt --]
[-- Type: text/plain, Size: 1696 bytes --]
Index: sim/testsuite/lib/sim-defs.exp
===================================================================
RCS file: /cvs/src/src/sim/testsuite/lib/sim-defs.exp,v
retrieving revision 1.3
diff -c -p -r1.3 sim-defs.exp
*** sim/testsuite/lib/sim-defs.exp 31 Jul 2001 04:59:59 -0000 1.3
--- sim/testsuite/lib/sim-defs.exp 29 Aug 2003 20:00:55 -0000
*************** proc slurp_options { file } {
*** 331,350 ****
# whitespace is ignored anywhere except within the options list;
# option names are alphabetic only
set pat "^#${ws}(\[a-zA-Z\]*)\\(?(\[^):\]*)\\)?$ws:${ws}(.*)$ws\$"
! # Allow comment as first line of file.
! set firstline 1
while { [gets $f line] != -1 } {
set line [string trim $line]
# Whitespace here is space-tab.
if [regexp $pat $line xxx opt_name opt_machs opt_val] {
# match!
lappend opt_array [list $opt_name $opt_machs $opt_val]
} else {
! if { ! $firstline } {
break
}
}
- set firstline 0
}
close $f
return $opt_array
--- 331,350 ----
# whitespace is ignored anywhere except within the options list;
# option names are alphabetic only
set pat "^#${ws}(\[a-zA-Z\]*)\\(?(\[^):\]*)\\)?$ws:${ws}(.*)$ws\$"
! # Allow arbitrary comments as first few lines line of file.
! set seen_opt 0
while { [gets $f line] != -1 } {
set line [string trim $line]
# Whitespace here is space-tab.
if [regexp $pat $line xxx opt_name opt_machs opt_val] {
# match!
lappend opt_array [list $opt_name $opt_machs $opt_val]
+ set seen_opt 1
} else {
! if { $seen_opt } {
break
}
}
}
close $f
return $opt_array
next reply other threads:[~2003-08-29 20:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-29 20:03 Dave Brolley [this message]
[not found] ` <mailpost.1062187467.27373@news-sj1-1>
2003-08-29 20:07 ` cgd
2003-08-29 20:24 ` Dave Brolley
2003-09-04 17:08 ` Dave Brolley
2003-09-09 22:50 ` Dave Brolley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3F4FB1C1.4090306@redhat.com \
--to=brolley@redhat.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox