Generalized Schur-complements and a test for total positivity