[pacman-dev] pactest coverage

Allan McRae allan at archlinux.org
Fri Jun 20 23:22:25 EDT 2008


Hi all,

I "discovered" gcov so was testing out the coverage of the pactests.  
During searching for more info about gcov I saw Dan already had written 
something on it 
(http://toofishes.net/blog/using-gcov-code-coverage-testing/) so not as 
novel as I thought...

Anyway, as an FYI, here is a list of functions/important sections of the 
code that are not covered by pactests.

libalpm/add.c
  372-375: case 11 - symlink in package to existing dir
  386-389: dir in package, symlink to non-dir in filesystem
  393-396: case 10 - trying to overwrite dir tree with file, don't allow it
  399:     case 6 - trying to overwrite file with dir

libalpm/package.c
  changelog functions

libalpm/remove.c
  191-192:  -Rcs

libalpm/sync.c
  290-300:  _alpm_sync_addtarget() - adding target from given repo

pacman/package.c
  dump_pkg_backups()
  dump_pkg_files()
  dump_pkg_changelog()

pacman/query.c
  resolve_path()
  query_fileowner()
  query_group()
  query_upgrades()
  is_foreign()
  is_unrequired()

pacman/sync.c
  sync_cleandb()
  sync_cleandb_all()
  sync_cleancache()
  sync_group()

pacman/upgrade.c
  pacman_upgrade() - URL targets

pacman/util.c
  needs_transaction()
  makepath()
  rmrf()
  mdirname()
  strtoupper()
  pm_vasprintf()

and everything to do with deltas...

We really should have coverage for the sections in libalpm/add.c so I am 
writing pactests for those now.  It would be easy to add one for -Rcs 
and changelogs as well so that will give fairly complete coverage of 
libalpm. 

Allan






More information about the pacman-dev mailing list