On 2/4/2016 12:33 PM, Ross Berteig wrote:
As an experiment, I decided to see how hard it would be to build fossil
instrumented for code coverage and run the full test suite. Turns out it
wasn't that hard to do, although it did require both configure and make
to be invoked with special conditions....

For the record, what I actually typed looked like this, at a bash prompt provided by MingW32 and MSYS, in a folder parallel to my open checkout:

$ CFLAGS="-O0 -g" ../fossil4/configure --with-miniz \
  --with-openssl=none --json --with-tcl --with-tcl-stubs \
  --with-tcl-private-stubs --with-th1-docs --with-th1-hooks
$ make "TCC=gcc -fprofile-arcs -ftest-coverage"
$ tclsh ../fossil4/test/tester.tcl ./fossil -prot -quiet -verbose
$ gcov bld/*.gcda

I really need to get lcov or one of the other, fancier whole source kit analysis tools running here. But here's a quick sort of the sources sorted and grouped by coverage:

<=1%: allrepo.c attach.c bisect.c bundle.c cache.c clearsign.c configure.c descendants.c diffcmd.c event.c export.c finfo.c fusefs.c gzip.c http.c http_socket.c http_transport.c loadctrl.c piechart.c popen.c publish.c purge.c report.c rss.c setup.c sitemap.c stash.c stat.c statrep.c tar.c unicode.c winhttp.c wysiwyg.c xfersetup.c zip.c regexp.c import.c tkt.c xfer.c

<=10%: tktsetup.c browse.c search.c clone.c moderate.c shun.c shell.c

<=50%: wiki.c sync.c name.c captcha.c url.c info.c wikiformat.c skins.c diff.c doc.c content.c user.c markdown.c main.c cgi.c markdown_html.c deltacmd.c login.c sqlite3.c json_status.c rebuild.c branch.c sqlcmd.c timeline.c path.c builtin.c

<=60%: encode.c utf8.c graph.c cson_amalgamation.c blob.c vfile.c json_dir.c file.c json_query.c style.c json_timeline.c checkin.c manifest.c json_tag.c update.c

<=70%: verify.c tag.c merge.c th_main.c th_tcl.c json_report.c miniz.c json_login.c leaf.c json_artifact.c db.c json_wiki.c json_user.c merge3.c sha1.c

<=80%: json_finfo.c undo.c th_lang.c bag.c pivot.c printf.c util.c json_branch.c json_diff.c checkout.c delta.c

<=90%: json.c md5.c add.c json_config.c pqueue.c th.c winfile.c foci.c

<=100%: glob.c comformat.c lookslike.c

It looks like there some easy low hanging fruit for test cases to grab, by at least writing cases that verify a feature exists.

For example, the files with under 1% coverage include the implementations of commands all, bisect, bundle, cache, configuration, descendants, leaves, diff, gdiff, export, finfo, cat, fusefs, unpublished, publish, rss, stash, dbstat, tarball, zip, import, and ticket, as well as several test-* commands.

Some of those are relatively young commands, but even so they probably deserve regression tests that verify at least minimal presence.

On the other hand, I'm running on Windows at the moment, so I have no idea how well covered fusefs is in an environment where it can actually be used.

--
Ross Berteig                               r...@cheshireeng.com
Cheshire Engineering Corp.           http://www.CheshireEng.com/
+1 626 303 1602
_______________________________________________
fossil-dev mailing list
fossil-dev@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/fossil-dev

Reply via email to