This is my last report on my awesome summer’s work on luagit2.
This whole summer, writing lua-bindings for libgit2, I learnt a lot about working of libgit. I understood some of important professional software developement fundamentals.
This past week I was trying to build my project on travis. I got it successfully build on Linux-xenial
version.
Also I got the testing done and now I am having a coverage of about 95% .
I would like to share my experiences with doing test coverages for Luagit2 and hopefully for the projects that are developed using luaC-API
.
-
The thing to keep in mind is that the functions are developed using c language only. The list of functions that are developed are all registered at once. This means we do not create modules differently and then register them. Only once the functions are registered and the shared object or executable is build. Thus It becomes confusing and a bit tough how to track and do a test coverage in such case.
-
In my project What I have done is, I have created a separate lua script that has a set of only that module’s functions of original luagit2 library that are to be tested for coverage.
-
I then modified tests accordingly to specifically call functions from this script. Thus now using busted or any other lua testing library with luacov, we can easily do coverage analysis of that module’s function.
I would also like to tell that this is also the biggest project that I have done till now and it really feels amazing to have completed so many modules in all means, that is Bindings, tests ,test coverage as well as Documentation.
Only for statics, I successfully completed working on :
- libgit2
- cred
- config
- oid
- signature
- clone
- repository
- tree
- commit
- index
- reference
- branch
- blame
- blob
- tag
- object
- buf
- revwalk
- annotated
- checkout
- reset
- describe
- reflog
- revert
- revparse
- diff
I wrote 5 examples till now that cover adding files to index, initializing an empty repo, getting diff and blame data for files, also cloning a public repository.
I also created a small community for asking and clearing doubts related to luagit2 at here : https://gitter.im/Luagit2