Unit Tests in guile

When developing an application with guile (in my case guile embedded in a C++ app), what is a good way to write unit tests for the scheme code?

I’m aware of SRFI-64 and writing tests in the same file as my procedures works fine for small collections of scripts.

But what is a good way to maintain a suite of unit-tests for my guile code in a larger project?

I’d prefer to have the tests in the same file as the code.
But I’m hesitant to run the tests when loading modules in the application since App startup time can be an issue.
I also might need to mock some symbols which are provided by the native code in the App.

C/C++ unit-test frameworks usually build different executable targets for the App and for the unit-tests and link the test symbols only in the test executable.

I’m stuck on how to approach this in guile.

If you follow the GNU project standard (autotools), you should have a test directory for your test. You can check the mcron project because I think is a standard GNU guile project for production.

2 Likes