Optionally make `test` target depend on `all`

Fixes: #8774
10 files changed