Add mocks for common debug features

tf_log and do_panic calls can be tested through the functions of
common/mock_debug.h. The console driver dependency has been removed.

Change-Id: I3a0da45c851aee4ae7a8599e21816237d9932e72
Signed-off-by: Imre Kis <imre.kis@arm.com>
diff --git a/mocks/include/common/debug.h b/mocks/include/common/debug.h
index 245e698..6ee625d 100644
--- a/mocks/include/common/debug.h
+++ b/mocks/include/common/debug.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2013-2020, ARM Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -34,8 +34,6 @@
 #include <stdbool.h>
 #include <stdio.h>
 
-#include <drivers/console.h>
-
 /*
  * Define Log Markers corresponding to each log level which will
  * be embedded in the format string and is expected by tf_log() to determine
@@ -100,7 +98,6 @@
 #define panic()				\
 	do {				\
 		backtrace(__func__);	\
-		(void)console_flush();	\
 		do_panic();		\
 	} while (false)
 
diff --git a/mocks/include/common/mock_debug.h b/mocks/include/common/mock_debug.h
new file mode 100644
index 0000000..cf6f711
--- /dev/null
+++ b/mocks/include/common/mock_debug.h
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <setjmp.h>
+
+typedef jmp_buf panic_environment_t;
+
+#define SETUP_PANIC_ENVIRONMENT(env) (expect_panic(&env) && (setjmp(env) == 0))
+
+int expect_panic(panic_environment_t *env);
+void expect_tf_log(const char *str);