]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool: Support --import with just a few tests, not --with-tests.
authorBruno Haible <bruno@clisp.org>
Fri, 15 Feb 2019 20:27:44 +0000 (21:27 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 15 Feb 2019 20:27:44 +0000 (21:27 +0100)
* gnulib-tool (func_import): New variable 'gentests'. Use it instead of
'inctests' when generating files; use 'inctests' only for computing the
transitive closure.

ChangeLog
gnulib-tool

index 4a69f01c0b61a10aa0d5f79e84c2eeffee77e04d..64e9acf69e744017534e21fce03e83666d4dbb0d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index 3dc9a1de7735673889b25bb4c45685a5c8c4a893..34d198f6d7fc972a85997b46ab18f452318526f2 100755 (executable)
@@ -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