Spectral sum rules and finite volume partition function in gauge theories with real and pseudoreal fermions.