From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +ZWKKpULLGQN7yIAWB0awg (envelope-from ) for ; Tue, 04 Apr 2023 07:35:49 -0400 Received: by simark.ca (Postfix, from userid 112) id 9DAF41E15D; Tue, 4 Apr 2023 07:35:49 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=lCkz5lO3; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id E97011E0D3 for ; Tue, 4 Apr 2023 07:35:48 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 45D563858416 for ; Tue, 4 Apr 2023 11:35:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 45D563858416 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1680608148; bh=1NdAH1rJdZyNkOMJ27rd6YMwCb83/70SCWaCrgJu6UQ=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=lCkz5lO3qB+Phl8a6gM6bQ3rrNeH5oZ9ZnkL4bRJwLEMqMi/IL1DzcfLESaOqj5sM XSiXJunAvJWhNaX1ua7Zpqsf5seQ5h3vHrOsXs5VUtI6Q7xHsEmw+TA3bso3PzNGHu FLVxdCuytuNr+SwuLgxq1ukF8NibMnXU/jB8TXIU= 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 0D929385840F for ; Tue, 4 Apr 2023 11:35:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0D929385840F Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-368-n4_NQ6YKOdarp2CDWnOiJA-1; Tue, 04 Apr 2023 07:35:24 -0400 X-MC-Unique: n4_NQ6YKOdarp2CDWnOiJA-1 Received: by mail-qt1-f200.google.com with SMTP id y10-20020a05622a164a00b003e38e0a3cc3so21805607qtj.14 for ; Tue, 04 Apr 2023 04:35:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680608124; 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=1NdAH1rJdZyNkOMJ27rd6YMwCb83/70SCWaCrgJu6UQ=; b=xYF/SeYVPX9Nv4C+vQfC0NuI6aU7/7qUO2zuBoEi16305iG2+rwfY+s9jJ89QyIBUw rbubSuKY3xh8Uy+ldpMQYyA5oE/Fc0lK4/ncpLlLaYJf/WH2bRN3W+2tubQjpz7KlFX3 f4CfZPR8844JxFTBjarJWe76dIVmA9jXzot38dldYQZ9t0RRJsN9Mtu2xJyUZ/xMQqxI jRbdW/PHDvMv9IMsXgNN8I5fzAqSVkRmOeAbGtAnP+A4lzKUsx7iuv5pW+VrKvJZv36Z bVBPJX6nT+7nhw5KWPSmfyFeeDvHj4fQA/8Yre1riijlmZd/J6uShwbbBEvKGp79LWrx rLbw== X-Gm-Message-State: AAQBX9dzyXeeVmfwVxaZBnoPNDCNxnXnYYlC99bwzJHRxzYos60RjnMG eYj7ZzvMFN1IIUHl1099yZ3frU3tlAJj0uYZcFQ8HlQEXE02vCL4wylyDNAJc4s65yl3XVOP2oA twojXRHYtj2c/QC45PZgxBQ== X-Received: by 2002:a05:6214:21a6:b0:5c1:dfee:8a59 with SMTP id t6-20020a05621421a600b005c1dfee8a59mr2208194qvc.44.1680608124227; Tue, 04 Apr 2023 04:35:24 -0700 (PDT) X-Google-Smtp-Source: AKy350Y5wZbqbvQAtqPH7OMFscxXfAQasJSoPtxqk7tPrTFSk1eyVJ3jMjfV8vAq1vfWBj1dKpmCqw== X-Received: by 2002:a05:6214:21a6:b0:5c1:dfee:8a59 with SMTP id t6-20020a05621421a600b005c1dfee8a59mr2208171qvc.44.1680608123877; Tue, 04 Apr 2023 04:35:23 -0700 (PDT) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id og18-20020a056214429200b005dd8b934587sm3322876qvb.31.2023.04.04.04.35.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Apr 2023 04:35:23 -0700 (PDT) To: Tom de Vries , gdb-patches@sourceware.org Subject: Re: [PATCH 1/1] [gdb/contrib] Add make-check-all.sh In-Reply-To: <20230403150957.28921-2-tdevries@suse.de> References: <20230403150957.28921-1-tdevries@suse.de> <20230403150957.28921-2-tdevries@suse.de> Date: Tue, 04 Apr 2023 12:35:21 +0100 Message-ID: <87wn2rc22u.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain 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: , From: Andrew Burgess via Gdb-patches Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Tom de Vries via Gdb-patches writes: > Add script gdb/contrib/make-check-all.sh, that's intended to function as a > drop-in replacement of make check, but excercising all host/target boards in > gdb/testsuite/boards. > > Shell-checked and tested on x86_64-linux. Hi Tom, Thanks for putting this together, I think this could be really useful. I'm not a fan of the way you've split the patch description into email 0/1 and not included it with this commit. I think there's lots of useful information in there, and I'd much rather have the whole description included in the commit message -- it's much easier to find then rather than having to hunt on the mailing list in the future. > --- > gdb/contrib/make-check-all.sh | 255 ++++++++++++++++++++++++++++++++++ > 1 file changed, 255 insertions(+) > create mode 100755 gdb/contrib/make-check-all.sh > > diff --git a/gdb/contrib/make-check-all.sh b/gdb/contrib/make-check-all.sh > new file mode 100755 > index 00000000000..1befe418b81 > --- /dev/null > +++ b/gdb/contrib/make-check-all.sh > @@ -0,0 +1,255 @@ > +#!/bin/bash > + > +# Copyright (C) 2023 Free Software Foundation, Inc. > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; either version 3 of the License, or > +# (at your option) any later version. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program. If not, see . > + > +# Run make check with all boards from gdb/testsuite/boards. I think you need some kind of usage test here too. Imagine a new developer finds this file and looks inside. Ideally, I think they should know how to use it, and what it will do for them without having to read any of the actual script content. On implementation, I wonder if it would be useful to provide a mechanism by which the gdb.sum and gdb.log files for each test run could be preserved? Thanks, Andrew > + > +host_boards=( > + local-remote-host > + local-remote-host-notty > +) > + > +gdbserver_boards=( > + native-extended-gdbserver > + native-gdbserver > + native-stdio-gdbserver > +) > + > +remote_gdbserver_boards=( > + remote-gdbserver-on-localhost > + remote-stdio-gdbserver > +) > + > +host_target_boards=( > + local-remote-host-native > +) > + > +target_boards=( > + cc-with-gdb-index > + cc-with-debug-names > + cc-with-dwz > + cc-with-dwz-m > + cc-with-gnu-debuglink > + debug-types > + dwarf4-gdb-index > + dwarf64 > + fission > + fission-dwp > + gold > + gold-gdb-index > + readnow > + stabs > +) > + > +rtf_for_board () > +{ > + local b > + b="$1" > + > + case $b in > + local-remote-host-native) > + mkdir -p "$tmpdir/$b" > + rtf=( > + "${rtf[@]}" > + "HOST_DIR=$tmpdir/$b" > + ) > + ;; > + remote-stdio-gdbserver) > + rtf=( > + "${rtf[@]}" > + "REMOTE_HOSTNAME=localhost" > + ) > + if [ "$target_user" != "" ]; then > + rtf=( > + "${rtf[@]}" > + "REMOTE_USERNAME=$target_user" > + ) > + else > + rtf=( > + "${rtf[@]}" > + "REMOTE_USERNAME=$USER" > + ) > + fi > + ;; > + remote-gdbserver-on-localhost) > + if [ "$target_user" != "" ]; then > + rtf=( > + "${rtf[@]}" > + "REMOTE_TARGET_USERNAME=$target_user" > + ) > + fi > + ;; > + local-remote-host|local-remote-host-notty) > + if [ "$host_user" != "" ]; then > + rtf=( > + "${rtf[@]}" > + "REMOTE_HOST_USERNAME=$host_user" > + ) > + else > + rtf=( > + "${rtf[@]}" > + "REMOTE_HOST_USERNAME=$USER" > + ) > + fi > + ;; > + *) > + ;; > + esac > +} > + > +summary () > +{ > + if $verbose; then > + cat > + else > + grep -E "^(#|FAIL:|ERROR:|WARNING:)" \ > + | sort -u > + fi > +} > + > +do_tests () > +{ > + if $debug; then > + echo "RTF: ${rtf[*]}" > + fi > + > + if $dry_run; then > + return > + fi > + > + make check \ > + RUNTESTFLAGS="${rtf[*]} ${tests[*]}" \ > + 2>&1 \ > + | summary > +} > + > +parse_args () > +{ > + debug=false > + keep=false > + verbose=false > + dry_run=false > + > + host_user="" > + target_user="" > + > + while [ $# -gt 0 ]; do > + case "$1" in > + --debug) > + debug=true > + ;; > + --keep) > + keep=true > + ;; > + --verbose) > + verbose=true > + ;; > + --dry-run) > + dry_run=true > + ;; > + --host-user) > + shift > + host_user="$1" > + ;; > + --target-user) > + shift > + target_user="$1" > + ;; > + *) > + break > + ;; > + esac > + shift > + done > + > + tests=("$@") > +} > + > +main () > +{ > + local b > + local h > + > + parse_args "$@" > + > + tmpdir=$(mktemp -d) > + > + if $debug; then > + echo "TESTS: ${tests[*]}" > + fi > + > + if true; then > + echo "LOCAL:" > + rtf=() > + do_tests > + fi > + > + if true; then > + for b in "${target_boards[@]}"; do > + echo "TARGET BOARD: $b" > + rtf=( > + --target_board="$b" > + ) > + rtf_for_board "$b" > + do_tests > + done > + fi > + > + if true; then > + for b in "${gdbserver_boards[@]}" "${remote_gdbserver_boards[@]}"; do > + echo "TARGET BOARD: $b" > + rtf=( > + --target_board="$b" > + ) > + rtf_for_board "$b" > + do_tests > + done > + fi > + > + if true; then > + for h in "${host_boards[@]}"; do > + for b in "${remote_gdbserver_boards[@]}"; do > + echo "HOST BOARD: $h, TARGET BOARD: $b" > + rtf=( > + --host_board="$h" > + --target_board="$b" > + ) > + rtf_for_board "$h" > + rtf_for_board "$b" > + do_tests > + done > + done > + fi > + > + if true; then > + for b in "${host_target_boards[@]}"; do > + echo "HOST/TARGET BOARD: $b" > + rtf=( > + --host_board="$b" > + --target_board="$b" > + ) > + rtf_for_board "$b" > + do_tests > + done > + fi > + > + if $keep; then > + echo "keeping tmp dir $tmpdir" > + else > + rm -Rf "$tmpdir" > + fi > +} > + > +main "$@" > -- > 2.35.3