From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25713 invoked by alias); 25 Apr 2017 12:51:55 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 25609 invoked by uid 89); 25 Apr 2017 12:51:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=2935, nathan@acm.org, nathanacmorg, D*acm.org X-HELO: mail-yb0-f182.google.com Received: from mail-yb0-f182.google.com (HELO mail-yb0-f182.google.com) (209.85.213.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 25 Apr 2017 12:51:51 +0000 Received: by mail-yb0-f182.google.com with SMTP id 81so67620676ybp.0 for ; Tue, 25 Apr 2017 05:51:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:from:subject:message-id:date :user-agent:mime-version:content-language; bh=8178Se1AmEziqEbOJBDBBnrJUjYm14QIOBJ+0OwcA7M=; b=Xw7HZb9yee16TIF8tNvgufmAthB8wGxCIPxbqkqEbHbv18CH9ixme4OOhoKzxle6Di /l6DT3RdPwvJpSpiusmkwAMZwWoWkndKtyaKERA8VJX/Poo6Q3jW9R9FgD5543JVybLZ o6rrYCsi+vXXHZIF42eJ9AjZl2bEd8ANit7Z4JU7q7HE8pgY2/CILQTKr1vjJ0RMEsOe BxA0j7PknVgT+h573UZVfX18clW8EAHZC48LWRvNk/V7g4FFxLNzi36I+mS9uNlu0Ee0 j77akMfqBBOcBE+tg8JZtexjdB+20ZBn9SKidl/s7/VRTGlxt5Odq/ZRO9zPhZFRAjjX 3d7w== X-Gm-Message-State: AN3rC/5Mb8N9VbYd/KcWDa5ZRhMEeMY8YDNLfEiFfAJkvqAsVcFOYawm Q9N3aMRy9uapzg== X-Received: by 10.37.69.9 with SMTP id s9mr6084393yba.197.1493124711483; Tue, 25 Apr 2017 05:51:51 -0700 (PDT) Received: from ?IPv6:2620:10d:c0a3:20fb:f6d0:5ac5:64cd:f102? ([2620:10d:c091:200::2:8903]) by smtp.googlemail.com with ESMTPSA id a85sm8524610ywh.7.2017.04.25.05.51.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Apr 2017 05:51:50 -0700 (PDT) To: GCC Patches From: Nathan Sidwell Subject: [C++] testsuite tweak Message-ID: <077c2a06-a10f-4f99-3a1b-5a7e9805207c@acm.org> Date: Tue, 25 Apr 2017 12:55:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------1FAA00B259155F0A1A23E51B" X-SW-Source: 2017-04/txt/msg01181.txt.bz2 This is a multi-part message in MIME format. --------------1FAA00B259155F0A1A23E51B Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 446 The G++ testsuite's main dg.exp file does a recursive glob for .C files and then prunes out those in directories known to contain their own .exp file. This is dumb. This patch adds a recursive directory walker that stops when it encounters a .exp file. In addition to not having to specify the same thing twice, it keeps things nicely collated, (tcl's prune function can scramble ordering). committed to trunk. nathan -- Nathan Sidwell --------------1FAA00B259155F0A1A23E51B Content-Type: text/x-patch; name="dg.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dg.diff" Content-length: 2447 2017-04-25 Nathan Sidwell * g++.dg/dg.exp (find-cxx-tests): New function. (main): Use it, remove explicit pruning Index: testsuite/g++.dg/dg.exp =================================================================== --- testsuite/g++.dg/dg.exp (revision 247214) +++ testsuite/g++.dg/dg.exp (working copy) @@ -29,35 +29,19 @@ if ![info exists DEFAULT_CXXFLAGS] then # Initialize `dg'. dg-init -# Gather a list of all tests, with the exception of those in directories -# that are handled specially. -set tests [lsort [find $srcdir/$subdir *.C]] -set tests [prune $tests $srcdir/$subdir/bprob/*] -set tests [prune $tests $srcdir/$subdir/charset/*] -set tests [prune $tests $srcdir/$subdir/cilk-plus/AN/*] -set tests [prune $tests $srcdir/$subdir/compat/*] -set tests [prune $tests $srcdir/$subdir/debug/*] -set tests [prune $tests $srcdir/$subdir/dfp/*] -set tests [prune $tests $srcdir/$subdir/gcov/*] -set tests [prune $tests $srcdir/$subdir/lto/*] -set tests [prune $tests $srcdir/$subdir/pch/*] -set tests [prune $tests $srcdir/$subdir/plugin/*] -set tests [prune $tests $srcdir/$subdir/special/*] -set tests [prune $tests $srcdir/$subdir/tls/*] -set tests [prune $tests $srcdir/$subdir/vect/*] -set tests [prune $tests $srcdir/$subdir/goacc/*] -set tests [prune $tests $srcdir/$subdir/goacc-gomp/*] -set tests [prune $tests $srcdir/$subdir/gomp/*] -set tests [prune $tests $srcdir/$subdir/tree-prof/*] -set tests [prune $tests $srcdir/$subdir/torture/*] -set tests [prune $tests $srcdir/$subdir/graphite/*] -set tests [prune $tests $srcdir/$subdir/tm/*] -set tests [prune $tests $srcdir/$subdir/cilk-plus/*] -set tests [prune $tests $srcdir/$subdir/guality/*] -set tests [prune $tests $srcdir/$subdir/simulate-thread/*] -set tests [prune $tests $srcdir/$subdir/asan/*] -set tests [prune $tests $srcdir/$subdir/ubsan/*] -set tests [prune $tests $srcdir/$subdir/tsan/*] +# Recursively find files in $dir and subdirs, do not walk into subdirs +# that contain their own .exp file. +proc find-cxx-tests { dir suffix } { + set tests [lsort [glob -nocomplain -directory $dir "*.$suffix" ]] + foreach subdir [lsort [glob -nocomplain -type d -directory $dir *]] { + if { [glob -nocomplain -directory $subdir *.exp] eq "" } { + lappend tests {*}[find-cxx-tests $subdir $suffix] + } + } + return $tests +} + +set tests [find-cxx-tests $srcdir/$subdir {C}] # Main loop. g++-dg-runtest $tests "" $DEFAULT_CXXFLAGS --------------1FAA00B259155F0A1A23E51B--