changeset 40185:a7fe9f54c3df

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.
author Bruno Haible <bruno@clisp.org>
date Fri, 15 Feb 2019 21:27:44 +0100
parents 7f0ac0398fae
children 8964917f9574
files ChangeLog gnulib-tool
diffstat 2 files changed, 19 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Feb 14 20:50:57 2019 +0100
+++ b/ChangeLog	Fri Feb 15 21:27:44 2019 +0100
@@ -1,3 +1,10 @@
+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.
+
 2019-02-14  Bruno Haible  <bruno@clisp.org>
 
 	gnulib-tool: Improve handling of multiple --local-dir options.
--- a/gnulib-tool	Thu Feb 14 20:50:57 2019 +0100
+++ b/gnulib-tool	Fri Feb 15 21:27:44 2019 +0100
@@ -5107,6 +5107,14 @@
     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 @@
     if test -n "$docfiles"; then
       echo "$docbase"
     fi
-    if $inctests; then
+    if $gentests; then
       echo "$testsbase"
     fi
     echo "$auxdir"
@@ -5412,7 +5420,7 @@
           && ! { 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 @@
     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 @@
   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