From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 28997385B52B; Wed, 30 Nov 2022 17:49:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 28997385B52B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669830560; bh=tDUlblWA/vWM91neSvKZNIdYLAB7ZTnRs/PYACToXV8=; h=From:To:Subject:Date:From; b=TMfCoRty4Z1Qur4GQXRUp1HfEAvTWf01PEgt9UESZpQUn/TdH4fXn143b5jSzPcY4 6/WCI+RJPoR7DnqFX22ij5ws2L/UWClnwhk9ZFtz7tW59Ha+WDg3JGkwigFDHole4N rKQakQCfgSE2prBdSOhhOTy/OZUDgxNfehyhkB3Q= 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] Enable gdb.arch/s390-disassembler-options.exp for --enable-targets=all X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 885d86436c3f9ab0a13f39647860b526faa92cf8 X-Git-Newrev: a496d4a104f2f8edca9287ab62c8d4031a272035 Message-Id: <20221130174920.28997385B52B@sourceware.org> Date: Wed, 30 Nov 2022 17:49:20 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Da496d4a104f2= f8edca9287ab62c8d4031a272035 commit a496d4a104f2f8edca9287ab62c8d4031a272035 Author: Tom de Vries Date: Wed Nov 30 18:49:16 2022 +0100 [gdb/testsuite] Enable gdb.arch/s390-disassembler-options.exp for --ena= ble-targets=3Dall =20 On s390x-linux, I run into: ... DUPLICATE: gdb.arch/s390-disassembler-options.exp: \ show disassembler-options esa ... =20 First, reproduce this on x86_64-linux with --enable-targets=3Dall, by r= eplacing the test for 'istarget "s390*-*-*"' with a test for 'get_set_option_cho= ices "set architecture" "s390"'. =20 Fix the DUPLICATE by using with_test_prefix. =20 Also modernize the test-case by using clean_restart instead of gdb_exit= /gdb_start. =20 Tested on x86_64-linux. Diff: --- .../gdb.arch/s390-disassembler-options.exp | 36 ++++++++++++------= ---- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/gdb/testsuite/gdb.arch/s390-disassembler-options.exp b/gdb/tes= tsuite/gdb.arch/s390-disassembler-options.exp index 7ba9e51cc3c..df6c2363069 100644 --- a/gdb/testsuite/gdb.arch/s390-disassembler-options.exp +++ b/gdb/testsuite/gdb.arch/s390-disassembler-options.exp @@ -18,39 +18,43 @@ # This test exercises set/show disassembler-options results are preserved # across multiple set architecture calls. =20 -if {![istarget "s390*-*-*"]} { - verbose "Skipping S390 disassembler options." - return -} - -gdb_exit -gdb_start +clean_restart =20 -set option "esa" +set archs [get_set_option_choices "set architecture" "s390"] set arch1 "s390:64-bit" set arch2 "s390:31-bit" +foreach arch [list $arch1 $arch2] { + if { [lsearch -exact $archs $arch] =3D=3D -1 } { + return + } +} =20 -gdb_test "set architecture $arch1" \ +set option "esa" + +with_test_prefix $arch1 { + gdb_test "set architecture $arch1" \ "The target architecture is set to \"$arch1\"\." \ "set architecture $arch1" =20 -gdb_test_no_output "set disassembler-options" -gdb_test "show disassembler-options" \ + gdb_test_no_output "set disassembler-options" + gdb_test "show disassembler-options" \ "The current disassembler options are ''.*" \ "show NULL disassembler-options" =20 -gdb_test_no_output "set disassembler-options $option" -gdb_test "show disassembler-options" \ + gdb_test_no_output "set disassembler-options $option" + gdb_test "show disassembler-options" \ "The current disassembler options are '$option'.*" \ "show disassembler-options $option" +} =20 # Change architectures and verify the disassembler options have been prese= rved. =20 -gdb_test "set architecture $arch2" \ +with_test_prefix $arch2 { + gdb_test "set architecture $arch2" \ "The target architecture is set to \"$arch2\"\." \ "set architecture $arch2" =20 -gdb_test "show disassembler-options" \ + gdb_test "show disassembler-options" \ "The current disassembler options are '$option'.*" \ "show disassembler-options $option" - +}