Revert last 5 patches related to logging as they are still unstable
Revert "Log: Restore an interface target for logging header"
This reverts commit 2e796c5a813054de97f20492382a428894fdbacc.
Revert "Log: Add __assert_func and __assert_puts"
This reverts commit 6bceab814be8a968e74735dd45fe440bf6ea79b4.
Revert "LIB: Move TEST_LOG to use tfm_log"
This reverts commit 9798351a12f881a1cca66b60f4ad72167916847d.
Revert "LIB: Move NS test apps to use printf"
This reverts commit ebf5261a57d2a1ed91fc334a53fada7b59255ae4.
Revert "LIB: Move tfm_log.h to tfm_tests_log_msg.h"
This reverts commit 290b88f90c0d2a5dc275a1748690047f374ef6f1.
Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
Change-Id: Icd0dabddb5c191728e18c81611648ce2eb81680c
diff --git a/tests_reg/test/bl1/bl1_1/CMakeLists.txt b/tests_reg/test/bl1/bl1_1/CMakeLists.txt
index 1d08110..ce0a33d 100644
--- a/tests_reg/test/bl1/bl1_1/CMakeLists.txt
+++ b/tests_reg/test/bl1/bl1_1/CMakeLists.txt
@@ -11,11 +11,30 @@
add_library(bl1_1_tests STATIC)
-target_link_libraries(tfm_test_framework_common
+set(LOG_SOURCE_ROOT ${TFM_TESTS_ROOT_DIR}/lib/log)
+
+add_library(bl1_1_log INTERFACE)
+
+target_sources(bl1_1_log
+ INTERFACE
+ ${LOG_SOURCE_ROOT}/tfm_log_raw.c
+)
+
+target_include_directories(bl1_1_log
+ INTERFACE
+ ${LOG_SOURCE_ROOT}
+)
+
+target_link_libraries(bl1_1_log
INTERFACE
platform_bl1_1_interface
)
+target_link_libraries(tfm_test_framework_common
+ INTERFACE
+ bl1_1_log
+)
+
add_subdirectory(suites/crypto)
add_subdirectory(suites/random)
add_subdirectory(suites/integration)
diff --git a/tests_reg/test/bl2/mcuboot/CMakeLists.txt b/tests_reg/test/bl2/mcuboot/CMakeLists.txt
index 48f2deb..17c7ab6 100644
--- a/tests_reg/test/bl2/mcuboot/CMakeLists.txt
+++ b/tests_reg/test/bl2/mcuboot/CMakeLists.txt
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# SPDX-FileCopyrightText: Copyright The TrustedFirmware-M Contributors
+# Copyright (c) 2021-2022, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -10,11 +10,31 @@
# It links platform_ns which is not built by SPE build.
# So a dedicated library is duplicated here, and it links the platform_s instead of platform_ns.
+# TO-DO: find a better approach to reference the directory
+set(LOG_SOURCE_ROOT ${TFM_TESTS_ROOT_DIR}/lib/log)
+
+add_library(mcuboot_test_log INTERFACE)
add_library(mcuboot_test_framework_common INTERFACE)
+target_sources(mcuboot_test_log
+ INTERFACE
+ ${LOG_SOURCE_ROOT}/tfm_log_raw.c
+)
+
+target_include_directories(mcuboot_test_log
+ INTERFACE
+ ${LOG_SOURCE_ROOT}
+)
+
+target_link_libraries(mcuboot_test_log
+ INTERFACE
+ platform_bl2
+)
+
target_link_libraries(mcuboot_test_framework_common
INTERFACE
tfm_test_framework_common
+ mcuboot_test_log
)
add_subdirectory(suites/integration)
diff --git a/tests_reg/test/framework/test_log.h b/tests_reg/test/framework/test_log.h
index 303793b..4c14c60 100644
--- a/tests_reg/test/framework/test_log.h
+++ b/tests_reg/test/framework/test_log.h
@@ -13,17 +13,7 @@
#elif defined USE_STDIO
#include <stdio.h>
#else
-/*
- * Depending on how the tests are compiled, they may
- * pick up the LOG_LEVEL definition from other components. These other values
- * will have no effect on logging in the tests as we always call the tfm_log
- * function. In the case that we do not have a definition, just set
- * it to VERBOSE
- */
-#ifndef LOG_LEVEL
-#define LOG_LEVEL LOG_LEVEL_VERBOSE
-#endif
-#include "tfm_log.h"
+#include "tfm_log_raw.h"
#endif /* USE_SP_LOG */
#ifdef __cplusplus
@@ -35,7 +25,7 @@
#elif defined USE_STDIO
#define TEST_LOG(...) printf(__VA_ARGS__)
#else
-#define TEST_LOG(...) tfm_log(LOG_MARKER_RAW __VA_ARGS__)
+#define TEST_LOG(...) tfm_log_printf(__VA_ARGS__)
#endif /* USE_SP_LOG */
#ifdef __cplusplus
diff --git a/tests_reg/test/ns_regression/CMakeLists.txt b/tests_reg/test/ns_regression/CMakeLists.txt
index 4da9a37..543d746 100644
--- a/tests_reg/test/ns_regression/CMakeLists.txt
+++ b/tests_reg/test/ns_regression/CMakeLists.txt
@@ -41,13 +41,14 @@
INTERFACE
DOMAIN_NS=1
$<$<BOOL:${CONFIG_TFM_ERPC_TEST_FRAMEWORK}>:CONFIG_TFM_ERPC_TEST_FRAMEWORK=1>
- USE_STDIO
+ $<$<BOOL:${USE_STDIO}>:USE_STDIO>
)
target_link_libraries(tfm_test_framework_ns
INTERFACE
tfm_test_framework_common
tfm_api_ns
+ tfm_ns_log
)
target_sources(tfm_ns_tests