From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30753 invoked by alias); 18 Jan 2016 16:43:46 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 30707 invoked by uid 89); 18 Jan 2016 16:43:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=occured, that!, 940, UD:gdb.exp X-HELO: usplmg20.ericsson.net Received: from usplmg20.ericsson.net (HELO usplmg20.ericsson.net) (198.24.6.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 18 Jan 2016 16:43:44 +0000 Received: from EUSAAHC007.ericsson.se (Unknown_Domain [147.117.188.93]) by usplmg20.ericsson.net (Symantec Mail Security) with SMTP id 49.51.06940.BD31D965; Mon, 18 Jan 2016 17:33:31 +0100 (CET) Received: from [142.133.110.144] (147.117.188.8) by smtp-am.internal.ericsson.com (147.117.188.95) with Microsoft SMTP Server id 14.3.248.2; Mon, 18 Jan 2016 11:43:42 -0500 Subject: Re: How to abort a test? To: Joel Brobecker References: <56958359.8070708@ericsson.com> <5697CC09.8010306@redhat.com> <5697D721.1000305@ericsson.com> <5697DABA.8010008@redhat.com> <5697FA6C.7060703@ericsson.com> <5697FB9E.3080906@redhat.com> <56991FB0.5090109@ericsson.com> <20160117082709.GC4059@adacore.com> CC: Pedro Alves , , gdb-patches From: Simon Marchi Message-ID: <569D163D.7060609@ericsson.com> Date: Mon, 18 Jan 2016 16:43:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20160117082709.GC4059@adacore.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-01/txt/msg00386.txt.bz2 On 16-01-17 03:27 AM, Joel Brobecker wrote: > I admit that some of it flying a little over my head... Does it > mean that we will be able to abort a test if we detect a timeout? > This is one of the things I wanted to do, but didn't have a solution > for, so it'd be fantastic if it helped with that! --status does no really impact how a timeout is handled. What happens when a timeout occurs in gdb_test is defined by us. Right now, it produces a test "fail": testsuite/lib/gdb.exp: 937 timeout { 938 if ![string match "" $message] then { 939 fail "$message (timeout)" 940 } 941 set result 1 942 } So you see, for example: FAIL: gdb.base/break.exp: some test (timeout) and the test case carries on. A gdb_test timeout is no different than a regular fail. If you replace the "fail" at line 939 with "error", which throws a TCL exception, then the current test case will abort, although in this quite ugly way: Running /home/emaisin/src/binutils-gdb/gdb/testsuite/gdb.base/break.exp ... ERROR OCCURED: some test (timeout) while executing "error "$message (timeout)"" invoked from within "if ![string match "" $message] then { error "$message (timeout)" }" invoked from within "expect { -i exp8 -timeout 1 -re ".*A problem internal to GDB has been detected" { fail "$message (GDB internal error)" gdb_internal_error_..." ("uplevel" body line 1) invoked from within "uplevel $body" NONE insert breakpoint (timeout)WARNING: remote_expect statement without a default case?! The current test case is stopped and the next .exp is ran. However, if you don't use --status on the runtest command line, the uncaught exception will not be considered as an error. So if you use "make check" in a script, you won't notice the failure.