Build: Define TEST_DIR once and use it everywhere

The TEST_DIR was defined in multiple files and it was not used
everywhere, some uses ${TFM_ROOT_DIR}/test instead.
This patch unifies the TEST_DIR definition to CommonConfig.cmake
and use it everywhere.

Change-Id: I04d1104ad2453f4fa595b27b7a77146acf809e4f
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/CommonConfig.cmake b/CommonConfig.cmake
index b2febdc..679a0d3 100644
--- a/CommonConfig.cmake
+++ b/CommonConfig.cmake
@@ -21,6 +21,8 @@
 	message(FATAL_ERROR "ERROR: Compiler \"${COMPILER}\" is not supported.")
 endif()
 
+set(TEST_DIR ${CMAKE_SOURCE_DIR}/test)
+
 #Configure the default build type
 set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type (i.e. Debug)")
 
@@ -312,7 +314,7 @@
 	set(TFM_PARTITION_AUDIT_LOG OFF)
 endif()
 
-include(${CMAKE_CURRENT_LIST_DIR}/test/TestConfig.cmake)
+include(${TEST_DIR}/TestConfig.cmake)
 
 if (TFM_PARTITION_AUDIT_LOG)
 	add_definitions(-DTFM_PARTITION_AUDIT_LOG)