* gnulib-tool: Support --import with just a few tests, not --with-tests
@ 2019-02-15 20:32 Bruno Haible
0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2019-02-15 20:32 UTC (permalink / raw)
To: bug-gnulib
Sometimes it is useful to have, in your package, only a few hand-picked
tests, not all tests in the transitive closure of the imported gnulib modules.
For example, when the package creates a library with a limited set of
exported symbols, most gnulib tests would access symbols that are not
exported from the library.
Using --avoid would be too unmaintainable, since the set of tests computed
by the transitive closure algorithm is subject to change without notice.
This patch implements this possibility.
2019-02-15 Bruno Haible <bruno@clisp.org>
gnulib-tool: Support --import with just a few tests, not --with-tests.
* gnulib-tool (func_import): New variable 'gentests'. Use it instead of
'inctests' when generating files; use 'inctests' only for computing the
transitive closure.
diff --git a/gnulib-tool b/gnulib-tool
index 3dc9a1d..34d198f 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -5107,6 +5107,14 @@ s,^\(.................................................[^ ]*\) *,
s,^top/,$rewritten,
s,^$rewritten,,"
+ # Determine whether to put anything into $testsbase.
+ testsfiles=`echo "$files" | sed -n -e 's,^tests/,,p' -e 's,^tests=lib/,,p'`
+ if test -n "$testsfiles"; then
+ gentests=true
+ else
+ gentests=false
+ fi
+
# Create directories.
{ echo "$sourcebase"
echo "$m4base"
@@ -5117,7 +5125,7 @@ s,^\(.................................................[^ ]*\) *,
if test -n "$docfiles"; then
echo "$docbase"
fi
- if $inctests; then
+ if $gentests; then
echo "$testsbase"
fi
echo "$auxdir"
@@ -5412,7 +5420,7 @@ s,//*$,/,'
&& ! { test -f "${destdir}/${dir1}Makefile.am" \
|| test "${dir1}Makefile.am" = "$sourcebase/$makefile_am" \
|| test "./${dir1}Makefile.am" = "$sourcebase/$makefile_am" \
- || { $inctests \
+ || { $gentests \
&& { test "${dir1}Makefile.am" = "$testsbase/$makefile_am" \
|| test "./${dir1}Makefile.am" = "$testsbase/$makefile_am"; }; }; }; do
dir2=`echo "$dir1" | sed -e "$sed_last"`"$dir2"
@@ -5833,7 +5841,7 @@ s,//*$,/,'
fi
fi
- if $inctests; then
+ if $gentests; then
# Create tests makefile.
func_dest_tmpfilename $testsbase/$makefile_am
destfile="$testsbase/$makefile_am"
@@ -6021,7 +6029,7 @@ s,//*$,/,'
if test -n "$pobase"; then
echo " - add \"$pobase/Makefile.in\" to AC_CONFIG_FILES in $configure_ac,"
fi
- if $inctests; then
+ if $gentests; then
if test "$makefile_am" = Makefile.am; then
echo " - add \"$testsbase/Makefile\" to AC_CONFIG_FILES in $configure_ac,"
else
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-02-15 20:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-15 20:32 gnulib-tool: Support --import with just a few tests, not --with-tests Bruno Haible
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).