Fix `test-packages *` if some packages lack tests

Fixes #3334.

This was an intentional but poorly thought through change in
1.0.2 (1a9536baa).