Add a test target and one unit test, using Check. - #102
Conversation
56e630d to
81a1f9d
Compare
90af82b to
fb7b1e6
Compare
|
I believe this branch is now merge-ready. It's one small test for a Before building and running the tests, install Check (and pkg-config or pkgconf to find Check's includes and libs). These are dependencies for tests and only for tests. To build and run the tests from the top-level To add more Travis and Cirrus now run In our too-brief meetup on Friday, @DerDakon suggested running tests via The sooner we merge this, the sooner we can start adding tests with most every commit. The sooner we have existing code covered by test, the sooner we can make bolder changes. With good test coverage we can also easily get good |
fed01e0 to
97240dc
Compare
|
@schmonz agreed that I can add another testcase I was just playing with, so I have extended this by a second commit that tests additional behavior of the stralloc functions. |
b23cb25 to
0609d1b
Compare
|
Happy with the additions, at a glance. Please feel free to merge. |
Had a little time on the plane. Here's an extremely minimal example of a unit test. Not looking for approval yet, just feedback.
You'll need Check installed, and depending where it goes you may need to adjust
conf-ccandconf-ldto find it.Then run
make testand behold, at least one use of stralloc is shown to work!I picked stralloc because we all understand it, it's heavily used, it's relatively easy to test, and who knows, maybe with sufficient stralloc tests we'll discover something interesting we'll be glad to know about.