Test/app: Fix compilation issues after moving test code here

The intention is only to make the codes pass compilation.
Some of the implementations will be refined in the future

Change-Id: I1c84c06705c80be74f270777c1a6d95974f8c240
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 50a7b17..2c5ea2d 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -7,11 +7,12 @@
 
 cmake_minimum_required(VERSION 3.7)
 
-#Tell cmake where our modules can be found
-list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../cmake)
+if (NOT DEFINED TFM_ROOT_DIR)
+	set(TFM_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../../trusted-firmware-m)
+endif()
 
-#Tell TFM Root before calling sub cmake
-get_filename_component(TFM_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
+#Tell cmake where our modules can be found
+list(APPEND CMAKE_MODULE_PATH ${TFM_ROOT_DIR}/cmake)
 
 #Include common stuff to control cmake.
 include("Common/BuildSys")