[PATCH v2] selftests: fix build behaviour on targets' failures