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/Makefile b/Makefile
index 91dee97..ed60d48 100644
--- a/Makefile
+++ b/Makefile
@@ -36,7 +36,7 @@
 
 .PHONY: patch
 patch:
-ifeq ($(CFG_GP_TESTSUITE_ENABLE),y)
+ifdef CFG_GP_PACKAGE_PATH
 CFG_GP_API?=1.0
 CFG_GP_XSL_PACKAGE_PATH?=$(CURDIR)/package/testsuite/global_platform/api_1.0/GP_XSL_TEE_Initial_Configuration-Test_Suite_v1_0_0-2014-12-03-STM
 
@@ -254,5 +254,5 @@
 
 else
 patch:
-	$(q) echo "Please define CFG_GP_TESTSUITE_ENABLE=y" && false
+	$(q) echo "Please define CFG_GP_PACKAGE_PATH" && false
 endif
diff --git a/README.md b/README.md
index 01875dd..8921a9e 100644
--- a/README.md
+++ b/README.md
@@ -43,7 +43,6 @@
 Standard tests can be extended with the Global Platform test suite.
 The user must only:
 * Install the Global Platform `xml` files in `$CFG_GP_PACKAGE_PATH`
-* set `CFG_GP_TESTSUITE_ENABLE=y`
 * Run `make patch` (or call make `xtest-patch` from the `build` repository)
   before compiling xtest. This must be run a single time after the installation
   of OP-TEE.
@@ -53,7 +52,7 @@
 * Create new tests in `host/xtest`, as for example `xtest_9000.c`
 * Patches `xtest_7000.c`, adding new tests.
 
-Then the tests must be compiled with `CFG_GP_TESTSUITE_ENABLE=y`.
+Then the tests must be compiled with `CFG_GP_PACKAGE_PATH=<path>`.
 
 
 ### HOWTO run xtest
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
diff --git a/ta/Makefile b/ta/Makefile
index 92c9a86..4d68dc4 100644
--- a/ta/Makefile
+++ b/ta/Makefile
@@ -12,7 +12,7 @@
 	   sims \
 	   storage
 
-ifeq ($(CFG_GP_TESTSUITE_ENABLE), y)
+ifdef CFG_GP_PACKAGE_PATH
 TA_DIRS += GP_TTA_Arithmetical \
 	   GP_TTA_Crypto \
 	   GP_TTA_DS \