From patchwork Tue Apr 25 12:51:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 754807 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wC3536292z9sCZ for ; Tue, 25 Apr 2017 22:52:06 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="lWUD0rK7"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=fZWqR/saBPUs3756r+/09tZ5yUvbILMvpiecoX4DBwcs6R3RS2 JAAwJIqIOTPj8qXxemF4EaeIAwb/P/QF5VpPx2KAIQhLK7o8938bZLL8It3DNNCP TWclGmQ7ceYw8JCk0B0F41KurnRiGSAWMgx2g82sV3enskyKNr5AH3YE4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=/ztkLtafOdVTugxtFSgm1wijueQ=; b=lWUD0rK7yb79riPwWOOZ ZQA9VaCPZvETsOXMBSD98qEMq0EfWihB55ctmWJQoaCK93eabuZMsOnh8NUPr1If Bp44HXFM1LYmZRUTuyHu6+3D2ONJIa/8/kEHkp/6f17B+fNZs0KWBWdhlSI5NMPl +qPVYVtUrQICqm0KU9qMBGY= 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-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@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 08:51:49 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 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 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