From patchwork Tue Nov 15 10:42:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 60641 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8626F3896C16 for ; Tue, 15 Nov 2022 10:45:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8626F3896C16 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668509147; bh=hDBcXBkqjs8wkh1Me/XCqDoMz5nzvgOnRoFKkhLAJJY=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=MGfgUH8M0O5LccSUX6G+vyBQI/08lz4p4nR9blNnsxySJKE2a2+HJGn27ERwvhT0y cCOEgjkiuAg8uJyCIUCBRZYpDUys5B5v6qh5t0ZDI+3eTnUVmHfqdbLZ/+ETP+hcHU xq4QYq/A5l+9bJowqcMOeY2gPhrVA4vQdqVi2SF0= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 101193896C32 for ; Tue, 15 Nov 2022 10:43:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 101193896C32 Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-645-qnEzK31hOR6TFz_mWjwFGg-1; Tue, 15 Nov 2022 05:43:02 -0500 X-MC-Unique: qnEzK31hOR6TFz_mWjwFGg-1 Received: by mail-qk1-f200.google.com with SMTP id bi42-20020a05620a31aa00b006faaa1664b9so13160436qkb.8 for ; Tue, 15 Nov 2022 02:43:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hDBcXBkqjs8wkh1Me/XCqDoMz5nzvgOnRoFKkhLAJJY=; b=PpXBaTlNsxeCaR73jRP4qE4jRJ+1NsemyhNZ3JNqZHGSAacXOTKyfRK3fH0/PPXDOl /YhTFaUzpQTJU2e57WMGHKVYCkWaDJPUxeyeUNjpK+aEZYZ7+3kEgEpceT6JMsr9i62j Dobsl9SOnOCSSkqv5zUx4FY6glGpmoFQnI/UGvj34K5Tfe/WeZpXrgq+Y82wmBhDM5JO Nfv2Q5fdvpgDxquO3hYH1dvyGZW6yCAyrbBbjSAqdH7sz3bZ4NqU4dFQM+IjDPC3un0N 1Gw+yOKoaPcNCzocUWoxHPLvjXJ7P7BOcKh5XjuW4wtnBq8N7Xy+bUP+VNtKrSO6nZCC Jj8w== X-Gm-Message-State: ANoB5pmQu7Dezx1ewmYzh5Wmo3PSV7Kg8nYS3liaZC+4o09xPUiJOxpm a/yjz4Qfx5AZfsf5BdZLKORM0GdsrsICm5nwiT+02wh5UdRxP/l1WBtwiIJG3rvol3/I4Jf2OKZ sbIAInlHYnk3hiNrHNYjaWMO+8aSqoeNrUYzFeEm2QkeWNBRJ7T2g5qRaDytMUKjLosQCILFlAg == X-Received: by 2002:a37:508:0:b0:6fa:28c5:e2b with SMTP id 8-20020a370508000000b006fa28c50e2bmr14436937qkf.403.1668508981843; Tue, 15 Nov 2022 02:43:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf5oTrldFMkVm2Zt5Ms6qUFAORtb15JzAf+P5FYyH4MFL5xznvZfkokwCTg977dYzO1aKP7zsA== X-Received: by 2002:a37:508:0:b0:6fa:28c5:e2b with SMTP id 8-20020a370508000000b006fa28c50e2bmr14436922qkf.403.1668508981486; Tue, 15 Nov 2022 02:43:01 -0800 (PST) Received: from localhost ([31.111.84.238]) by smtp.gmail.com with ESMTPSA id s1-20020a05620a29c100b006faeecef56fsm8030626qkp.68.2022.11.15.02.43.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 02:43:01 -0800 (PST) To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 12/14] gdb/testsuite: remove use of then keyword from gdb.multi/*.exp Date: Tue, 15 Nov 2022 10:42:29 +0000 Message-Id: <6bd02134aaaa466d2fe956a6b598413d70736c90.1668508387.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Andrew Burgess via Gdb-patches From: Andrew Burgess Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" The canonical form of 'if' in modern TCL is 'if {} {}'. But there's still a bunch of places in the testsuite where we make use of the 'then' keyword, and sometimes these get copies into new tests, which just spreads poor practice. This commit removes all use of the 'then' keyword from the gdb.multi/ test script directory. There should be no changes in what is tested after this commit. --- gdb/testsuite/gdb.multi/base.exp | 8 ++++---- gdb/testsuite/gdb.multi/bkpt-multi-exec.exp | 4 ++-- gdb/testsuite/gdb.multi/dummy-frame-restore.exp | 4 ++-- gdb/testsuite/gdb.multi/info-threads.exp | 2 +- gdb/testsuite/gdb.multi/multi-arch-exec.exp | 2 +- gdb/testsuite/gdb.multi/multi-arch.exp | 4 ++-- gdb/testsuite/gdb.multi/multi-re-run.exp | 2 +- gdb/testsuite/gdb.multi/tids-gid-reset.exp | 8 ++++---- gdb/testsuite/gdb.multi/tids.exp | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/gdb/testsuite/gdb.multi/base.exp b/gdb/testsuite/gdb.multi/base.exp index 7f291996ef4..6c5042eb404 100644 --- a/gdb/testsuite/gdb.multi/base.exp +++ b/gdb/testsuite/gdb.multi/base.exp @@ -85,7 +85,7 @@ gdb_test_multiple "info inferior 2 3" "info inferior 2 3" { exp_continue } -re "$gdb_prompt $" { - if { !$see1 && $see2 && $see3 } then { + if {!$see1 && $see2 && $see3} { pass "info inferior 2 3" } else { fail "info inferior 2 3" @@ -111,7 +111,7 @@ gdb_test_multiple "info inferior 1-2" "info inferior 1-2" { exp_continue } -re "$gdb_prompt $" { - if { $see1 && $see2 && !$see3 } then { + if {$see1 && $see2 && !$see3} { pass "info inferior 1-2" } else { fail "info inferior 1-2" @@ -154,7 +154,7 @@ gdb_test "list commonfun" "from goodbye.*" "list commonfun in goodbye" # Let's run the hello program. gdb_test "inferior 1" ".*" "switch to inferior 1 to run it" -if { ![runto_main] } then { +if {![runto_main]} { return -1 } @@ -183,7 +183,7 @@ gdb_test_multiple "info inferiors" "check remove-inferiors" { exp_continue } -re "$gdb_prompt $" { - if { $see1 && !$see2 && !$see3 } then { + if {$see1 && !$see2 && !$see3} { pass "check remove-inferiors" } else { fail "check remove-inferiors" diff --git a/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp b/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp index cf7101bd5f4..43700016b4e 100644 --- a/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp +++ b/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp @@ -19,7 +19,7 @@ if ![target_can_use_run_cmd] { # Until "catch exec" is implemented on other targets... # -if {![istarget "*-linux*"]} then { +if {![istarget "*-linux*"]} { return } @@ -49,7 +49,7 @@ clean_restart ${exec1} # Start the program running, and stop at main. # -if ![runto_main] then { +if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.multi/dummy-frame-restore.exp b/gdb/testsuite/gdb.multi/dummy-frame-restore.exp index 5accd7d4bd7..0cd1cf5a414 100644 --- a/gdb/testsuite/gdb.multi/dummy-frame-restore.exp +++ b/gdb/testsuite/gdb.multi/dummy-frame-restore.exp @@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} { # Inferior 1 stops at f1. -if ![runto f1] then { +if {![runto f1]} { return 0 } @@ -40,7 +40,7 @@ delete_breakpoints # Inferior 2 stops at f2. -if ![runto f2] then { +if {![runto f2]} { return 0 } diff --git a/gdb/testsuite/gdb.multi/info-threads.exp b/gdb/testsuite/gdb.multi/info-threads.exp index 5a4d611d628..650e7c6194f 100644 --- a/gdb/testsuite/gdb.multi/info-threads.exp +++ b/gdb/testsuite/gdb.multi/info-threads.exp @@ -24,7 +24,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {pthreads d return -1 } -if { ![runto_main] } then { +if {![runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.multi/multi-arch-exec.exp b/gdb/testsuite/gdb.multi/multi-arch-exec.exp index a8e81e29ee9..fa31cbb6db6 100644 --- a/gdb/testsuite/gdb.multi/multi-arch-exec.exp +++ b/gdb/testsuite/gdb.multi/multi-arch-exec.exp @@ -151,7 +151,7 @@ proc do_test { first_arch mode selected_thread } { set from_exec "$first_arch-multi-arch-exec" clean_restart ${from_exec} - if ![runto all_started] then { + if {![runto all_started]} { return -1 } diff --git a/gdb/testsuite/gdb.multi/multi-arch.exp b/gdb/testsuite/gdb.multi/multi-arch.exp index b564e6caf25..a15b0217a9e 100644 --- a/gdb/testsuite/gdb.multi/multi-arch.exp +++ b/gdb/testsuite/gdb.multi/multi-arch.exp @@ -78,7 +78,7 @@ if { [build_executable "failed to prepare" ${exec2} "${srcfile2}" \ # Start inferior 1 clean_restart ${exec1} -if ![runto_main] then { +if {![runto_main]} { return } @@ -88,7 +88,7 @@ gdb_test "add-inferior" "Added inferior 2.*" "add empty inferior 2" gdb_test "inferior 2" "Switching to inferior 2.*" "switch to inferior 2" gdb_load ${binfile2} -if ![runto_main] then { +if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.multi/multi-re-run.exp b/gdb/testsuite/gdb.multi/multi-re-run.exp index 5af4fde4baf..04073c94545 100644 --- a/gdb/testsuite/gdb.multi/multi-re-run.exp +++ b/gdb/testsuite/gdb.multi/multi-re-run.exp @@ -80,7 +80,7 @@ proc test_re_run {re_run_inf} { # Run the steady inferior to a breakpoint, and let it stay stopped # there. - if ![runto all_started] then { + if {![runto all_started]} { return 0 } diff --git a/gdb/testsuite/gdb.multi/tids-gid-reset.exp b/gdb/testsuite/gdb.multi/tids-gid-reset.exp index 6cab573a1f8..27474b19e36 100644 --- a/gdb/testsuite/gdb.multi/tids-gid-reset.exp +++ b/gdb/testsuite/gdb.multi/tids-gid-reset.exp @@ -31,7 +31,7 @@ with_test_prefix "single-inferior" { with_test_prefix "before restart" { clean_restart ${testfile} - if { ![runto_main] } then { + if {![runto_main]} { return -1 } @@ -40,7 +40,7 @@ with_test_prefix "single-inferior" { with_test_prefix "restart" { gdb_continue_to_end - if { ![runto_main] } then { + if {![runto_main]} { return -1 } } @@ -66,7 +66,7 @@ with_test_prefix "multi-inferior" { gdb_test "inferior 2" "Switching to inferior 2 .*" "switch to inferior 2" gdb_load ${binfile} - if ![runto_main] then { + if {![runto_main]} { return } @@ -82,7 +82,7 @@ with_test_prefix "multi-inferior" { with_test_prefix "restart" { gdb_continue_to_end - if { ![runto_main] } then { + if {![runto_main]} { return -1 } } diff --git a/gdb/testsuite/gdb.multi/tids.exp b/gdb/testsuite/gdb.multi/tids.exp index fb7c2a29a71..6f2f81c109b 100644 --- a/gdb/testsuite/gdb.multi/tids.exp +++ b/gdb/testsuite/gdb.multi/tids.exp @@ -31,7 +31,7 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {pthreads d return -1 } -if { ![runto_main] } then { +if {![runto_main]} { return -1 }