add unittest support

add initial support for unittest
This file is better named `test_utils.cpp`.