Skip to content

Tweaking the gcov utility for specialized coverage

Notifications You must be signed in to change notification settings

mgrundy/mcc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gcovModified

##Instructions to run##

###Copy updated gcov files###

cp gcov.c /local/build/gcc-4.9.0/gcc/
cp gcov-io.c /local/build/gcc-4.9.0/gcc/
cp gcov-io.h /local/build/gcc-4.9.0/gcc/

###Configure gcc###

./configure --disable-multilib --disable-werror

###Build gcc###

make j4

###Run gcov on gcda files###

for la in $(find -name \*.gcda); do <path_to_gcov> -i $la; done

###Set up mongod with SSL connection###

###Add indexes to data collection###

db.<collection>.ensureIndex({"build_id": 1, "git_hash": 1, "file": 1})

db.<collection>.ensureIndex({"build_id": 1, "git_hash": 1})

db.<collection>.ensureIndex({"build_id": 1, "git_hash": 1, "test_name": 1, "file": 1})

db.<collection>.ensureIndex({"build_id": 1, "dir":1})

db.<collection>.ensureIndex({"build_id": 1, "file":1})

###Set up config file for web app### mongo-cc.py expects a config file entitled config.conf in the directory from which mongo-cc.py is run. The file must contain a dictionary with the following information:

{"hostname": <host_name>, 
 "database": <database_name>, 
 "collection": <main_collection>, 
 "covCollection": <directory_aggregates_collection>, 
 "port": <mongod_port_number>, 
 "client_pem": <path_to_client_pem>, 
 "ca_file": <path_to_ca_file>, 
 "username": <ssl_username>, 
 "httpport": <http_port_number>, 
 "metaCollection": <meta_info_collection>, 
 "github_token": <github_token>}

Note that the information must be entirely in one line.

###Run web app###

python <path_to_mongo-cc.py> &

###Run import program###

python <path_to_mcc-import.py> -b <build_id> -g <git_hash> -c <connection_url> -t <test_name> -a <branch_name> -p <platform_name> -r <root_directory> -d <build_date>

##General Info##

gcovModified is an easily extensible code coverage utility intended for integration with MongoDB's build system. It stores and displays coverage information obtained from gcc's code coverage utility gcov. It allows users to filter their coverage results by test suite. Additionally, users can use the build comparison feature to determine the coverage changes between two revisions of the source.

The source of the program consists of several components:

  • mongo-cc.py (the web app component)
  • mcc-import.py (the data import program)
  • gcov.c (the modified gcov source from gcc 4.9.0)
  • gcov-io.c/gcov-io.h (updated gcov files containing helper functions for coverage display)

System information can be found in the requirements.txt file.

##To do##

  • Add option in mcc-import.py to specify pattern of file names to import.
  • Add option in mongo-cc.py to select alternate directories besides src/mongo to search for build/git hash coverage results

About

Tweaking the gcov utility for specialized coverage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 70.5%
  • Python 27.7%
  • Shell 1.8%