Add BUILD_ONLY support to unit tests