On Thu, Feb 19, 2026 at 10:25:50PM +0000, Jonathan Wakely wrote:
> > 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.
Ah, in that case it could use
check-am:
$(if $(filter %.exp,$(subst =, ,$(RUNTESTFLAGS))),, \
GLIBCXX_TESTSUITE_STDS=modules $(MAKE) $(AM_MAKEFLAGS) check-abi;) \
$(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
Jakub