Monthly Archives: August 2019

Simpler Unit Test Framework

The C++ Range library always seemed overly complicated to me. I’ve been working on https://github.com/keithalewis/sequence lately. I work hard to be lazy and came up with an easy way to add unit tests: just write a function returning an `int` and call it to initialize a global `int` variable. The driver is just a translation unit having an `int main() { return 0; }`

See https://github.com/keithalewis/sequence/blob/master/binop.t.cpp for an example.