libctf: skip the testsuite from inside dejagnu
authorNick Alcock <nick.alcock@oracle.com>
Mon, 14 Nov 2022 14:17:55 +0000 (14:17 +0000)
committerNick Alcock <nick.alcock@oracle.com>
Thu, 12 Jan 2023 14:40:47 +0000 (14:40 +0000)
commite2dc08c6f0642ca2c94e91997a8d4e971bea9971
treeaf771a6eab4dba0169074df0a0479d6d43498c57
parent5e8b4bbcc8593e1f1f81c4fd3562d637a07ee0cc
libctf: skip the testsuite from inside dejagnu

The libctf testsuite uses Tcl try/catch to trap run_output errors.  This
is only supported in reasonably recent Tcls, so we detect the lack of
try/catch and suppress the testsuite via an Automake conditional in its
absence.

But this turns out not to work: Automake produces a check-DEJAGNU target
regardless of the value of this conditional and sticks it in an
unconditionally-executed part of the makefile, so the testsuite gets
executed anyway, and fails with a nasty-looking syntax error.  We can't
disable it by taking "dejagnu" out of AUTOMAKE_OPTIONS, because if you
do that Automake stops you using RUNTEST, RUNTESTFLAGS and other
variables users would expect to work.

So move to disabling the testsuite from inside the testsuite itself,
importing the value of the former Automake conditional as a Tcl variable
and exiting very early in default.exp if it's false.

* configure.ac (TCL_TRY): No longer an Automake conditional.
Rename to...
(HAVE_TCL_TRY): ... this.
* Makefile.am: Drop TCL_TRY.
(development.exp): Set have_tcl_try.
* testsuite/config/default.exp: Exit if have_tcl_try is false.

* configure: Regenerated.
* Makefile.in: Likewise.
libctf/Makefile.am
libctf/Makefile.in
libctf/configure
libctf/configure.ac
libctf/testsuite/config/default.exp