Astrometric test of the weak equivalence principle