Build: Control single test without TEST_S/TEST_NS [TF-M repo]

To decrease the size of TF-M image so that it can work on a platform
with limited resource, the build configure should allow developers
to select one or more single test suites. The tf-m-test repo has
added some build control flags. These flags can be controlled with
"-D<FLAG>=ON" to turn on the related test suites' build. With the
build control flags are added in tf-m-tests repo, the cmake build
logic need to be refined. To make it easier to start single test
suite without TEST_NS or TEST_S, more conditions need to be added to
link tf-m-tests repo. Moreover, some test services should also
depend on the new single test flags.

By this patch, when TEST_S or TEST_NS is ON, all the secure or
non-secure test suites will run either. When single test configuration
like TEST_NS_XXX or TEST_S_XXX is ON, the single test suite will run
if its dependencies are configurated.

Signed-off-by: Jianliang Shen <jianliang.shen@arm.com>
Change-Id: I2ca5b400ddfee2832e0eaae49da529f1c2d70c98
diff --git a/docs/technical_references/instructions/tfm_build_instruction.rst b/docs/technical_references/instructions/tfm_build_instruction.rst
index 80c6955..9136c4c 100644
--- a/docs/technical_references/instructions/tfm_build_instruction.rst
+++ b/docs/technical_references/instructions/tfm_build_instruction.rst
@@ -60,6 +60,13 @@
    7. If it exists, TFM Profile specific config is applied from
       ``config/profile/<tfm_profile>.cmake``.
    8. ``config/config_default.cmake`` is loaded.
+   9. If ``TEST_S`` or ``TEST_NS`` or other single test suite config like
+      ``TEST_NS_ATTESTATION`` (see `Regression test configuration`_)is set, then
+      config from ``${TFM_TEST_REPO_PATH}/test/config/set_config.cmake`` and
+      ``${TFM_TEST_REPO_PATH}/test/config/default_ns_test_config.cmake`` or
+      ``${TFM_TEST_REPO_PATH}/test/config/default_s_test_config.cmake`` or
+      ``${TFM_TEST_REPO_PATH}/test/config/default_test_config.cmake`` is
+      applied.
 
 .. Warning::
     This means that command-line settings are not applied when they conflict
@@ -132,14 +139,69 @@
 Regression test configuration
 -----------------------------
 
-Regression test configuration is controlled entirely by the ``TEST_S`` and
-``TEST_NS`` cmake variables.
+Regression test configuration is controlled entirely by ``TEST_NS`` or
+``TEST_S`` or single test suite configuration. The group test
+configurations and single test suite configurations are listed below, all of
+them are disabled by default.
+
++---------------------+--------------------------------------------------------------------+
+| Parameter           | Description                                                        |
++=====================+====================================================================+
+| TEST_NS_ATTESTATION | Build non-secure regression Attestation tests.                     |
++---------------------+--------------------------------------------------------------------+
+| TEST_NS_T_COSE      | Build non-secure regression t_cose tests.                          |
++---------------------+--------------------------------------------------------------------+
+| TEST_NS_QCBOR       | Build non-secure regression QCBOR tests.                           |
++---------------------+--------------------------------------------------------------------+
+| TEST_NS_AUDIT       | Build non-secure regression Audit log tests.                       |
++---------------------+--------------------------------------------------------------------+
+| TEST_NS_CORE        | Build non-secure regression Core tests.                            |
++---------------------+--------------------------------------------------------------------+
+| TEST_NS_CRYPTO      | Build non-secure regression Crypto tests.                          |
++---------------------+--------------------------------------------------------------------+
+| TEST_NS_ITS         | Build non-secure regression ITS tests.                             |
++---------------------+--------------------------------------------------------------------+
+| TEST_NS_PS          | Build non-secure regression PS tests.                              |
++---------------------+--------------------------------------------------------------------+
+| TEST_NS_PLATFORM    | Build non-secure regression Platform tests.                        |
++---------------------+--------------------------------------------------------------------+
+| TEST_NS_FWU         | Build non-secure regression FWU tests.                             |
++---------------------+--------------------------------------------------------------------+
+| TEST_NS_IPC         | Build non-secure regression IPC tests.                             |
++---------------------+--------------------------------------------------------------------+
+| TEST_NS_SLIH_IRQ    | Build non-secure regression Second-Level Interrupt Handling tests. |
++---------------------+--------------------------------------------------------------------+
+| TEST_NS_FLIH_IRQ    | Build non-secure regression First-Level Interrupt Handling tests.  |
++---------------------+--------------------------------------------------------------------+
+| TEST_NS_MULTI_CORE  | Build non-secure regression multi-core tests.                      |
++---------------------+--------------------------------------------------------------------+
+| TEST_S_ATTESTATION  | Build secure regression Attestation tests.                         |
++---------------------+--------------------------------------------------------------------+
+| TEST_S_AUDIT        | Build secure regression Audit log tests.                           |
++---------------------+--------------------------------------------------------------------+
+| TEST_S_CRYPTO       | Build secure regression Crypto tests.                              |
++---------------------+--------------------------------------------------------------------+
+| TEST_S_ITS          | Build secure regression ITS tests.                                 |
++---------------------+--------------------------------------------------------------------+
+| TEST_S_PS           | Build secure regression PS tests.                                  |
++---------------------+--------------------------------------------------------------------+
+| TEST_S_PLATFORM     | Build secure regression Platform tests.                            |
++---------------------+--------------------------------------------------------------------+
+| TEST_S_FWU          | Build secure regression FWU tests.                                 |
++---------------------+--------------------------------------------------------------------+
+| TEST_S_IPC          | Build secure regression IPC tests.                                 |
++---------------------+--------------------------------------------------------------------+
+
+The single test suite can be opened when their dependencies like partitions or
+other specific configurations are set. On the one hand, some test suites depend
+on other test suites. On the other hand, some test suites have confict with
+other test suites. Test configurations and dependencies will be
+checked in ``${TFM_TEST_REPO_PATH}/test/config/check_config.cmake``.
 
 If regression testing is enabled, it will then enable all tests for the enabled
 secure partitions. If IPC mode is enabled via ``TFM_PSA_API`` the IPC tests will
-be enabled. QCBOR and T_COSE tests are linked to the Initial Attestation
-partition, as they are only used there. Multicore tests will be enabled if
-``TFM_MULTI_CORE_TOPOLOGY`` is enabled.
+be enabled. Multicore tests will be enabled if ``TFM_MULTI_CORE_TOPOLOGY`` is
+enabled.
 
 Some cryptographic tests can be enabled and disabled. This is done to prevent
 false failures from being reported when a smaller Mbed Crypto config is being