]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool: In --megatestdir mode, stop when there is an error.
authorBruno Haible <bruno@clisp.org>
Wed, 8 May 2024 08:55:43 +0000 (10:55 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 8 May 2024 08:55:43 +0000 (10:55 +0200)
* gnulib-tool.sh (megatest): Fail when one of the 'configure' or 'make'
steps fails.
* pygnulib/main.py (main): Likewise.

ChangeLog
gnulib-tool.sh
pygnulib/main.py

index 6d74b450bc5033f228550be3ba3a6a205d7776d2..fa78ed6a805cda1b4a88643e35d802a5ccf1c466 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-05-08  Bruno Haible  <bruno@clisp.org>
+
+       gnulib-tool: In --megatestdir mode, stop when there is an error.
+       * gnulib-tool.sh (megatest): Fail when one of the 'configure' or 'make'
+       steps fails.
+       * pygnulib/main.py (main): Likewise.
+
 2024-05-08  Collin Funk  <collin.funk1@gmail.com>
 
        gnulib-tool.py: Fix behavior of --test when a subprocess fails.
index 521d16e47ae11a370acb4fe67bf71c87f28e6c27..b5aadcaeaa39c632843e0a0d9e8ccfabe1caf295 100755 (executable)
@@ -7501,10 +7501,10 @@ s/\([.*$]\)/[\1]/g'
     cd "$destdir"
       mkdir build
       cd build
-        ../configure
-        $MAKE
-        $MAKE check
-        $MAKE distclean
+        ../configure || func_exit 1
+        $MAKE || func_exit 1
+        $MAKE check || func_exit 1
+        $MAKE distclean || func_exit 1
         remaining=`find . -type f -print`
         if test -n "$remaining"; then
           echo "Remaining files:" $remaining 1>&2
index 128f25f9c1e5df8537224a0e823dba70db735f18..8462916653905d43127f812558cc9c9b428ee2fb 100644 (file)
@@ -1130,10 +1130,13 @@ def main(temp_directory: str) -> None:
         os.chdir(destdir)
         os.mkdir('build')
         os.chdir('build')
-        sp.call(['../configure'])
-        sp.call([UTILS['make']])
-        sp.call([UTILS['make'], 'check'])
-        sp.call([UTILS['make'], 'distclean'])
+        try:  # Try to execute commands
+            sp.run(['../configure'], check=True)
+            sp.run([UTILS['make']], check=True)
+            sp.run([UTILS['make'], 'check'], check=True)
+            sp.run([UTILS['make'], 'distclean'], check=True)
+        except Exception:
+            sys.exit(1)
         args = ['find', '.', '-type', 'f', '-print']
         remaining = sp.check_output(args).decode(ENCS['shell'])
         lines = [ line.strip()