Exact distributions of distribution-free test statistics