GP tests: delete CFG_GP_TESTSUITE_ENABLE

The two Makefile variables: CFG_GP_TESTSUITE_ENABLE and
CFG_GP_PACKAGE_PATH are redundant, since when the test suite is enabled
one has to provide the path to the package. This patch also consolidates
CFLAGS so that WITH_GP_TESTS is used everywhere instead of
XTEST_WITH_GP_TESTS and CFG_GP_TESTSUITE_ENABLE.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
diff --git a/host/xtest/Makefile b/host/xtest/Makefile
index 5fd051c..85dd437 100644
--- a/host/xtest/Makefile
+++ b/host/xtest/Makefile
@@ -39,8 +39,8 @@
 	adbg/src/security_utils_hex.c \
 	adbg/src/security_utils_mem.c
 
-ifeq ($(CFG_GP_TESTSUITE_ENABLE), y)
-CFLAGS += -DCFG_GP_TESTSUITE_ENABLE
+ifdef CFG_GP_PACKAGE_PATH
+CFLAGS += -DWITH_GP_TESTS
 
 srcs  += xtest_7500.c \
 	 xtest_8000.c \
@@ -64,7 +64,7 @@
 CFLAGS += -I../../ta/rpc_test/include
 CFLAGS += -I../../ta/sims/include
 CFLAGS += -I../../ta/storage/include
-ifeq ($(CFG_GP_TESTSUITE_ENABLE),y)
+ifdef CFG_GP_PACKAGE_PATH
 CFLAGS += -I../../ta/GP_TTA_Arithmetical
 CFLAGS += -I../../ta/GP_TTA_Crypto
 CFLAGS += -I../../ta/GP_TTA_DS
@@ -90,15 +90,12 @@
 LDFLAGS += ../lib/armv8/libcrypto.a
 endif
 
-# need more flags
-CFLAGS += -DXTEST_WITH_GP_TESTS
-
 endif
 
 # FIXME: Check if and why we need this flag?
 CFLAGS += -DUSER_SPACE
 
-ifneq ($(CFG_GP_TESTSUITE_ENABLE),y)
+ifndef CFG_GP_PACKAGE_PATH
 CFLAGS += -Wall -Wcast-align -Werror \
 	  -Werror-implicit-function-declaration -Wextra -Wfloat-equal \
 	  -Wformat-nonliteral -Wformat-security -Wformat=2 -Winit-self \
diff --git a/host/xtest/xml/include/xml_client_api.h b/host/xtest/xml/include/xml_client_api.h
index b5edb97..6bc5ea9 100644
--- a/host/xtest/xml/include/xml_client_api.h
+++ b/host/xtest/xml/include/xml_client_api.h
@@ -319,7 +319,7 @@
 	IDENTIFIER_NOT_USED(t_ctx)
 #endif
 
-#ifdef XTEST_WITH_GP_TESTS
+#ifdef WITH_GP_TESTS
 /*
  * Required by Global Platform test suite for v1.0
  */
diff --git a/host/xtest/xml/include/xml_crypto_api.h b/host/xtest/xml/include/xml_crypto_api.h
index db2739f..146dbdf 100644
--- a/host/xtest/xml/include/xml_crypto_api.h
+++ b/host/xtest/xml/include/xml_crypto_api.h
@@ -777,7 +777,7 @@
 	return res;
 }
 
-#ifdef CFG_GP_TESTSUITE_ENABLE
+#ifdef WITH_GP_TESTS
 /*CMD_GetOperationInfoMultiple*/
 static TEEC_Result Invoke_Crypto_GetOperationInfoMultiple(
 	ADBG_Case_t *c, TEEC_Session *s,
diff --git a/host/xtest/xtest_6000.c b/host/xtest/xtest_6000.c
index 26a6319..4fd3dc1 100644
--- a/host/xtest/xtest_6000.c
+++ b/host/xtest/xtest_6000.c
@@ -22,7 +22,7 @@
 #include <ta_storage.h>
 #include <tee_api_defines.h>
 #include <tee_api_types.h>
-#ifdef CFG_GP_TESTSUITE_ENABLE
+#ifdef WITH_GP_TESTS
 #include <TTA_DS_protocol.h>
 #endif
 
@@ -441,7 +441,7 @@
 	TEEC_CloseSession(&sess);
 }
 
-#ifdef CFG_GP_TESTSUITE_ENABLE
+#ifdef WITH_GP_TESTS
 static TEEC_Result ds_open_access_conf(TEEC_Session *sess)
 {
     TEEC_Operation op;
@@ -1015,7 +1015,7 @@
 	TEEC_CloseSession(&sess);
 }
 
