From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id B05DD385843E; Fri, 14 Oct 2022 17:59:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B05DD385843E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665770380; bh=oMeNqTuI+f33xbjwpBBZQfZ5D3SXi4f7HHhxG6S3dAk=; h=From:To:Subject:Date:From; b=WwP1whG9jTDOAc9PZHbNa4Ajsi6VP6ZWbCGExlayaDaoQN1WE6R/65mtaZOen66yf h2UAncZAieaM33e1KUU64u0PwdpBmZ9zU7RL5iMlhpKhNMHXv3qlLeg+lXjdyvUp7l sh15Wrfkx8t9GxSuLkyyrKRyT5ZElmZP9TjIpG8o= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Fix gdb.server/unittest.exp with host board local-remote-host.exp X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: c4c8c27263d2dd25647314f4897bd01ad1a78847 X-Git-Newrev: 7c635f3e61e014d713f7fc884215576187fda038 Message-Id: <20221014175940.B05DD385843E@sourceware.org> Date: Fri, 14 Oct 2022 17:59:40 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D7c635f3e61e0= 14d713f7fc884215576187fda038 commit 7c635f3e61e014d713f7fc884215576187fda038 Author: Tom de Vries Date: Fri Oct 14 19:59:26 2022 +0200 [gdb/testsuite] Fix gdb.server/unittest.exp with host board local-remot= e-host.exp =20 With test-case gdb.server/unittest.exp and host board local-remote-host= .exp I run into: ... builtin_spawn build/gdbserver/gdbserver --selftest^M ERROR: : spawn id exp7 not open while executing "expect { -i exp7 -timeout 10 -i $server_spawn_id -re "Ran ($decimal) unit tests, 0 failed" { set num_ran $expect_out(1,string) gdb_assert "..." ("uplevel" body line 1) invoked from within "uplevel $body" NONE : spawn id exp7 not open UNRESOLVED: gdb.server/unittest.exp: unit tests ... =20 The problem is (as fixed for avr in commit df5b8876083 ("gdb/testsuite:= better handle failures in simavr board, reap simavr process")), that gdb_expec= t through remote_expect adds a "-i -timeout 10", which is the one = causing the error. =20 As in aforementioned commit, fix this by using expect instead. =20 Tested on x86_64-linux. Diff: --- gdb/testsuite/gdb.server/unittest.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.server/unittest.exp b/gdb/testsuite/gdb.serv= er/unittest.exp index 57157ef8d35..d083ef25487 100644 --- a/gdb/testsuite/gdb.server/unittest.exp +++ b/gdb/testsuite/gdb.server/unittest.exp @@ -31,7 +31,7 @@ set gdbserver_command "$gdbserver --selftest" set server_spawn_id [remote_spawn target $gdbserver_command] =20 set test "unit tests" -gdb_expect { +expect { -i $server_spawn_id -re "Ran ($decimal) unit tests, 0 failed" { set num_ran $expect_out(1,string)