Skip to content

Commit 9905e80

Browse files
committed
t5329: notice a failure within a loop
We try to write "|| return 1" (or "|| exit 1" in a subshell) at the end of a sequence of &&-chained command in a loop of our tests, so that a failure of any step during the earlier iteration of the loop can properly be caught. There is one loop in this test script that is used to compute the expected result, that will be later compared with an actual output produced by the "test-tool pack-mtimes" command. This particular loop, however, is placed on the upstream side of a pipe, whose non-zero exit code does not get noticed. Emit a line that will never be produced by the "test-tool pack-mtimes" to cause the later comparison to fail. As we use test_cmp to compare this "expected output" file with the "actual output", the "error message" we are emitting into the expected output stream will stand out and shown to the tester. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0e66bc1 commit 9905e80

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

t/t5329-pack-objects-cruft.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ basic_cruft_pack_tests () {
2929
while read oid
3030
do
3131
path="$objdir/$(test_oid_to_path "$oid")" &&
32-
printf "%s %d\n" "$oid" "$(test-tool chmtime --get "$path")" || exit 1
32+
printf "%s %d\n" "$oid" "$(test-tool chmtime --get "$path")" ||
33+
echo "object list generation failed for $oid"
3334
done |
3435
sort -k1
3536
) >expect &&

0 commit comments

Comments
 (0)