We provide a contour integral formula for the exact partition function of ${\cal N}=2$ supersymmetric $U(N)$ gauge theories on compact toric four-manifolds by means of supersymmetric localisation. We perform the explicit evaluation of the contour integral for $U(2)$ ${\cal N}=2$ theory on $\mathbb{P}^2$ for all instanton numbers. In the zero mass case, corresponding to the ${\cal N}=4$ supersymmetric gauge theory, we obtain the generating function of the Euler characteristics of instanton moduli spaces in terms of mock-modular forms. In the decoupling limit of infinite mass we find that the generating function of local and surface observables computes equivariant Donaldson invariants, thus proving in this case a long-standing conjecture by N. Nekrasov. In the case of vanishing first Chern class the resulting equivariant Donaldson polynomials are new.