RDEPEND aka runtime dependencies are most probably also needed when testing.
So you could define all deps needed at runtime in COMMONDEP and set RDEPEND="${COMMONDEP}" and DEPEND="test? ( ${COMMONDEP} )"