Generalized entropy-based criterion for consistent testing