-#ifdef CFG_GP_TESTSUITE_ENABLE
+#ifdef WITH_GP_TESTS
 static void xtest_tee_test_6010(ADBG_Case_t *c)
 {
     TEEC_Session sess;
@@ -1296,7 +1296,7 @@
 	"Description of how to implement ..."
 	);
 
-#ifdef CFG_GP_TESTSUITE_ENABLE
+#ifdef WITH_GP_TESTS
 ADBG_CASE_DEFINE(
     XTEST_TEE_6010, xtest_tee_test_6010,
     /* Title */
diff --git a/host/xtest/xtest_main.c b/host/xtest/xtest_main.c
index d5f8ad4..5260eb2 100644
--- a/host/xtest/xtest_main.c
+++ b/host/xtest/xtest_main.c
@@ -17,7 +17,7 @@
 #include <adbg.h>
 #include "xtest_test.h"
 #include "xtest_helpers.h"
-#ifdef CFG_GP_TESTSUITE_ENABLE
+#ifdef WITH_GP_TESTS
 #include "adbg_entry_declare.h"
 #endif
 
@@ -56,7 +56,7 @@
 ADBG_SUITE_ENTRY(XTEST_TEE_6007, NULL)
 ADBG_SUITE_ENTRY(XTEST_TEE_6008, NULL)
 ADBG_SUITE_ENTRY(XTEST_TEE_6009, NULL)
-#ifdef CFG_GP_TESTSUITE_ENABLE
+#ifdef WITH_GP_TESTS
 ADBG_SUITE_ENTRY(XTEST_TEE_6010, NULL)
 ADBG_SUITE_ENTRY(XTEST_TEE_6011, NULL)
 #endif
@@ -75,7 +75,7 @@
 ADBG_SUITE_ENTRY(XTEST_TEE_7017, NULL)
 ADBG_SUITE_ENTRY(XTEST_TEE_7018, NULL)
 ADBG_SUITE_ENTRY(XTEST_TEE_7019, NULL)
-#ifdef XTEST_WITH_GP_TESTS
+#ifdef WITH_GP_TESTS
 ADBG_ENTRY_AUTO_GENERATED_TESTS()
 #else
 #endif
diff --git a/host/xtest/xtest_test.c b/host/xtest/xtest_test.c
index 85f16cd..728c63c 100644
--- a/host/xtest/xtest_test.c
+++ b/host/xtest/xtest_test.c
@@ -21,7 +21,7 @@
 #include <ta_storage.h>
 #include <enc_fs_key_manager_test.h>
 #include <tee_api_defines.h>
-#ifdef CFG_GP_TESTSUITE_ENABLE
+#ifdef WITH_GP_TESTS
 #include <tee_api_types.h>
 #include <TTA_DS_protocol.h>
 #endif
@@ -78,6 +78,6 @@
 const TEEC_UUID sims_test_ta_uuid = TA_SIMS_TEST_UUID;
 const TEEC_UUID storage_ta_uuid = TA_STORAGE_UUID;
 const TEEC_UUID enc_fs_key_manager_test_ta_uuid = ENC_FS_KEY_MANAGER_TEST_UUID;
-#ifdef CFG_GP_TESTSUITE_ENABLE
+#ifdef WITH_GP_TESTS
 const TEEC_UUID gp_tta_ds_uuid = TA_TTA_DS_UUID;
 #endif
diff --git a/host/xtest/xtest_test.h b/host/xtest/xtest_test.h
index 1de5058..7e0269b 100644
--- a/host/xtest/xtest_test.h
+++ b/host/xtest/xtest_test.h
@@ -53,7 +53,7 @@
 ADBG_CASE_DECLARE(XTEST_TEE_6007);
 ADBG_CASE_DECLARE(XTEST_TEE_6008);
 ADBG_CASE_DECLARE(XTEST_TEE_6009);
-#ifdef CFG_GP_TESTSUITE_ENABLE
+#ifdef WITH_GP_TESTS
 ADBG_CASE_DECLARE(XTEST_TEE_6010);
 ADBG_CASE_DECLARE(XTEST_TEE_6011);
 #endif
@@ -76,7 +76,7 @@
 ADBG_CASE_DECLARE(XTEST_TEE_10001);
 ADBG_CASE_DECLARE(XTEST_TEE_10002);
 
-#ifdef CFG_GP_TESTSUITE_ENABLE
+#ifdef WITH_GP_TESTS
 #include "adbg_case_declare.h"
 ADBG_CASE_DECLARE_AUTO_GENERATED_TESTS()
 #endif