]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t0500-progress-display.sh
upload-pack: move allow_unadvertised_object_request to upload_pack_data
[thirdparty/git.git] / t / t0500-progress-display.sh
index d2d088d9a0c31752739e1fdb118677278aabaf4f..1ed1df351cb178562d21ab204f2b5c85d3206ba2 100755 (executable)
@@ -283,4 +283,30 @@ test_expect_success 'cover up after throughput shortens a lot' '
        test_i18ncmp expect out
 '
 
+test_expect_success 'progress generates traces' '
+       cat >in <<-\EOF &&
+       throughput 102400 1000
+       update
+       progress 10
+       throughput 204800 2000
+       update
+       progress 20
+       throughput 307200 3000
+       update
+       progress 30
+       throughput 409600 4000
+       update
+       progress 40
+       EOF
+
+       GIT_TRACE2_EVENT="$(pwd)/trace.event" test-tool progress --total=40 \
+               "Working hard" <in 2>stderr &&
+
+       # t0212/parse_events.perl intentionally omits regions and data.
+       grep -e "region_enter" -e "\"category\":\"progress\"" trace.event &&
+       grep -e "region_leave" -e "\"category\":\"progress\"" trace.event &&
+       grep "\"key\":\"total_objects\",\"value\":\"40\"" trace.event &&
+       grep "\"key\":\"total_bytes\",\"value\":\"409600\"" trace.event
+'
+
 test_done