Test: Skip non-secure audit logging test when secure test is disabled

Non-secure audit logging test relies on Secure audit logging test
to prepare loggings for test. If Secure regression test is
disabled, non-secure audit logging test will always fail.

Therefore, skip non-secure audit logging test when Secure
regression test is disabled. Add a message dump to indicate that
this test case is skipped.

Signed-off-by: David Hu <david.hu@arm.com>
Change-Id: I80e31b46a5e517f6be959559a104961e58f6e1ca
diff --git a/test/suites/audit/CMakeLists.txt b/test/suites/audit/CMakeLists.txt
index 67e3578..ddc1555 100644
--- a/test/suites/audit/CMakeLists.txt
+++ b/test/suites/audit/CMakeLists.txt
@@ -33,6 +33,7 @@
 target_compile_definitions(tfm_test_suite_audit_ns
     PRIVATE
         DOMAIN_NS=1
+        $<$<BOOL:${TEST_S}>:AUDIT_TEST_S_ENABLE>
 )
 
 target_link_libraries(tfm_test_suite_audit_ns
diff --git a/test/suites/audit/non_secure/audit_ns_interface_testsuite.c b/test/suites/audit/non_secure/audit_ns_interface_testsuite.c
index 337eaaf..851ec31 100644
--- a/test/suites/audit/non_secure/audit_ns_interface_testsuite.c
+++ b/test/suites/audit/non_secure/audit_ns_interface_testsuite.c
@@ -68,6 +68,7 @@
                   audit_veneers_tests, list_size, p_test_suite);
 }
 
+#if AUDIT_TEST_S_ENABLE
 /**
  * \brief Functional test of NS API
  *
@@ -254,3 +255,19 @@
 
     ret->val = TEST_PASSED;
 }
+#else
+/**
+ * \brief Functional test of NS API
+ *
+ * \note This test case relies on Secure audit logging test to prepare the
+ *       loggings. If Secure audit logging test is disabled, this test case
+ *       will always fail. Therefore skip this test case when Secure audit
+ *       logging is disabled.
+ */
+static void tfm_audit_test_1001(struct test_result_t *ret)
+{
+    TEST_LOG("Skipped when Secure audit logging test is disabled.\r\n");
+
+    ret->val = TEST_PASSED;
+}
+#endif /* AUDIT_TEST_S_ENABLE */