Text this: Generalized portmanteau tests based on subspace methods