None of my projects are in any way critical or important, so i usually make do with the "run it and see if it works" approach to testing (or the extended "publish it and make sure the only users re people who'd report to you and not get angry" version), not only because I'm lazy but also because it simply doesn't matter. The "see if it works" method works decently as a way to ensure the code works at all, and
99% of the time this is all I need.
I have written some testing code though, for example
libkoishi's koishi.c, which is not only my "usage example" but also runs a couple simple tests to see if things work at least mostly as expected, like whether the model gets trained at all (lines 23-44) or whether it deals with unicode as expected (48-53). She also has some breakpoints hardcoded so I can jump in with gdb to take a look at the data structures. However, all the tests are very basic, and this all exists only because this is a library - if it was a standalone program, this all would have probably been tested with the "manual" method. Now that I think about it, all the testing
is done this way anyway, simply by having Parsee run on the code and getting flashii people to scream at me if she breaks (the "extended method").
I also sometimes write one-off """unit""" tests for some more complicated pieces of code, mostly by copying out the interesting part into a separate file and instrumenting some code similar to libkoishi's tests around it. This file almost never survives more than a couple minutes though.
I have also never used actual testing frameworks. Using one would be overkill for doing such one-off tests, and I don't write proper tests. As such I have never actually figured out such a framework, because I don't need/want one.
However,
if I was actually paid for this shit and people were in some significant way depending on my code running correctly, I would probably end up writing actual tests. And learn an actual testing framework. And not use hacks. And document my code. And...