test(pmu): check if PMUv3 is functional

The PMU is tested for secure world leakage but there are no checks
whether it works in the first place.

The counter and event counters are exercised separately. This is because
the functionality of one does not imply the functionality of the other
(EL3 has separate controls for both). This additionally catches a corner
case with FEAT_HPMN0 missing without failing all tests.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I966d3155cdd6edfde01af32f7c50c3bb3644274a
diff --git a/include/common/test_helpers.h b/include/common/test_helpers.h
index 9fc7579..43203a7 100644
--- a/include/common/test_helpers.h
+++ b/include/common/test_helpers.h
@@ -343,6 +343,14 @@
 		}								\
 	} while (false)
 
+#define SKIP_TEST_IF_PMUV3_NOT_SUPPORTED()					\
+	do {									\
+		if (!get_feat_pmuv3_supported()) {				\
+			tftf_testcase_printf("FEAT_PMUv3 not supported\n");	\
+			return TEST_RESULT_SKIPPED;				\
+		}								\
+	} while (false)
+
 /* Helper macro to verify if system suspend API is supported */
 #define is_psci_sys_susp_supported()	\
 		(tftf_get_psci_feature_info(SMC_PSCI_SYSTEM_SUSPEND)		\