[gambit-list] Unit Testing

Bill Six billsix at gmail.com
Wed May 18 19:47:50 EDT 2022


Thomas,

The attached file shows a light weight, self contained, compile-time
unit-test framework that I made.  It allows tests to be collocated in the
source with the associated functions under test, rather than spread over
the file system in other files.  If any of the unit tests fail at compile
time, you get no object files/c files/exe, which I've not seen elsewhere.
Closest thing I've seen that's comparable is Python's doctests, but mine is
better, because I wrote it :-)

The file attached is one that I adapted from the following work that I did
years ago: https://billsix.github.io/bug.html https://github.com/billsix/bug

Hope it helps,

Bill

On Mon, May 2, 2022 at 5:38 PM Thomas Hage <thomas.hage at live.de> wrote:

>
> Hi,
>
> I am learning Scheme on my own by exploring gambit by personal
> needs.
> Therefore there is a huge lack of experience on my side.
>
> Prior to my current project I felt in love with Test Driven
> Development.
> Scheme enabled me to improve my workflow by programming
> interactive - sufficiating my own requirements.
> The downside is that I am unable to include unit test into my
> current workflow. Any advice would be appreciated.
>
> In order to cover my current project in retrospective, I want to
> create tests (note that the usability of the provided test suite
> requires heavy exploration >:-) ).
> In both cases - testing afterwards or prior to implementing
> functionality - I am relying on branch coverage heavily.
> Since I am covering R5RS only, I am wondering if there is a test
> suite which can provide me with branch coverage (regardless of
> output formats/IDE's).
>
> I am aware about the following two facts:
>  - In order to programming test-driven, a IDE suggestion
>  implementations is required (not required)
>  - the functional programming paradigm should enable me to cover
>  my code by determine the permutations of arguments. I want to
>  support this with branch coverage, so that I suspend my current
>  workflow and resume afterwards.
>
> I am happy about sincerely feedback.
>
> Thomas
>
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://mailman.iro.umontreal.ca/cgi-bin/mailman/listinfo/gambit-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20220518/f559cc7b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unit-test-example.scm
Type: application/octet-stream
Size: 1729 bytes
Desc: not available
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20220518/f559cc7b/attachment.obj>


More information about the Gambit-list mailing list