Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Tristan Gingold <gingold@adacore.com>
Cc: Tom Tromey <tromey@redhat.com>,
		"gdb-patches@sourceware.org ml" <gdb-patches@sourceware.org>
Subject: Re: [RFA] Emit a warning for ineffective set VAR = EXP command
Date: Thu, 03 May 2012 13:12:00 -0000	[thread overview]
Message-ID: <CADPb22RmvAp-a-YMj0L124FY5qFq5qo2S_DCpJ6X5wP2uKC5Pg@mail.gmail.com> (raw)
In-Reply-To: <98CB5870-6AB6-40FA-B3A1-9AF8269B2909@adacore.com>

On Thu, May 3, 2012 at 2:59 AM, Tristan Gingold <gingold@adacore.com> wrote:
>
> On May 2, 2012, at 6:40 PM, Doug Evans wrote:
>
>> I think the convention now is to use prepare_for_testing to simplify a
>> lot of the setup in the .exp file.  Grep for other uses to see how
>> it's used.
>
> Ah thanks.  I didn't start from the best .exp file.
>
> Ok with this version ?
>
> testsuite/
> 2012-05-02  Tristan Gingold  <gingold@adacore.com>
>
>        * gdb.base/set-noassign.exp: New test.
>
>
> diff --git a/gdb/testsuite/gdb.base/set-noassign.exp b/gdb/testsuite/gdb.base/set-noassign.exp
> new file mode 100644
> index 0000000..c9971f5
> --- /dev/null
> +++ b/gdb/testsuite/gdb.base/set-noassign.exp
> @@ -0,0 +1,32 @@
> +# Copyright 2012 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 3 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, see <http://www.gnu.org/licenses/>.
> +
> +
> +if { [prepare_for_testing set-noassign.exp "set-noassign" start.c {debug nowarnings}] } {
> +    return -1
> +}
> +
> +if ![runto_main] then {
> +    fail "Can't run to main"
> +    return 0
> +}
> +
> +# Verify that set command without assignment emits a warning.
> +#
> +gdb_test "set language ada" ".*" "set language ada"
> +
> +gdb_test "set x=3" \
> +       "warning: Expression is not an assignment \\(and might have no effect\\)" \
> +       "warning for set without assignment"
>

Ok with one more change.

-gdb_test "set language ada" ".*" "set language ada"
+gdb_test_no_output "set language ada"

[I'm assuming the warning test has the desired affect.  I don't know ada. :-)]


  reply	other threads:[~2012-05-03 13:12 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-27 13:48 Tristan Gingold
2012-04-27 13:54 ` Pierre Muller
2012-04-27 16:09 ` Tom Tromey
2012-05-02 13:17   ` Tristan Gingold
2012-05-02 16:41     ` Doug Evans
2012-05-03 10:00       ` Tristan Gingold
2012-05-03 13:12         ` Doug Evans [this message]
2012-05-03 15:05           ` Joel Brobecker
2012-05-03 16:33             ` Doug Evans
2012-05-03 22:04               ` Joel Brobecker
2012-05-03 22:07                 ` Doug Evans
2012-05-04  7:59               ` Tristan Gingold
2012-05-03 15:02         ` Joel Brobecker
2012-05-03 15:04           ` Tristan Gingold
2012-05-04 19:02 ` Maciej W. Rozycki
2012-05-07 10:30   ` Tristan Gingold
2012-05-07 19:36     ` Tom Tromey
2012-05-07 19:40       ` Paul_Koning
2012-05-07 20:38         ` Tom Tromey
2012-05-07 19:38     ` Joel Brobecker
2012-05-09 12:29       ` Tristan Gingold
2012-05-09 13:54         ` Paul_Koning
2012-05-09 14:10           ` Tristan Gingold
2012-05-09 14:12           ` Maciej W. Rozycki
2012-05-09 14:58             ` Paul_Koning
2012-05-09 15:38               ` Maciej W. Rozycki
2012-05-09 15:55                 ` Paul_Koning
2012-05-09 14:17         ` Joel Brobecker
2012-05-10 14:11           ` Tristan Gingold
2012-05-08  6:06     ` Maciej W. Rozycki

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=CADPb22RmvAp-a-YMj0L124FY5qFq5qo2S_DCpJ6X5wP2uKC5Pg@mail.gmail.com \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=gingold@adacore.com \
    --cc=tromey@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