* pygnulib/constants.py (force_output): New function.
(execute): Flush stdout after printing the "executing ..." line.
* pygnulib/GLTestDir.py (GLTestDir.execute, GLMegaTestDir.execute):
Invoke force_output.
* pygnulib/main.py (test, megatest): Likewise.
+2024-03-24 Bruno Haible <bruno@clisp.org>
+
+ gnulib-tool.py: Bring the output into the right order.
+ * pygnulib/constants.py (force_output): New function.
+ (execute): Flush stdout after printing the "executing ..." line.
+ * pygnulib/GLTestDir.py (GLTestDir.execute, GLMegaTestDir.execute):
+ Invoke force_output.
+ * pygnulib/main.py (test, megatest): Likewise.
+
2024-03-24 Bruno Haible <bruno@clisp.org>
nstrtime, c-nstrftime: Fix %c directive's result on glibc ≤ 2.30.
# Create autogenerated files.
# Do not use "${AUTORECONF} --force --install", because it may invoke
# autopoint, which brings in older versions of some of our .m4 files.
+ constants.force_output()
os.chdir(self.testdir)
# gettext
if isfile(joinpath(m4base, 'gettext.m4')):
os.chdir(self.testdir)
if distributed_built_sources or tests_distributed_built_sources:
+ constants.force_output()
sp.call('./configure')
if distributed_built_sources:
os.chdir(sourcebase)
file.write(emit)
# Create autogenerated files.
+ constants.force_output()
os.chdir(self.megatestdir)
args = [UTILS['aclocal']]
constants.execute(args, verbose)
#===============================================================================
# Define global functions
#===============================================================================
+
+def force_output():
+ '''This function is to be invoked before invoking external programs.
+ It initiates bringing the the contents of process-internal output buffers
+ to their respective destinations.'''
+ sys.stdout.flush()
+ sys.stderr.flush()
+
+
def execute(args, verbose):
'''Execute the given shell command.'''
if verbose >= 0:
- print("executing %s" % ' '.join(args))
+ print("executing %s" % ' '.join(args), flush=True)
try: # Try to run
retcode = sp.call(args)
except Exception as error:
config.setAuxDir(auxdir)
testdir = classes.GLTestDir(config, destdir)
testdir.execute()
+ constants.force_output()
os.chdir(destdir)
os.mkdir('build')
os.chdir('build')
config.setAuxDir(auxdir)
testdir = classes.GLMegaTestDir(config, destdir)
testdir.execute()
+ constants.force_output()
os.chdir(destdir)
os.mkdir('build')
os.chdir('build')