[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/t/test_utils.pl (close_files): add a note ex
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/t/test_utils.pl (close_files): add a note explaining why this function is unlikely to be called. Die if a file could not be closed. |
Date: |
Wed, 10 Apr 2024 15:30:29 -0400 |
This is an automated email from the git hooks/post-receive script.
pertusus pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new ea88d5e718 * tp/t/test_utils.pl (close_files): add a note explaining
why this function is unlikely to be called. Die if a file could not be closed.
ea88d5e718 is described below
commit ea88d5e718e63c2baa756e192953ccaaa0f84ce1
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Apr 10 21:29:56 2024 +0200
* tp/t/test_utils.pl (close_files): add a note explaining why this
function is unlikely to be called. Die if a file could not be closed.
---
ChangeLog | 5 +++++
tp/t/test_utils.pl | 6 +++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 94b3ff03da..9b26460abc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-04-10 Patrice Dumas <pertusus@free.fr>
+
+ * tp/t/test_utils.pl (close_files): add a note explaining why this
+ function is unlikely to be called. Die if a file could not be closed.
+
2024-04-10 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Report.pm (new): remove the possibility to reuse an
diff --git a/tp/t/test_utils.pl b/tp/t/test_utils.pl
index bdd8d7b78f..26c47f7af5 100644
--- a/tp/t/test_utils.pl
+++ b/tp/t/test_utils.pl
@@ -487,6 +487,8 @@ sub set_converter_option_defaults($$;$)
return $converter_options;
}
+# NOTE this function is unlikely to be called, as files are closed in
+# converters except for STDOUT, but in the tests the output is not to STDOUT.
sub close_files($)
{
my $converter = shift;
@@ -494,13 +496,15 @@ sub close_files($)
= Texinfo::Common::output_files_unclosed_files(
$converter->output_files_information());
if ($converter_unclosed_files) {
+ my $close_error_nr = 0;
foreach my $unclosed_file (keys(%$converter_unclosed_files)) {
if (!close($converter_unclosed_files->{$unclosed_file})) {
- # FIXME or die?
warn(sprintf("tp_utils.pl: error on closing %s: %s\n",
$converter_unclosed_files->{$unclosed_file}, $!));
+ $close_error_nr++;
}
}
+ die if ($close_error_nr > 0);
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/t/test_utils.pl (close_files): add a note explaining why this function is unlikely to be called. Die if a file could not be closed.,
Patrice Dumas <=