From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52122 invoked by alias); 15 Sep 2015 18:52:59 -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 52112 invoked by uid 89); 15 Sep 2015 18:52:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 15 Sep 2015 18:52:57 +0000 Received: from svr-orw-fem-06.mgc.mentorg.com ([147.34.97.120]) by relay1.mentorg.com with esmtp id 1ZbvLa-0001Ua-W9 from Sandra_Loosemore@mentor.com for gdb-patches@sourceware.org; Tue, 15 Sep 2015 11:52:55 -0700 Received: from [IPv6:::1] (147.34.91.1) by SVR-ORW-FEM-06.mgc.mentorg.com (147.34.97.120) with Microsoft SMTP Server id 14.3.224.2; Tue, 15 Sep 2015 11:52:54 -0700 Message-ID: <55F868D7.3070309@codesourcery.com> Date: Tue, 15 Sep 2015 18:52:00 -0000 From: Sandra Loosemore User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: gdb-patches Subject: [patch, testsuite] skip tests in with_target_charset if no ICONV support Content-Type: multipart/mixed; boundary="------------080405070705010509030003" X-SW-Source: 2015-09/txt/msg00357.txt.bz2 --------------080405070705010509030003 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 458 If GDB is configured without ICONV support, it only knows about the charset "ISO-8859-1". Tests that use with_target_charset with some other character set (e.g., gdb.base/printcmds.exp) presumably depend on exactly that character set being supported and can't be expected to work properly in its absence. This patch makes with_target_charset skip those tests as unsupported if switching to the specified character set fails. OK to commit? -Sandra --------------080405070705010509030003 Content-Type: text/x-log; name="iconv.log" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="iconv.log" Content-length: 200 2015-09-15 Sandra Loosemore gdb/testsuite/ * lib/gdb.exp (with_target_charset): Skip tests as unsupported if target_charset is not valid, e.g. due to no ICONV support. --------------080405070705010509030003 Content-Type: text/x-patch; name="iconv.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="iconv.patch" Content-length: 711 diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 56cde7a..747d66e 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -2043,7 +2043,17 @@ proc with_target_charset { target_charset body } { } } - gdb_test_no_output "set target-charset $target_charset" "" + # Setting the charset may fail if GDB was configured without + # ICONV support. + gdb_test_multiple "set target-charset $target_charset" "" { + -re "Undefined item.*$gdb_prompt " { + unsupported "Unknown charset $target_charset" + return -1 + } + -re ".*$gdb_prompt " { + pass "set target-charset $target_charset" + } + } set code [catch {uplevel 1 $body} result] --------------080405070705010509030003--