Gaurd test suite headers with suite dependency

Test suite header code was not gaurded with test suite dependency.
But some test suites have additional code in the headers section.
Variables in that section become unused if suite functions are
gaurded. Hence gaurded the headers section.
But this changed cuased missing types in get_expression() function
that was originally accessing types defined through suite headers.
Hence had to gaurd expressions code as well.
Gaurding expressions does not allow parsing the parameters when
some types or hash defs are gaurded. Hence added function
check_test() to check if test is allowed or not before parsing the
parameters.
diff --git a/tests/suites/desktop_test.function b/tests/suites/desktop_test.function
index 9c9a0b2..4c790a8 100644
--- a/tests/suites/desktop_test.function
+++ b/tests/suites/desktop_test.function
@@ -389,6 +389,7 @@
     const char **test_files = NULL;
     int testfile_count = 0;
     int option_verbose = 0;
+    int function_id = 0;
 
     /* Other Local variables */
     int arg_index = 1;
@@ -562,11 +563,14 @@
                 }
 #endif /* __unix__ || __APPLE__ __MACH__ */
 
-                ret = convert_params( cnt - 1, params + 1, int_params );
-                if ( DISPATCH_TEST_SUCCESS == ret )
+                function_id = strtol( params[0], NULL, 10 );
+                if ( (ret = check_test( function_id )) == DISPATCH_TEST_SUCCESS )
                 {
-                    int function_id = strtol( params[0], NULL, 10 );
-                    ret = dispatch_test( function_id, (void **)( params + 1 ) );
+                    ret = convert_params( cnt - 1, params + 1, int_params );
+                    if ( DISPATCH_TEST_SUCCESS == ret )
+                    {
+                        ret = dispatch_test( function_id, (void **)( params + 1 ) );
+                    }
                 }
 
 #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
diff --git a/tests/suites/embedded_test.function b/tests/suites/embedded_test.function
index 4436ccb..312cf91 100644
--- a/tests/suites/embedded_test.function
+++ b/tests/suites/embedded_test.function
@@ -371,6 +371,8 @@
             /* Read function id */
             function_id = *p;
             INCR_ASSERT( p, data, data_len, sizeof( uint8_t ) );
+            if ( ( ret = check_test( function_id ) ) != DISPATCH_TEST_SUCCESS )
+                break;
 
             /* Read number of parameters */
             count = *p;
diff --git a/tests/suites/main_test.function b/tests/suites/main_test.function
index 0dcab7d..e294e36 100644
--- a/tests/suites/main_test.function
+++ b/tests/suites/main_test.function
@@ -40,8 +40,6 @@
 
 #define TEST_SUITE_ACTIVE
 
-{function_headers}
-
 {functions_code}
 
 #line {line_no} "suites/main_test.function"
@@ -151,6 +149,35 @@
 }}
 
 
+/**
+ * \brief       Checks if test function is supported
+ *
+ * \param exp_id    Test function index.
+ *
+ * \return       DISPATCH_TEST_SUCCESS if found
+ *               DISPATCH_TEST_FN_NOT_FOUND if not found
+ *               DISPATCH_UNSUPPORTED_SUITE if not compile time enabled.
+ */
+int check_test( int func_idx )
+{{
+    int ret = DISPATCH_TEST_SUCCESS;
+    TestWrapper_t fp = NULL;
+
+    if ( func_idx < (int)( sizeof(test_funcs)/sizeof( TestWrapper_t ) ) )
+    {{
+        fp = test_funcs[func_idx];
+        if ( fp == NULL )
+            ret = ( DISPATCH_UNSUPPORTED_SUITE );
+    }}
+    else
+    {{
+        ret = ( DISPATCH_TEST_FN_NOT_FOUND );
+    }}
+
+    return( ret );
+}}
+
+
 {platform_code}
 
 #line {line_no} "suites/main_test.function"