Support for combine tests archive
diff --git a/api-tests/val/common/val.h b/api-tests/val/common/val.h
index 04e67bf..de9cd8c 100644
--- a/api-tests/val/common/val.h
+++ b/api-tests/val/common/val.h
@@ -52,6 +52,9 @@
 #define FALSE 1
 #endif
 
+#define _CONCAT(A,B) A##B
+#define CONCAT(A,B) _CONCAT(A,B)
+
 /* test status defines */
 #define TEST_START                 0x01
 #define TEST_END                   0x02
@@ -87,7 +90,7 @@
 
 /* Test Defines */
 #define TEST_PUBLISH(test_id, entry) \
-   const val_test_info_t __attribute__((section(".acs_test_info"))) acs_test_info = {test_id, entry}
+   const val_test_info_t __attribute__((section(".acs_test_info"))) CONCAT(acs_test_info, entry) = {test_id, entry}
 
 #define VAL_MAX_TEST_PER_COMP           200
 #define VAL_FF_BASE                     0
diff --git a/api-tests/val/nspe/val_dispatcher.c b/api-tests/val/nspe/val_dispatcher.c
index ae222cb..bfa74bb 100644
--- a/api-tests/val/nspe/val_dispatcher.c
+++ b/api-tests/val/nspe/val_dispatcher.c
@@ -126,6 +126,7 @@
 **/
 val_status_t val_test_load(test_id_t *test_id, test_id_t test_id_prev)
 {
+#ifndef TEST_COMBINE_ARCHIVE
     test_header_t   test_header;
     addr_t          flash_addr = combine_test_binary_addr;
 
@@ -214,6 +215,41 @@
 
     *test_id = test_header.test_id;
     return VAL_STATUS_SUCCESS;
+
+#else /* TEST_COMBINE_ARCHIVE */
+
+    int             i;
+    val_test_info_t test_list[] = {
+#include "test_entry_list.inc"
+                                  {VAL_INVALID_TEST_ID, NULL}
+                                  };
+
+    for (i = 0; i < (sizeof(test_list)/sizeof(test_list[0])); i++)
+    {
+        if (test_id_prev == VAL_INVALID_TEST_ID)
+        {
+            *test_id = test_list[i].test_id;
+            g_test_info_addr = (addr_t) test_list[i].entry_addr;
+            return VAL_STATUS_SUCCESS;
+        }
+        else if (test_id_prev == test_list[i].test_id)
+        {
+            *test_id = test_list[i+1].test_id;
+            g_test_info_addr = (addr_t) test_list[i+1].entry_addr;
+            return VAL_STATUS_SUCCESS;
+        }
+        else if (test_list[i].test_id == VAL_INVALID_TEST_ID)
+        {
+            val_print(PRINT_DEBUG, "\n\nNo more valid tests found. Exiting.", 0);
+            *test_id = VAL_INVALID_TEST_ID;
+            return VAL_STATUS_SUCCESS;
+        }
+    }
+
+    *test_id = VAL_INVALID_TEST_ID;
+    val_print(PRINT_ERROR, "\n\nError: No more valid tests found. Exiting.", 0);
+    return VAL_STATUS_LOAD_ERROR;
+#endif /* TEST_COMBINE_ARCHIVE */
 }
 
 /**
@@ -224,7 +260,11 @@
 **/
 val_status_t val_get_test_entry_addr(addr_t *paddr)
 {
+#ifndef TEST_COMBINE_ARCHIVE
     *paddr = (addr_t)(((val_test_info_t *)g_test_info_addr)->entry_addr);
+#else
+    *paddr = g_test_info_addr;
+#endif
     return VAL_STATUS_SUCCESS;
 }
 
diff --git a/api-tests/val/nspe/val_interfaces.h b/api-tests/val/nspe/val_interfaces.h
index 9d653f4..ce9b3a1 100644
--- a/api-tests/val/nspe/val_interfaces.h
+++ b/api-tests/val/nspe/val_interfaces.h
@@ -76,6 +76,7 @@
     test_fptr_t   entry_addr;
 } val_test_info_t;
 
+#include "test_entry_fn_declare_list.inc"
 void test_entry(val_api_t *val, psa_api_t *psa);
 void test_payload(val_api_t *val, psa_api_t *psa);