A set of random c programs that I write to practice my c skills.
(actually some directories don't contain programs, but just a function with a bunch of tests, but I don't want to rename the repo)
To build and run a program (a directory with a main.c file inside), use the
./scripts/run.sh
.
$ ./scripts/run.sh ./programs/htoi
Enter your hex number: beef
Ten-based value is: 48879
To make things more handy, while working on a particular program, one can bind
running run.sh
to some key in vim, like so:
:map <leader>r :! .scripts/run.sh hello-world<cr>
For unit tests I've used the criterion testing framework.
To run all tests, use the following script:
$ ./scripts/test-all.sh
To run tests for a particular program, use:
$ ./scripts/test.sh ./programs/htoi