Project Setup
This is a "boilerplate" kind of day. Lots of boring things to get set up and out of the way before we can get started on the actual project 🥱. In this devlog, we set up our build tool, test frameworks, and our code analysis tools so we have a solid ground to build on.
Build Tool
I'll be using Meson as my build tool, and splitting the build across a few different subdirectories. We'll have one area for all of our utility files, one area that generates our main executable, and then a third for housing and running all of our tests. We don't actually have any utilities or tests yet, so we'll just create some filler files for now.
Test Frameworks
I'll be using Unity as my unit test framework, and FFF (Fake Function Framework) as my mocking library. These are about as lightweight and simplistic as they come. We don't have any real tests to set up at this point, but we still want to tie them into the build process, so we'll throw together a placeholder test for our placeholder utilities.
Code Analysis
There's a variety of these to choose from, many of which have a lot of overlap, and a few of which aren't compatible with each other. I ended up going with some basic compiler flags and clang-tidy for static analysis, and address sanitizer (ASan) and undefined behavior sanitizer (UBSan) for my dynamic analysis. Valgrind isn't super compatible with ASan without some ugly workarounds, but I'll still be keeping it handy as a manual troubleshooting tool.
Related Links
Here's the PR for these changes: Github PR #1
I'd also recommend checking out the two "note" pages that cover these tools / topics in more detail: