xtest: distributed registration of cases

Uses distributed registration of test cases, replacing the central
registration in xtest_main.c and xtest_test.h

Updated against GP TestSuite 1.1.0.4.

Remove generation of ADBG_CASE_DECLARE() and ADBG_SUITE_ENTRY()
code during 'patch' make rule. Remove related resources that are no
more useful. adbg_entry_declare.h and adbg_case_declare.h are no more
generated.

Change rule 'patch-filter' to comment definition of filtered tests
from their ADBG_CASE_DEFINE() implementation.

Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (GP suite: QEMU, stm/b2260)
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU)
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
diff --git a/Makefile b/Makefile
index 617d9b0..d689a86 100644
--- a/Makefile
+++ b/Makefile
@@ -129,8 +129,6 @@
 	$(q) mkdir -p ${GP_XTEST_IN_DIR} ${GP_XTEST_IN_DIR}
 	$(q)find ${CFG_GP_PACKAGE_PATH}/packages -type f -name "*.xml" -exec cp -p {} ${GP_XTEST_IN_DIR} \;
 	$(q)find ${CFG_GP_XSL_PACKAGE_PATH}/packages -type f -name "*.xsl" -exec cp -p {} ${GP_XTEST_IN_DIR} \;
-	$(call patch-xalan,TEE.xml,adbg_case_declare.xsl,adbg_case_declare.h)
-	$(call patch-xalan,TEE.xml,adbg_entry_declare.xsl,adbg_entry_declare.h)
 	$(call patch-xalan,TEE.xml,TEE.xsl,xtest_7000_gp.c)
 	$(call patch-xalan,TEE_DataStorage_API.xml,TEE_DataStorage_API.xsl,xtest_7500.c)
 	$(call patch-xalan,TEE_Internal_API.xml,TEE_Internal_API.xsl,xtest_8000.c)
@@ -199,66 +197,60 @@
 	$(call patch-file,${CFG_GP_PACKAGE_PATH}/TTAs/TTA_Time/TTA_Time/code_files/TTA_Time.c,${CFG_GP_XSL_PACKAGE_PATH}/TTAs/TTA_Time/code_patches/v1_1_0_4-2014_11_07/TTA_Time.c.patch)
 
 define patch-filter-one
-	$(q)sed -i 's|^ADBG_SUITE_ENTRY(XTEST_TEE_'${1}')|/\*ADBG_SUITE_ENTRY(XTEST_TEE_'${1}')\*/|g' ${GP_XTEST_OUT_DIR}/xtest_main.c
-	$(q)sed -i 's|    ADBG_SUITE_ENTRY(XTEST_TEE_'${1}')\\|    /\*ADBG_SUITE_ENTRY(XTEST_TEE_'${1}')\*/\\|g' ${GP_XTEST_OUT_DIR}/adbg_entry_declare.h
+	$(q)sed -i 's|^\(ADBG_CASE_DEFINE(regression,\) $1,\(.*\)$$|/\*\1 $1,\2\*/|g' ${GP_XTEST_OUT_DIR}/$2
 endef
 
 .PHONY: patch-filter
 patch-filter:
 	@echo "INFO: Filter some tests"
-	$(call patch-filter-one,7038)
-	$(call patch-filter-one,7522)
-	$(call patch-filter-one,7538)
-	$(call patch-filter-one,7540)
-	$(call patch-filter-one,7546)
-	$(call patch-filter-one,7557)
-	$(call patch-filter-one,7522)
-	$(call patch-filter-one,7538)
-	$(call patch-filter-one,7540)
-	$(call patch-filter-one,7546)
-	$(call patch-filter-one,7557)
-	$(call patch-filter-one,7559)
-	$(call patch-filter-one,7577)
-	$(call patch-filter-one,7641)
-	$(call patch-filter-one,7642)
-	$(call patch-filter-one,7643)
-	$(call patch-filter-one,7644)
-	$(call patch-filter-one,7686)
-	$(call patch-filter-one,8025)
-	$(call patch-filter-one,8058)
-	$(call patch-filter-one,8059)
-	$(call patch-filter-one,8030)
-	$(call patch-filter-one,8066)
-	$(call patch-filter-one,8614)
-	$(call patch-filter-one,8643)
-	$(call patch-filter-one,8644)
-	$(call patch-filter-one,8673)
-	$(call patch-filter-one,8674)
-	$(call patch-filter-one,9001)
-	$(call patch-filter-one,9072)
-	$(call patch-filter-one,9073)
-	$(call patch-filter-one,9075)
-	$(call patch-filter-one,9079)
-	$(call patch-filter-one,9080)
-	$(call patch-filter-one,9082)
-	$(call patch-filter-one,9085)
-	$(call patch-filter-one,9086)
-	$(call patch-filter-one,9088)
-	$(call patch-filter-one,9090)
-	$(call patch-filter-one,9091)
-	$(call patch-filter-one,9093)
-	$(call patch-filter-one,9095)
-	$(call patch-filter-one,9096)
-	$(call patch-filter-one,9098)
-	$(call patch-filter-one,9099)
-	$(call patch-filter-one,9109)
-	$(call patch-filter-one,9110)
-	$(call patch-filter-one,9160)
-	$(call patch-filter-one,9174)
-	$(call patch-filter-one,9195)
-	$(call patch-filter-one,9196)
-	$(call patch-filter-one,9204)
-	$(call patch-filter-one,9239)
+	$(call patch-filter-one,7038,xtest_7000_gp.c)
+	$(call patch-filter-one,7522,xtest_7500.c)
+	$(call patch-filter-one,7538,xtest_7500.c)
+	$(call patch-filter-one,7540,xtest_7500.c)
+	$(call patch-filter-one,7546,xtest_7500.c)
+	$(call patch-filter-one,7557,xtest_7500.c)
+	$(call patch-filter-one,7559,xtest_7500.c)
+	$(call patch-filter-one,7577,xtest_7500.c)
+	$(call patch-filter-one,7641,xtest_7500.c)
+	$(call patch-filter-one,7642,xtest_7500.c)
+	$(call patch-filter-one,7643,xtest_7500.c)
+	$(call patch-filter-one,7644,xtest_7500.c)
+	$(call patch-filter-one,7686,xtest_7500.c)
+	$(call patch-filter-one,8025,xtest_8000.c)
+	$(call patch-filter-one,8030,xtest_8000.c)
+	$(call patch-filter-one,8058,xtest_8000.c)
+	$(call patch-filter-one,8059,xtest_8000.c)
+	$(call patch-filter-one,8066,xtest_8000.c)
+	$(call patch-filter-one,8614,xtest_8500.c)
+	$(call patch-filter-one,8643,xtest_8500.c)
+	$(call patch-filter-one,8644,xtest_8500.c)
+	$(call patch-filter-one,8673,xtest_8500.c)
+	$(call patch-filter-one,8674,xtest_8500.c)
+	$(call patch-filter-one,9001,xtest_9000.c)
+	$(call patch-filter-one,9072,xtest_9000.c)
+	$(call patch-filter-one,9073,xtest_9000.c)
+	$(call patch-filter-one,9075,xtest_9000.c)
+	$(call patch-filter-one,9079,xtest_9000.c)
+	$(call patch-filter-one,9080,xtest_9000.c)
+	$(call patch-filter-one,9082,xtest_9000.c)
+	$(call patch-filter-one,9085,xtest_9000.c)
+	$(call patch-filter-one,9086,xtest_9000.c)
+	$(call patch-filter-one,9088,xtest_9000.c)
+	$(call patch-filter-one,9090,xtest_9000.c)
+	$(call patch-filter-one,9091,xtest_9000.c)
+	$(call patch-filter-one,9093,xtest_9000.c)
+	$(call patch-filter-one,9095,xtest_9000.c)
+	$(call patch-filter-one,9096,xtest_9000.c)
+	$(call patch-filter-one,9098,xtest_9000.c)
+	$(call patch-filter-one,9099,xtest_9000.c)
+	$(call patch-filter-one,9109,xtest_9000.c)
+	$(call patch-filter-one,9110,xtest_9000.c)
+	$(call patch-filter-one,9160,xtest_9000.c)
+	$(call patch-filter-one,9174,xtest_9000.c)
+	$(call patch-filter-one,9195,xtest_9000.c)
+	$(call patch-filter-one,9196,xtest_9000.c)
+	$(call patch-filter-one,9204,xtest_9000.c)
+	$(call patch-filter-one,9239,xtest_9000.c)
 
 .PHONY: patch
 patch: patch-openssl patch-generate-host patch-generate-ta