build test only when necessary