{"thread":{"id":"33812","subject":"[PATCH 4/4] coverage: build coverage-untested-functions by default","startedAt":"2013-05-13T21:27:24Z","lastAt":"2013-05-14T09:14:44Z","messageCount":8,"participants":["Thomas Rast","Junio C Hamano","Jens Lehmann"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"217235","messageId":"cover.1368479988.git.trast@inf.ethz.ch","threadId":"33812","inReplyTo":null,"subject":"[PATCH 0/4] Coverage support revisited","fromName":"Thomas Rast","fromEmail":"trast@inf.ethz.ch","sentAt":"2013-05-13T21:27:24Z","receivedAt":"2013-05-13T21:27:24Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Jens asked me at git-merge if coverage support was still available.\nTurns out it is, but there were some weirdnesses.  So this should fix\nthem.  It is reaaaally slow as you still have to run the tests one by\none; despite claims in the wild that it is multiprocess- safe but\nthread-unsafe, I am in fact observing the opposite behavior pretty\nclearly.  (As before, it switches to sequential tests automatically,\nso you have to edit the Makefile if you want to try with parallel\ntests.)\n\nBelow is the coverage-untested-functions output; it seems submodule.c\nis covered, so there is nothing for Jens to do ;-)\n\n\nThomas Rast (4):\n  coverage: split build target into compile and test\n  coverage: do not delete .gcno files before building\n  coverage: set DEFAULT_TEST_TARGET to avoid using prove\n  coverage: build coverage-untested-functions by default\n\n Makefile | 21 +++++++++++++--------\n 1 file changed, 13 insertions(+), 8 deletions(-)\n\n\n--- coverage-untested-functions ---\nalloc.c: report\nalloc.c: alloc_report\narchive-tar.c: write_extended_header\nattr.c: git_etc_gitattributes\nbuiltin#add.c: ignore_removal_cb\nbuiltin#apply.c: checkout_target\nbuiltin#apply.c: add_name_limit\nbuiltin#apply.c: option_parse_exclude\nbuiltin#apply.c: option_parse_include\nbuiltin#apply.c: option_parse_z\nbuiltin#blame.c: read_ancestry\nbuiltin#blame.c: sanity_check_refcnt\nbuiltin#blame.c: prepare_initial\nbuiltin#blame.c: blame_move_callback\nbuiltin#branch.c: calc_maxwidth\nbuiltin#checkout-index.c: option_parse_z\nbuiltin#clone.c: remove_junk_on_signal\nbuiltin#commit.c: find_author_by_nickname\nbuiltin#config.c: cmd_repo_config\nbuiltin#fetch.c: unlock_pack_on_signal\nbuiltin#fmt-merge-msg.c: add_branch_desc\nbuiltin#for-each-ref.c: copy_advance\nbuiltin#grep.c: help_callback\nbuiltin#help.c: parse_help_format\nbuiltin#help.c: get_man_viewer_info\nbuiltin#help.c: check_emacsclient_version\nbuiltin#help.c: exec_woman_emacs\nbuiltin#help.c: exec_man_konqueror\nbuiltin#help.c: exec_man_man\nbuiltin#help.c: exec_man_cmd\nbuiltin#help.c: add_man_viewer\nbuiltin#help.c: supported_man_viewer\nbuiltin#help.c: do_add_man_viewer_info\nbuiltin#help.c: add_man_viewer_path\nbuiltin#help.c: add_man_viewer_cmd\nbuiltin#help.c: add_man_viewer_info\nbuiltin#help.c: git_help_config\nbuiltin#help.c: is_git_command\nbuiltin#help.c: prepend\nbuiltin#help.c: cmd_to_page\nbuiltin#help.c: setup_man_path\nbuiltin#help.c: exec_viewer\nbuiltin#help.c: show_man_page\nbuiltin#help.c: show_info_page\nbuiltin#help.c: get_html_page_path\nbuiltin#help.c: open_html\nbuiltin#help.c: show_html_page\nbuiltin#help.c: list_common_guides_help\nbuiltin#help.c: cmd_help\nbuiltin#index-pack.c: delta_pos_compare\nbuiltin#log.c: estimate_commit_count\nbuiltin#log.c: show_early_header\nbuiltin#log.c: log_show_early\nbuiltin#log.c: early_output\nbuiltin#log.c: setup_early_output\nbuiltin#log.c: finish_early_output\nbuiltin#log.c: no_numbered_callback\nbuiltin#log.c: header_callback\nbuiltin#mailsplit.c: populate_maildir_list\nbuiltin#mailsplit.c: maildir_filename_cmp\nbuiltin#mailsplit.c: split_maildir\nbuiltin#merge-base.c: handle_is_ancestor\nbuiltin#merge.c: reset_hard\nbuiltin#merge.c: setup_with_upstream\nbuiltin#pack-objects.c: pbase_tree_cache_ix_incr\nbuiltin#pack-objects.c: try_to_free_from_threads\nbuiltin#pack-objects.c: mark_in_pack_object\nbuiltin#pack-objects.c: ofscmp\nbuiltin#pack-objects.c: add_objects_in_unpacked_packs\nbuiltin#pack-objects.c: option_parse_ulong\nbuiltin#pack-redundant.c: llist_item_put\nbuiltin#pack-redundant.c: llist_item_get\nbuiltin#pack-redundant.c: llist_free\nbuiltin#pack-redundant.c: llist_init\nbuiltin#pack-redundant.c: llist_copy\nbuiltin#pack-redundant.c: llist_insert\nbuiltin#pack-redundant.c: llist_insert_back\nbuiltin#pack-redundant.c: llist_insert_sorted_unique\nbuiltin#pack-redundant.c: llist_sorted_remove\nbuiltin#pack-redundant.c: llist_sorted_difference_inplace\nbuiltin#pack-redundant.c: pack_list_insert\nbuiltin#pack-redundant.c: pack_list_size\nbuiltin#pack-redundant.c: pack_list_difference\nbuiltin#pack-redundant.c: cmp_two_packs\nbuiltin#pack-redundant.c: pll_free\nbuiltin#pack-redundant.c: get_permutations\nbuiltin#pack-redundant.c: is_superset\nbuiltin#pack-redundant.c: sizeof_union\nbuiltin#pack-redundant.c: get_pack_redundancy\nbuiltin#pack-redundant.c: pack_set_bytecount\nbuiltin#pack-redundant.c: minimize\nbuiltin#pack-redundant.c: load_all_objects\nbuiltin#pack-redundant.c: cmp_local_packs\nbuiltin#pack-redundant.c: scan_alt_odb_packs\nbuiltin#pack-redundant.c: add_pack\nbuiltin#pack-redundant.c: add_pack_file\nbuiltin#pack-redundant.c: load_all\nbuiltin#pack-redundant.c: cmd_pack_redundant\nbuiltin#push.c: advise_use_upstream\nbuiltin#push.c: advise_checkout_pull_push\nbuiltin#push.c: advise_ref_needs_force\nbuiltin#read-tree.c: debug_stage\nbuiltin#read-tree.c: debug_merge\nbuiltin#reflog.c: find_cfg_ent\nbuiltin#remote-ext.c: send_git_request\nbuiltin#remote-fd.c: command_loop\nbuiltin#remote-fd.c: cmd_remote_fd\nbuiltin#rev-list.c: show_edge\nbuiltin#rev-list.c: print_var_str\nbuiltin#rev-list.c: print_var_int\nbuiltin#rev-list.c: show_bisect_vars\nbuiltin#rev-parse.c: anti_reference\nbuiltin#rev-parse.c: show_datestring\nbuiltin#send-pack.c: print_helper_status\nbuiltin#shortlog.c: compare_by_number\nbuiltin#shortlog.c: parse_uint\nbuiltin#show-branch.c: append_tag_ref\nbuiltin#show-branch.c: count_slash\nbuiltin#show-branch.c: append_matching_ref\nbuiltin#show-branch.c: parse_reflog_param\nbuiltin#show-ref.c: add_existing\nbuiltin#show-ref.c: exclude_existing\nbuiltin#show-ref.c: exclude_existing_callback\nbuiltin#show-ref.c: help_callback\nbuiltin#unpack-objects.c: add_delta_to_list\ncombine-diff.c: reuse_combine_diff\ncompat#terminal.c: restore_term_on_signal\ncompat#terminal.c: restore_term\ncompat#terminal.c: disable_echo\ncompat#terminal.c: git_terminal_prompt\nconfig.c: git_etc_gitconfig\nconfig.c: write_error\nconnect.c: enable_keepalive\nconnect.c: ai_name\nconnect.c: git_tcp_connect_sock\nconnect.c: git_tcp_connect\nconnect.c: get_port\ncredential-cache--daemon.c: cleanup_socket_on_signal\ndate.c: date_midnight\ndate.c: date_tea\ndiff.c: parse_algorithm_value\ndiff.c: remove_tempfile_on_signal\ndiffcore-order.c: prepare_order\ndiffcore-order.c: match_order\ndiffcore-order.c: compare_pair_order\ndiffcore-order.c: diffcore_order\ndir.c: strcmp_icase\nenvironment.c: have_git_dir\nexec_cmd.c: system_path\nexec_cmd.c: prepare_git_cmd\nexec_cmd.c: execv_git_cmd\nexec_cmd.c: execl_git_cmd\nfast-import.c: checkpoint_signal\nfetch-pack.c: clear_marks\nfsck.c: fsck_error_function\ngraph.c: column_get_color_code\ngrep.c: compile_pcre_regexp\ngrep.c: pcrematch\ngrep.c: free_pcre_regexp\ngrep.c: indent\ngrep.c: dump_grep_pat\ngrep.c: dump_grep_expression_1\ngrep.c: dump_grep_expression\nhelp.c: clean_cmdnames\nhelp.c: pretty_print_string_list\nhelp.c: list_commands\nhelp.c: git_unknown_cmd_config\nhelp.c: levenshtein_compare\nhelp.c: add_cmd_list\nhelp.c: help_unknown_cmd\nhttp-backend.c: inflate_request\nhttp-backend.c: die_webcgi\nhttp.c: fread_buffer\nhttp.c: ioctl_buffer\nhttp.c: fwrite_buffer\nhttp.c: fwrite_null\nhttp.c: process_curl_messages\nhttp.c: http_options\nhttp.c: init_curl_http_auth\nhttp.c: has_cert_password\nhttp.c: get_curl_handle\nhttp.c: set_from_env\nhttp.c: http_init\nhttp.c: http_cleanup\nhttp.c: get_active_slot\nhttp.c: start_active_slot\nhttp.c: add_fill_function\nhttp.c: fill_active_slots\nhttp.c: step_active_slots\nhttp.c: run_active_slot\nhttp.c: closedown_active_slot\nhttp.c: release_active_slot\nhttp.c: finish_active_slot\nhttp.c: finish_all_active_slots\nhttp.c: needs_quote\nhttp.c: quote_ref_url\nhttp.c: append_remote_object_url\nhttp.c: get_remote_object_url\nhttp.c: handle_curl_result\nhttp.c: http_request\nhttp.c: http_request_reauth\nhttp.c: http_get_strbuf\nhttp.c: http_get_file\nhttp.c: http_fetch_ref\nhttp.c: fetch_pack_index\nhttp.c: fetch_and_setup_pack_index\nhttp.c: http_get_info_packs\nhttp.c: release_http_pack_request\nhttp.c: finish_http_pack_request\nhttp.c: new_http_pack_request\nhttp.c: fwrite_sha1_file\nhttp.c: new_http_object_request\nhttp.c: process_http_object_request\nhttp.c: finish_http_object_request\nhttp.c: abort_http_object_request\nhttp.c: release_http_object_request\nhttp-push.c: xml_entities\nhttp-push.c: curl_setup_http_get\nhttp-push.c: curl_setup_http\nhttp-push.c: get_dav_token_headers\nhttp-push.c: process_response\nhttp-push.c: start_fetch_loose\nhttp-push.c: start_mkcol\nhttp-push.c: start_fetch_packed\nhttp-push.c: start_put\nhttp-push.c: start_move\nhttp-push.c: refresh_lock\nhttp-push.c: check_locks\nhttp-push.c: release_request\nhttp-push.c: finish_request\nhttp-push.c: fill_active_slot\nhttp-push.c: add_fetch_request\nhttp-push.c: add_send_request\nhttp-push.c: fetch_indices\nhttp-push.c: one_remote_object\nhttp-push.c: handle_lockprop_ctx\nhttp-push.c: handle_new_lock_ctx\nhttp-push.c: xml_start_tag\nhttp-push.c: xml_end_tag\nhttp-push.c: xml_cdata\nhttp-push.c: lock_remote\nhttp-push.c: unlock_remote\nhttp-push.c: remove_locks\nhttp-push.c: remove_locks_on_signal\nhttp-push.c: process_ls_object\nhttp-push.c: process_ls_ref\nhttp-push.c: handle_remote_ls_ctx\nhttp-push.c: remote_ls\nhttp-push.c: get_remote_object_list\nhttp-push.c: locking_available\nhttp-push.c: add_one_object\nhttp-push.c: process_blob\nhttp-push.c: process_tree\nhttp-push.c: get_delta\nhttp-push.c: update_remote\nhttp-push.c: one_remote_ref\nhttp-push.c: get_dav_remote_heads\nhttp-push.c: add_remote_info_ref\nhttp-push.c: update_remote_info_refs\nhttp-push.c: remote_exists\nhttp-push.c: fetch_symref\nhttp-push.c: verify_merge_base\nhttp-push.c: delete_remote_branch\nhttp-push.c: run_request_queue\nident.c: author_ident_sufficiently_given\nlevenshtein.c: levenshtein\nlockfile.c: remove_lock_file_on_signal\nlockfile.c: unable_to_lock_message\nlockfile.c: unable_to_lock_error\nlockfile.c: unable_to_lock_index_die\nlog-tree.c: add_graft_decoration\nlog-tree.c: show_parents\nlog-tree.c: show_children\nlog-tree.c: which_parent\nlog-tree.c: is_common_merge\nlog-tree.c: show_one_mergetag\nmerge-blobs.c: common_outf\nname-hash.c: remove_dir_entry\nname-hash.c: slow_same_name\nname-hash.c: free_dir_entry\nnotes.c: combine_notes_ignore\nobject.c: object_list_insert\nobject.c: object_list_contains\npager.c: wait_for_pager\npager.c: wait_for_pager_signal\nparse-options.c: optbug\npath.c: getpw_str\npath.c: daemon_avoid_alias\npkt-line.c: packet_read_line_buf\npreload-index.c: preload_thread\nprogress.c: progress_interval\nprompt.c: git_getpass\nquote.c: sq_dequote\nread-cache.c: different_name\nread-cache.c: create_alias_ce\nread-cache.c: expand_name_field\nrefs.c: for_each_branch_ref\nrefs.c: for_each_remote_ref\nrefs.c: ref_msg\nremote.c: remote_has_url\nrevision.c: prepare_show_merge\nrun-command.c: cleanup_children_on_signal\nrun-command.c: dup_devnull\nrun-command.c: run_command_v_opt_cd_env\nsha1_file.c: sha1_get_pack_name\nsha1_file.c: sha1_pack_name\nsha1_file.c: sha1_pack_index_name\nsha1_file.c: release_pack_memory\nsha1_file.c: try_to_free_pack_memory\nsha1_file.c: parse_pack_index\nsha1_file.c: write_pack_access_log\nsha1_file.c: has_pack_index\nsha1-lookup.c: sha1_entry_pos\nsh-i18n--envsubst.c: cmp_string\nstrbuf.c: strbuf_addstr_xml_quoted\nstrbuf.c: is_rfc3986_reserved\nstring-list.c: print_string_list\ntest-ctype.c: report_error\ntest-wildmatch.c: perf\ntransport.c: external_specification_len\ntransport-helper.c: xchgline\ntransport-helper.c: standard_options\ntransport-helper.c: fetch_with_fetch\ntransport-helper.c: connect_helper\ntransport-helper.c: push_refs_with_push\ntransport-helper.c: has_attribute\ntree.c: read_one_entry\ntree-walk.c: match_wildcard_base\nunix-socket.c: chdir_len\nunpack-trees.c: debug_path\nunpack-trees.c: debug_name_entry\nunpack-trees.c: debug_unpack_callback\nunpack-trees.c: verify_clean_submodule\nunpack-trees.c: icase_exists\nupload-pack.c: check_non_tip\nurl.c: str_end_url_with_slash\nutf8.c: is_utf8\nvarint.c: decode_varint\nvarint.c: encode_varint\nvcs-svn#fast_export.c: fast_export_truncate\nvcs-svn#fast_export.c: die_short_read\nvcs-svn#svndump.c: die_short_read\nwrapper.c: do_nothing\nwrapper.c: warn_on_inaccessible\nwrite_or_die.c: check_pipe\nxdiff#xhistogram.c: fall_back_to_classic_diff\nxdiff#xpatience.c: fall_back_to_classic_diff\nxdiff#xutils.c: xdl_fall_back_diff\nzlib.c: git_inflate_init_gzip_only\nzlib.c: git_deflate_init_gzip\n\n\n-- \n1.8.3.rc1.400.g07d6e4a\n"},{"id":"217234","messageId":"74a63334c1b7cd4c5bb43050dce256e125ca8c8b.1368479988.git.trast@inf.ethz.ch","threadId":"33812","inReplyTo":"cover.1368479988.git.trast@inf.ethz.ch","subject":"[PATCH 1/4] coverage: split build target into compile and test","fromName":"Thomas Rast","fromEmail":"trast@inf.ethz.ch","sentAt":"2013-05-13T21:27:25Z","receivedAt":"2013-05-13T21:27:25Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Confusingly, the coverage-build target in fact builds with gcov\nsupport _and runs tests_.\n\nSplit it into two targets that actually are named after what they do.\n\nSigned-off-by: Thomas Rast <trast@inf.ethz.ch>\n---\n Makefile | 8 +++++---\n 1 file changed, 5 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 0f931a2..f98296b 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2524,10 +2524,10 @@ check-builtins::\n \n ### Test suite coverage testing\n #\n-.PHONY: coverage coverage-clean coverage-build coverage-report\n+.PHONY: coverage coverage-clean coverage-compile coverage-test coverage-report\n \n coverage:\n-\t$(MAKE) coverage-build\n+\t$(MAKE) coverage-test\n \t$(MAKE) coverage-report\n \n object_dirs := $(sort $(dir $(OBJECTS)))\n@@ -2543,8 +2543,10 @@ COVERAGE_CFLAGS = $(CFLAGS) -O0 -ftest-coverage -fprofile-arcs\n COVERAGE_LDFLAGS = $(CFLAGS)  -O0 -lgcov\n GCOVFLAGS = --preserve-paths --branch-probabilities --all-blocks\n \n-coverage-build: coverage-clean\n+coverage-compile:\n \t$(MAKE) CFLAGS=\"$(COVERAGE_CFLAGS)\" LDFLAGS=\"$(COVERAGE_LDFLAGS)\" all\n+\n+coverage-test: coverage-clean-results coverage-compile\n \t$(MAKE) CFLAGS=\"$(COVERAGE_CFLAGS)\" LDFLAGS=\"$(COVERAGE_LDFLAGS)\" \\\n \t\t-j1 test\n \n-- \n1.8.3.rc1.400.g07d6e4a\n"},{"id":"217236","messageId":"13bcab7694a9aa4707845769cacea2128664e407.1368479988.git.trast@inf.ethz.ch","threadId":"33812","inReplyTo":"cover.1368479988.git.trast@inf.ethz.ch","subject":"[PATCH 2/4] coverage: do not delete .gcno files before building","fromName":"Thomas Rast","fromEmail":"trast@inf.ethz.ch","sentAt":"2013-05-13T21:27:26Z","receivedAt":"2013-05-13T21:27:26Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"The coverage-compile target depends on coverage-clean, which is\nsupposed to remove the earlier build products that would get in the\nway of the next coverage test run.\n\nHowever, removing *.gcno is actively wrong.  These are the files that\ncontain the compile-time coverage related data.  They are only rebuilt\nif the source is compiled.  So if one ran 'make coverage' two times in\na row, the second run would remove *.gcno, but then fail to recreate\nthem because neither source files nor build flags have changed.  (This\nremained hidden for so long most likely because any other intervening\nuse of 'make' will change the build flags, causing a full rebuild.)\n\nSo we make an exception for *.gcno.  The *.gcda are the coverage\nresults, written when the gcov-instrumented program is run.  We still\nremove those, so as to get a one-test-run view of the data; you could\nprobably argue the other way too.\n\nSigned-off-by: Thomas Rast <trast@inf.ethz.ch>\n---\n Makefile | 9 ++++++---\n 1 file changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex f98296b..99e4d09 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2443,7 +2443,7 @@ profile-clean:\n \t$(RM) $(addsuffix *.gcda,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))\n \t$(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))\n \n-clean: profile-clean\n+clean: profile-clean coverage-clean\n \t$(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o vcs-svn/*.o \\\n \t\tbuiltin/*.o $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB)\n \t$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X\n@@ -2525,20 +2525,23 @@ check-builtins::\n ### Test suite coverage testing\n #\n .PHONY: coverage coverage-clean coverage-compile coverage-test coverage-report\n+.PHONY: coverage-clean-results\n \n coverage:\n \t$(MAKE) coverage-test\n \t$(MAKE) coverage-report\n \n object_dirs := $(sort $(dir $(OBJECTS)))\n-coverage-clean:\n+coverage-clean-results:\n \t$(RM) $(addsuffix *.gcov,$(object_dirs))\n \t$(RM) $(addsuffix *.gcda,$(object_dirs))\n-\t$(RM) $(addsuffix *.gcno,$(object_dirs))\n \t$(RM) coverage-untested-functions\n \t$(RM) -r cover_db/\n \t$(RM) -r cover_db_html/\n \n+coverage-clean: coverage-clean-results\n+\t$(RM) $(addsuffix *.gcno,$(object_dirs))\n+\n COVERAGE_CFLAGS = $(CFLAGS) -O0 -ftest-coverage -fprofile-arcs\n COVERAGE_LDFLAGS = $(CFLAGS)  -O0 -lgcov\n GCOVFLAGS = --preserve-paths --branch-probabilities --all-blocks\n-- \n1.8.3.rc1.400.g07d6e4a\n"},{"id":"217237","messageId":"f27a438797cf249ccc3621a580653ea1827033f6.1368479988.git.trast@inf.ethz.ch","threadId":"33812","inReplyTo":"cover.1368479988.git.trast@inf.ethz.ch","subject":"[PATCH 3/4] coverage: set DEFAULT_TEST_TARGET to avoid using prove","fromName":"Thomas Rast","fromEmail":"trast@inf.ethz.ch","sentAt":"2013-05-13T21:27:27Z","receivedAt":"2013-05-13T21:27:27Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"If the user sets DEFAULT_TEST_TARGET=prove in his config.mak, that\ncarries over into the coverage tests.  Which is really bad if he also\nsets GIT_PROVE_OPTS=-j<..> as that completely breaks the coverage\nruns.\n\nInstead of attempting to mess with the GIT_PROVE_OPTS, just force the\ntest target to 'test' so that we run under make, like we intended all\nalong.\n\nSigned-off-by: Thomas Rast <trast@inf.ethz.ch>\n---\n Makefile | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex 99e4d09..153d24d 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2551,7 +2551,7 @@ coverage-compile:\n \n coverage-test: coverage-clean-results coverage-compile\n \t$(MAKE) CFLAGS=\"$(COVERAGE_CFLAGS)\" LDFLAGS=\"$(COVERAGE_LDFLAGS)\" \\\n-\t\t-j1 test\n+\t\tDEFAULT_TEST_TARGET=test -j1 test\n \n coverage-report:\n \t$(QUIET_GCOV)for dir in $(object_dirs); do \\\n-- \n1.8.3.rc1.400.g07d6e4a\n"},{"id":"217233","messageId":"4669d2876582766465ea069bb29f36ac6e4a1380.1368479988.git.trast@inf.ethz.ch","threadId":"33812","inReplyTo":"cover.1368479988.git.trast@inf.ethz.ch","subject":"[PATCH 4/4] coverage: build coverage-untested-functions by default","fromName":"Thomas Rast","fromEmail":"trast@inf.ethz.ch","sentAt":"2013-05-13T21:27:28Z","receivedAt":"2013-05-13T21:27:28Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Change the 'coverage' target to build coverage-untested-functions by\ndefault, so as to make it more discoverable.\n\nSigned-off-by: Thomas Rast <trast@inf.ethz.ch>\n---\n Makefile | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex 153d24d..6f9d1c7 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2529,7 +2529,7 @@ check-builtins::\n \n coverage:\n \t$(MAKE) coverage-test\n-\t$(MAKE) coverage-report\n+\t$(MAKE) coverage-untested-functions\n \n object_dirs := $(sort $(dir $(OBJECTS)))\n coverage-clean-results:\n-- \n1.8.3.rc1.400.g07d6e4a\n"},{"id":"217243","messageId":"7vk3n2le85.fsf@alter.siamese.dyndns.org","threadId":"33812","inReplyTo":"cover.1368479988.git.trast@inf.ethz.ch","subject":"Re: [PATCH 0/4] Coverage support revisited","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-05-13T22:14:18Z","receivedAt":"2013-05-13T22:14:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Rast <trast@inf.ethz.ch> writes:\n\n> Below is the coverage-untested-functions output; it seems submodule.c\n> is covered, so there is nothing for Jens to do ;-)\n\nNice.\n\nHere are some hints to add coverages to the selected functions.\n\n> alloc.c: report\n> alloc.c: alloc_report\n\nI believe these are only for debugging.\n\n> archive-tar.c: write_extended_header\n\nNeed to create an archive that contains loong pathname (iirc, over\n100 bytes) in the test.\n\n> attr.c: git_etc_gitattributes\n> builtin#add.c: ignore_removal_cb\n\n\"--ignore-removal\" option parsing.\n\n> builtin#apply.c: checkout_target\n\nTry \"git apply --index\" to an empty working tree with a valid index.\n\n> builtin#apply.c: add_name_limit\n> builtin#apply.c: option_parse_exclude\n> builtin#apply.c: option_parse_include\n\n\"git apply --exclude/include\".\n\n> builtin#apply.c: option_parse_z\n\n\"git apply --stat -z\".\n\n> builtin#blame.c: read_ancestry\n\n\"git blame -S<file>\".\n\n> builtin#blame.c: sanity_check_refcnt\n\nOnly used for debugging.\n\n> builtin#blame.c: prepare_initial\n\n\"git blame --reverse\".\n\n> builtin#blame.c: blame_move_callback\n\n\"git blame -M\" (option parsing).\n\n> varint.c: decode_varint\n> varint.c: encode_varint\n\n\"git update-index --index-version 4\" and then read from the\nresulting index.\n"},{"id":"217244","messageId":"51916A2B.3060001@web.de","threadId":"33812","inReplyTo":"cover.1368479988.git.trast@inf.ethz.ch","subject":"Re: [PATCH 0/4] Coverage support revisited","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2013-05-13T22:33:15Z","receivedAt":"2013-05-13T22:33:15Z","isPatch":true,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 13.05.2013 23:27, schrieb Thomas Rast:\n> Jens asked me at git-merge if coverage support was still available.\n> Turns out it is, but there were some weirdnesses.  So this should fix\n> them.  It is reaaaally slow as you still have to run the tests one by\n> one; despite claims in the wild that it is multiprocess- safe but\n> thread-unsafe, I am in fact observing the opposite behavior pretty\n> clearly.  (As before, it switches to sequential tests automatically,\n> so you have to edit the Makefile if you want to try with parallel\n> tests.)\n\nThx! That might explain why the coverage run I tried today didn't\nwork (I saw bogus test failures).\n\n> Below is the coverage-untested-functions output; it seems submodule.c\n> is covered, so there is nothing for Jens to do ;-)\n\nHehe, I kinda expected that part ;-)\n\n> unpack-trees.c: verify_clean_submodule\n\nThis is the one I was after. While discussing my recursive update\ncode with Peff on Saturday we wondered if that function would ever\nbe called. I'll check if the tests are missing some relevant cases,\nif that function can be removed or some refactoring is necessary.\n\nHmm, while function coverage is already extremely useful me thinks\nlcov support would be really nice. We'd have line and branch coverage,\nwhich help me a lot in finding dead code and missing tests at $DAYJOB\n... will look into that when I have the recursive update ready.\n"},{"id":"217323","messageId":"87k3n16hyz.fsf@linux-k42r.v.cablecom.net","threadId":"33812","inReplyTo":"51916A2B.3060001@web.de","subject":"Re: [PATCH 0/4] Coverage support revisited","fromName":"Thomas Rast","fromEmail":"trast@inf.ethz.ch","sentAt":"2013-05-14T09:14:44Z","receivedAt":"2013-05-14T09:14:44Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Jens Lehmann <Jens.Lehmann@web.de> writes:\n\n> Am 13.05.2013 23:27, schrieb Thomas Rast:\n>> Jens asked me at git-merge if coverage support was still available.\n>> Turns out it is, but there were some weirdnesses.  So this should fix\n>> them.  It is reaaaally slow as you still have to run the tests one by\n>> one; despite claims in the wild that it is multiprocess- safe but\n>> thread-unsafe, I am in fact observing the opposite behavior pretty\n>> clearly.  (As before, it switches to sequential tests automatically,\n>> so you have to edit the Makefile if you want to try with parallel\n>> tests.)\n>\n> Thx! That might explain why the coverage run I tried today didn't\n> work (I saw bogus test failures).\n\nIndeed it does.  I should have mentioned it in the cover letter; it's\nfixed by this series but if you set DEFAULT_TEST_TARGET=prove like\neveryone else, it ignored the (existing) force-to-sequential rule.\n\n>> unpack-trees.c: verify_clean_submodule\n>\n> This is the one I was after. While discussing my recursive update\n> code with Peff on Saturday we wondered if that function would ever\n> be called. I'll check if the tests are missing some relevant cases,\n> if that function can be removed or some refactoring is necessary.\n>\n> Hmm, while function coverage is already extremely useful me thinks\n> lcov support would be really nice. We'd have line and branch coverage,\n> which help me a lot in finding dead code and missing tests at $DAYJOB\n> ... will look into that when I have the recursive update ready.\n\nActually if you run it, it generates submodule.c.gcov as an intermediate\nstep to the uncovered-functions list.  Of course you can also use any\nother tool that can read gcov; the results are cleaned before the run,\nnot after, so they will remain in place.\n\nOriginally I hacked together an uncovered-functions list because that\nlist was so long that looking at things in even more detail seemed\nextremely pointless.\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"}]}