Ever since I worked on my amazing little single-header C/C++ library utest.h, which mimics enough of Google’s googletest framework but in a significantly leaner footprint (and a single header!), I’ve wanted something similar for doing benchmarking. Google has their own benchmarking library Google benchmark, but it fails a couple of key tests that I have for libraries:
It isn’t a single header library. It doesn’t support C benchmarks. It is huge.
I’ve been feeling a little overwhelmed by the languages I generally code in (C#, C++, Rust) and wanted to get my teeth into something a bit simpler again (obviously C!). One thing I’ve never been that happy with in C was the lack of a good command line argument parser. There is a great list of option parsers that @nothings has curated over the years, but most of them are C++, and the ones for C are just a bit underwhelming to me.
A user of utest.h posted an intruiging issue that on an release build with Visual Studio my unit testing framework for C/C++, utest.h, no tests were being ran. But on a debug build they were. Before I even got to the issue they worked out that whole program optimization was causing the issue and closed it themselves.
But this got me thinking - there is no reason why my library shouldn’t work with whole program optimization enabled, so why was this behaving badly?
Testing command line applications in Rust is something that I found was a bit of a grey area. The main documentation for Rust has a section Testing CLI applications by running them which explains how they suggest you test command lines applications:
use std::process::Command; // Run programs use assert_cmd::prelude::*; // Add methods on commands use predicates::prelude::*; // Used for writing assertions #[test] fn file_doesnt_exist() -> Result<(), Box<std::error::Error>> { let mut cmd = Command::cargo_bin("grrs")?
One thing I’ve unfortunately neglected for a little while now on my blog was the RSS feed - mostly because I didn’t have a clue how to make Hugo do it as I’d like. There was a couple of issues:
Only the summaries of my posts were fed via RSS - not the full contents. I do not do any sort of content tracking on my site because I don’t want to foist vaporware like Google Analytics on my readers, so it really doesn’t matter to me whether people read my content from the RSS feed or from the main site - that they read it is enough!