Build: Improve configuration of IRQ tests

Also PERIPH_ACCCESS tests. Update docs.

Change-Id: I61274f9a067a2de7d45ffebedb81dd06d999600d
Signed-off-by: Raef Coles <raef.coles@arm.com>
diff --git a/config/config_default.cmake b/config/config_default.cmake
index 31d1ad0..b5b32f5 100644
--- a/config/config_default.cmake
+++ b/config/config_default.cmake
@@ -107,6 +107,8 @@
 ################################## Tests #######################################
 
 set(TFM_INTERACTIVE_TEST                OFF         CACHE BOOL      "Enable interactive tests")
+set(TFM_IRQ_TEST                        OFF         CACHE BOOL      "Enable IRQ tests")
+set(TFM_PERIPH_ACCESS_TEST              OFF         CACHE BOOL      "Enable peripheral access tests")
 
 set(TFM_CRYPTO_TEST_ALG_CBC             ON          CACHE BOOL      "Test CBC cryptography mode")
 set(TFM_CRYPTO_TEST_ALG_CCM             ON          CACHE BOOL      "Test CCM cryptography mode")
diff --git a/docs/reference/services/core_test_services_integration_guide.rst b/docs/reference/services/core_test_services_integration_guide.rst
index 6b28a72..fb34795 100644
--- a/docs/reference/services/core_test_services_integration_guide.rst
+++ b/docs/reference/services/core_test_services_integration_guide.rst
@@ -12,10 +12,19 @@
 
 Currently there are two test suites, *interactive* and *positive*. The positive
 test suite can be run by building using non-secure regression tests using
-``-DTEST_NS``. The interactive test suite is only available by setting
+``-DTEST_NS``.
+
+The interactive test suite is only available by setting
 ``-DTFM_INTERACTIVE_TEST=ON`` while the non-secure regression testsuite is
 enabled.
 
+In order to enable the IRQ test module of the postive testsuite, the non-secure
+regression testsuite must be enabled and ``-DTFM_IRQ_TEST=ON`` must be set.
+
+In order to enable the peripheral access test module of the positive testsuite,
+the non-secure regression testsuite must be enabled and
+``-DTFM_PERIPH_ACCESS_TEST=ON`` must be set.
+
 **************************
 Platform specific features
 **************************
@@ -44,7 +53,7 @@
 without actually executing the action expected by the test. A platform can also
 set the corresponding control flag to ``OFF`` to skip a test case. For example,
 A platform can skip peripheral access test case by setting
-``TFM_ENABLE_PERIPH_ACCESS_TEST`` to ``OFF`` in its cmake configuration file.
+``TFM_PERIPH_ACCESS_TEST`` to ``OFF`` in its cmake configuration file.
 
 ******************
 IRQ handling tests
@@ -92,7 +101,7 @@
 For scenario 5 a Non-secure timer is set up and ``TFM_SP_CORE_TEST_2`` waits for
 it to be triggered
 
-A platform can skip IRQ handling test by setting ``TFM_ENABLE_IRQ_TEST`` to
+A platform can skip IRQ handling test by setting ``TFM_IRQ_TEST`` to
 ``OFF`` in its cmake configuration file.
 
 The irq test services also demonstrate how to use the ``IRQ_TEST_TOOL_*``
diff --git a/platform/CMakeLists.txt b/platform/CMakeLists.txt
index 1f63404..9d7c0a5 100644
--- a/platform/CMakeLists.txt
+++ b/platform/CMakeLists.txt
@@ -88,6 +88,12 @@
         psa_interface
 )
 
+target_compile_definitions(platform_ns
+    PRIVATE
+        $<$<BOOL:${TFM_IRQ_TEST}>:TFM_ENABLE_IRQ_TEST>
+        $<$<BOOL:${TFM_PERIPH_ACCESS_TEST}>:TFM_ENABLE_PERIPH_ACCESS_TEST>
+)
+
 #========================= Platform BL2 =======================================#
 if(BL2)
     #TODO import policy