From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Elizabeth Chastain To: msnyder@redhat.com Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] testsuite/gdb.base/arithmet.exp: re-write Date: Tue, 12 Jun 2001 09:42:00 -0000 Message-id: <200106121648.JAA10240@bosch.cygnus.com> X-SW-Source: 2001-06/msg00233.html Michael Snyder writes: > gdb_test "print x-y-z" "10" "test x-y-z == 10" > gdb_test "print x-y-z" "9" "test x-y-z == 9" The third parameter works well for this case. Here is an awkward case: gdb_test "set variable z=2" "" ... gdb_test "set variable z=3" "" ... gdb_test "set variable z=2" "" ... gdb_test "set variable z=3" "" ... I chose to make an operational change by re-organizing the assignments: gdb_test "set variable z=2" "" gdb_test "set variable w=3" "" ... # no more assignments # use either "z" or "w" as appropriate Alternatively, I could do some 3rd-argument clutter: gdb_test "set variable z=2" "" ".1. set variable z=2" ... gdb_test "set variable z=3" "" ".2. set variable z=3" ... gdb_test "set variable z=2" "" ".3. set variable z=2" ... gdb_test "set variable z=3" "" ".4. set variable z=3" ... There's really no general clean way to do this. And there's no tool in common use that tells people "whoops, you just wrote a duplicate test". Michael