On Wed, 18 Feb 2026 at 23:43, Jakub Jelinek <[email protected]> wrote:
>
> On Wed, Feb 18, 2026 at 10:52:13PM +0000, Jonathan Wakely wrote:
> > > Shouldn't that be excluded in case RUNTESTFLAGS variable contains any word
> > > ending with .exp ?
> > > I mean for quick testing of a single testcase with
> > > make check RUNTESTFLAGS=conformance.exp=something/that.cc
> > > every additional overhead counts (and there is already some).
> > > Unless check-abi quickly skips it in that case already.
> >
> > check-abi is simply:
> >
> > check-abi: site.exp baseline_symbols
> > -@runtest $(AM_RUNTESTFLAGS) --tool libstdc++ $(RUNTESTFLAGS) abi.exp
> >
> > So yes, with e.g. RUNTESTFLAGS=conformance.exp it means that the "just
> > run abi.exp" step will actually run both abi.exp and conformance.exp,
> > which would run the whole testsuite twice.
> >
> > So we could do this instead:
> >
> > check-am:
> > GLIBCXX_TESTSUITE_STDS=modules runtest --tool libstdc++ abi.exp
> > $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
> >
> > This would run *only* abi.exp and wouldn't use RUNTESTFLAGS.
>
> But that will still do abi.exp testing even when somebody wants to test
> a single test in conformance.exp.
> I meant something like
> check-am:
> ifeq (,$(filter %.exp,$(subst =, ,$(RUNTESTFLAGS))))
> GLIBCXX_TESTSUITE_STDS=modules $(MAKE) $(AM_MAKEFLAGS) check-abi
> endif
> $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
> So, if you are testing with make check or
> make check RUNTESTFLAGS='--target_board=unix\{-m32,-m64\}'
> or something similar, it will test the check-abi with modules too,
> but if you are after a specific *.exp file or set of them, it won't.
I can't figure out how to get this to work, because automake thinks
the 'endif' is an automake conditional and so complains that there's
no matching 'if'.
I came up with this instead:
check-am:
@if [ $(words $(filter %.exp,$(subst =, ,$(RUNTESTFLAGS)))) -eq 0 ]; \
then \
GLIBCXX_TESTSUITE_STDS=modules $(MAKE) $(AM_MAKEFLAGS) check-abi ; \
fi
$(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
I used '$(words ...) -eq 0' instead of just checking if the string is
empty because any quote characters in the output of the $(filter ...)
can confuse the shell, e.g. for
make check 'RUNTESTFLAGS="conformance.exp=foo.cc"'
we split the string into "conformance.exp and foo.cc" and the
unmatched double quote on the first part confuses the shell.
Using $(words ...) means that Make processes the string and tells us
if there were any .exp files there.
But maybe it would be simpler to just compile std.cc unconditionally
in proc libstdc++_init, even if the testsuite doesn't need to use it.
>
> Jakub
>