add a base class for tests. close #4