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 7A68D385624B for ; Thu, 23 Jun 2022 11:31:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7A68D385624B Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-518-RpFtHXMHNsSoQ0fGkErLhA-1; Thu, 23 Jun 2022 07:31:21 -0400 X-MC-Unique: RpFtHXMHNsSoQ0fGkErLhA-1 Received: by mail-ej1-f71.google.com with SMTP id qf29-20020a1709077f1d00b00722e68806c4so3533991ejc.4 for ; Thu, 23 Jun 2022 04:31:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iWw07pm2xCjGTAIH52xBru8/5Fo8fZOp8k4lyMYxHh0=; b=WSCj5gPY16ThzUKcb764Ztf4JUamZGUttTrG4l4aoL9rzFGsZfm9z7ftMjgcZMkQQl US4tBAypSUB7dC0uro7FShn7nmH4truhaLeoSGpe18gBcUfBgC5Cvn6tLUgfiZLXXBFH 5P/SrS89WbPNj5T7rmA6NSgABs43jUpypOIgyr/P+48rQH3TTeByOx2ZY0Ci04gUZivY vPywnociOv87tSfb9NlFXZ8LjEWL+yJ852atoUK+rcgjPEL10kW3ozBKSHkE6CPSUHv1 lwF7eoG5ga4N1DUrEsNVs7nnb72Ps6LZurzkU4883h7iNbv5HGURE3SGMmyorg8R3M/a pmdw== X-Gm-Message-State: AJIora+/pqrBeVwDZoj7QDRVbPG/O+Tuc+SFdDmW0I1wn8EgMQ2rlE8d z5WTdq1jI4Pfah/0iqi0YhlUDzKyniEVivkWSWZQsayFBumOfyowhQ9w27XDqSchuhxW1o4HcYR ua5qJEoNYneWTNnFgh9Q9do0L2kjxH/Q= X-Received: by 2002:a05:6402:3808:b0:435:5a6c:9dd9 with SMTP id es8-20020a056402380800b004355a6c9dd9mr10307142edb.368.1655983879922; Thu, 23 Jun 2022 04:31:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vwQAhWXcJV/z0bk63xjmHd5qykVomLFtfoXNZLrvJn+UczsFzREwTAcUepCcI9NLHcJCM0xKTkSvMF0wvxyx4= X-Received: by 2002:a05:6402:3808:b0:435:5a6c:9dd9 with SMTP id es8-20020a056402380800b004355a6c9dd9mr10307124edb.368.1655983879718; Thu, 23 Jun 2022 04:31:19 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Thu, 23 Jun 2022 12:31:09 +0100 Message-ID: Subject: Re: [PATCH] libstdc++: testsuite: skip fs space tests if not available To: Alexandre Oliva Cc: gcc Patches , "libstdc++" X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-13.4 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_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2022 11:31:26 -0000 On Thu, 23 Jun 2022 at 12:06, Alexandre Oliva wrote: > > On Jun 22, 2022, Jonathan Wakely wrote: > > > This could be done once in testsuite_fs.h as well. > > Done. Erhm, I posted the new revision of the patch for this thread in > the last_write_time thread, so I'm posting the last_write_time one here. Heh, yeah, I just noticed that. > This one also depends on dg infrastructure added in the NO_SYMLINKS patch. > > Regstrapped on x86_64-linux-gnu, also tested with a cross to > aarch64-rtems6. Ok to install? OK, thanks. > > libstdc++: testsuite: skip fs last_write_time tests if dummy > > The last_write_time functions are defined in ways that are useful, or > that fail immediately, depending on various macros. When they fail > immediately, the filesystem last_write_time.cc tests fail noisily, but > the fail is entirely expected. > > Define NO_LAST_WRITE_TIME in the last_write_time.cc tests, according > to the macros that select implementations of last_write_time, and use > it through the new dg-require-target-fs-lwt to skip tests that are > expected to fail. > > > for libstdc++-v3/ChangeLog > > * testsuite/util/testsuite_fs.h (NO_LAST_WRITE_TIME): Define > when appropriate. > * testsuite/lib/libstdc++.exp > (check_v3_target_fs_last_write_time): New. > * testsuite/lib/dg-options.exp (dg-require-target-fs-lwt): > New. > * testsuite/27_io/filesystem/operations/last_write_time.cc: > Skip the test if the features are unavailable. > * testsuite/experimental/filesystem/operations/last_write_time.cc: > Likewise. > --- > .../27_io/filesystem/operations/last_write_time.cc | 1 + > .../filesystem/operations/last_write_time.cc | 1 + > libstdc++-v3/testsuite/lib/dg-options.exp | 9 +++++++++ > libstdc++-v3/testsuite/lib/libstdc++.exp | 8 ++++++++ > libstdc++-v3/testsuite/util/testsuite_fs.h | 5 +++++ > 5 files changed, 24 insertions(+) > > diff --git a/libstdc++-v3/testsuite/27_io/filesystem/operations/last_write_time.cc b/libstdc++-v3/testsuite/27_io/filesystem/operations/last_write_time.cc > index 7d6468a512424..f6460fb83d70d 100644 > --- a/libstdc++-v3/testsuite/27_io/filesystem/operations/last_write_time.cc > +++ b/libstdc++-v3/testsuite/27_io/filesystem/operations/last_write_time.cc > @@ -17,6 +17,7 @@ > > // { dg-do run { target c++17 } } > // { dg-require-filesystem-ts "" } > +// { dg-require-target-fs-lwt "" } > > // 15.25 Permissions [fs.op.last_write_time] > > diff --git a/libstdc++-v3/testsuite/experimental/filesystem/operations/last_write_time.cc b/libstdc++-v3/testsuite/experimental/filesystem/operations/last_write_time.cc > index 38fafc392ca9e..a0bf01ea935c5 100644 > --- a/libstdc++-v3/testsuite/experimental/filesystem/operations/last_write_time.cc > +++ b/libstdc++-v3/testsuite/experimental/filesystem/operations/last_write_time.cc > @@ -18,6 +18,7 @@ > // { dg-options "-DUSE_FILESYSTEM_TS -lstdc++fs" } > // { dg-do run { target c++11 } } > // { dg-require-filesystem-ts "" } > +// { dg-require-target-fs-lwt "" } > > // 15.25 Permissions [fs.op.last_write_time] > > diff --git a/libstdc++-v3/testsuite/lib/dg-options.exp b/libstdc++-v3/testsuite/lib/dg-options.exp > index 81bb8f448bd44..b61c4c0cb8fcd 100644 > --- a/libstdc++-v3/testsuite/lib/dg-options.exp > +++ b/libstdc++-v3/testsuite/lib/dg-options.exp > @@ -259,6 +259,15 @@ proc dg-require-target-fs-space { args } { > return > } > > +proc dg-require-target-fs-lwt { args } { > + if { ![ check_v3_target_fs_last_write_time ] } { > + upvar dg-do-what dg-do-what > + set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] > + return > + } > + return > +} > + > proc add_options_for_no_pch { flags } { > # This forces any generated and possibly included PCH to be invalid. > return "-D__GLIBCXX__=99999999" > diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp > index 22fdde8d66374..ca515c6f3548b 100644 > --- a/libstdc++-v3/testsuite/lib/libstdc++.exp > +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp > @@ -1286,6 +1286,14 @@ proc check_v3_target_fs_space { } { > return [v3_check_preprocessor_condition fs_space $cond $inc] > } > > +# Return 1 if the libstdc++ filesystem implementation of > +# last_write_time is not an always-failing dummy. > +proc check_v3_target_fs_last_write_time { } { > + set inc "#include " > + set cond "!defined NO_LAST_WRITE_TIME" > + return [v3_check_preprocessor_condition fs_last_write_time $cond $inc] > +} > + > # Return 1 if the "cxx11" ABI is in use using the current flags, 0 otherwise. > # Any flags provided by RUNTESTFLAGS or a target board will be used here. > # Flags added in the test by dg-options or dg-add-options will not be used. > diff --git a/libstdc++-v3/testsuite/util/testsuite_fs.h b/libstdc++-v3/testsuite/util/testsuite_fs.h > index 89042e5534139..037d9ffc0f429 100644 > --- a/libstdc++-v3/testsuite/util/testsuite_fs.h > +++ b/libstdc++-v3/testsuite/util/testsuite_fs.h > @@ -52,6 +52,11 @@ namespace test_fs = std::experimental::filesystem; > #define NO_SPACE > #endif > > +#if !(_GLIBCXX_HAVE_SYS_STAT_H \ > + && (_GLIBCXX_USE_UTIMENSAT || _GLIBCXX_USE_UTIME)) > +#define NO_LAST_WRITE_TIME 1 > +#endif > + > namespace __gnu_test > { > #define PATH_CHK(p1, p2, fn) \ > > > -- > Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ > Free Software Activist GNU Toolchain Engineer > Disinformation flourishes because many people care deeply about injustice > but very few check the facts. Ask me about >