nitunit: factorize test_dir processing into test_base.