From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id E21913858D28 for ; Wed, 25 Jan 2023 11:30:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E21913858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674646225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=e61dVPCnxaqpXj4sIhwyRaWIN0kKcPO3Zr26DnD0d9g=; b=QOSs0414rldE9MV9qj9UZ/+24bC2kUMEqiCQKgRvXuFN2djyIEiRpOKsSSMrq09f4u/MZr 1gkRlobLDfAGiC/YViIK6jwKCIchBiq+nKx5RjTm7i9zCS4/+67NtLOgkLOO837sunIhxo nIdGjv5LUDp0Xor+7DbYsfLotp8QcyQ= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-92-GC0aWb2FPqy7TOVCADRO5Q-1; Wed, 25 Jan 2023 06:30:24 -0500 X-MC-Unique: GC0aWb2FPqy7TOVCADRO5Q-1 Received: by mail-qt1-f199.google.com with SMTP id c18-20020ac84e12000000b003b5d38f1d29so7437422qtw.0 for ; Wed, 25 Jan 2023 03:30:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=e61dVPCnxaqpXj4sIhwyRaWIN0kKcPO3Zr26DnD0d9g=; b=AVOwyCxnOE3EascAD5BmbQscoP4sDd7Yg4KWtqqIa1cymSTZ04OYomt+Sz2y6NTus0 ovfVaKHyOe3kDSd3yzDXdsWRS9ohKN8umKdOTIEDIZphyfGyCKyAPESE+V3RKaZKYDI6 5pU/oyOOrw3iFrCWyN83xrJXcA6Xozzqbv5b/hy1hZcKcAaKtLFUTDvYf/7319I69Yzw Wi9kbfkaca0iCyzYyGIAhuFIB7cuA3ygV2Lyt1KOdiXz6PKGe/CT+lQssU4dk5Rs0dCC qbrrPrJW3oc6R2hM5KwYFDQA9DlzyHQ7dOHNbCYUEcOxNT/Xf5IdBVNd+2EDdU++9Y+7 Tggw== X-Gm-Message-State: AFqh2krMqFPb+jDCRqN5Ai/NaoUx338nmOq1pHQMx7LevytTZuVkkIjn DTn/ZM8TccE/Mej61brZGezM6374TXHN4kqRDwTqGNiQBg78JkB+ZwMTmlU0GIda6Y7HVcr4HYx AnbIsn5GgQDDFnHLTzfihIbWedEE6uEGa1WV0qPsHRsyFLrSJ+hMdptPnrHPZyIhkr+zhhRTW1Q == X-Received: by 2002:ac8:739a:0:b0:3b6:3427:a672 with SMTP id t26-20020ac8739a000000b003b63427a672mr41086797qtp.57.1674646223787; Wed, 25 Jan 2023 03:30:23 -0800 (PST) X-Google-Smtp-Source: AMrXdXuqpC3eIjsH6+AqJ2NHoZbx55FjEIx1MJb+Mh6Vwqx927lk2ygfmejoFO/E9pZ5fh03KZadhg== X-Received: by 2002:ac8:739a:0:b0:3b6:3427:a672 with SMTP id t26-20020ac8739a000000b003b63427a672mr41086769qtp.57.1674646223373; Wed, 25 Jan 2023 03:30:23 -0800 (PST) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id x25-20020ac84d59000000b003b5bc7a4512sm3146501qtv.26.2023.01.25.03.30.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jan 2023 03:30:23 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Subject: Re: [PATCH 03/15] gdb/testsuite: update gdb.tui/tui-nl-filtered-output.exp In-Reply-To: References: Date: Wed, 25 Jan 2023 11:30:21 +0000 Message-ID: <87k01ax35e.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,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 List-Id: Andrew Burgess writes: > Following on from the previous commit, in this commit I am updating > the test script gdb.tui/tui-nl-filtered-output.exp to take account of > the changes in commit: > > commit 9162a27c5f5828240b53379d735679e2a69a9f41 > Date: Tue Nov 13 11:59:03 2018 -0700 > > Change gdb test suite's TERM setting > > In the above commit the TERM environment variable was changed to be > 'dumb' by default, which means that tests, that previously activated > tui mode, no longer do unless TERM is set to 'ansi'. > > As the gdb.tui/tui-nl-filtered-output.exp script didn't do this, the > test stopped working. As the expect patterns in this script were > pretty generic no tests actually started failing, and we never > noticed. > > In this commit I update the test script to correctly activate our > terminal emulator, the test continues to pass after this update, but > now we are testing in tui mode. I've gone ahead and pushed this patch. The final version that I pushed is included below. Thanks, Andrew --- commit 3602634035f6a346ac043a7f01442a7290b9f588 Author: Andrew Burgess Date: Thu Dec 22 10:24:22 2022 +0000 gdb/testsuite: update gdb.tui/tui-nl-filtered-output.exp Following on from the previous commit, in this commit I am updating the test script gdb.tui/tui-nl-filtered-output.exp to take account of the changes in commit: commit 9162a27c5f5828240b53379d735679e2a69a9f41 Date: Tue Nov 13 11:59:03 2018 -0700 Change gdb test suite's TERM setting In the above commit the TERM environment variable was changed to be 'dumb' by default, which means that tests, that previously activated tui mode, no longer do unless TERM is set to 'ansi'. As the gdb.tui/tui-nl-filtered-output.exp script didn't do this, the test stopped working. As the expect patterns in this script were pretty generic no tests actually started failing, and we never noticed. In this commit I update the test script to correctly activate our terminal emulator, the test continues to pass after this update, but now we are testing in tui mode. diff --git a/gdb/testsuite/gdb.tui/tui-nl-filtered-output.exp b/gdb/testsuite/gdb.tui/tui-nl-filtered-output.exp index b7ea67cf723..5b1d6b7d9ba 100644 --- a/gdb/testsuite/gdb.tui/tui-nl-filtered-output.exp +++ b/gdb/testsuite/gdb.tui/tui-nl-filtered-output.exp @@ -32,24 +32,19 @@ require allow_tui_tests -gdb_exit -gdb_start - -# Enable the TUI. - -set test "tui enable" -gdb_test_multiple "tui enable" $test { - -re "$gdb_prompt $" { - pass $test - } -} - -# Make sure filtering/pagination is enabled, but make the window high -# enough that we don't paginate in practice. -gdb_test_no_output "set pagination on" -gdb_test_no_output "set height 2000" - -gdb_test \ - {printf "hello\nworld\n"} \ - "hello\r\nworld" \ - "correct line breaks" +tuiterm_env + +# Setup and enter TUI mode. +Term::clean_restart 24 80 +Term::enter_tui + +# Send the command, and check the output is correctly split over +# multiple lines. +Term::command \ + {printf "hello\nworld\n"} +Term::check_region_contents "check printf output" \ + 0 16 80 4 [multi_line \ + "$gdb_prompt printf \"hello\\\\nworld\\\\n\"\\s+" \ + "hello\\s+" \ + "world\\s+" \ + "$gdb_prompt\\s+"]