Move helper testing functions to tests/src/helpers.c

Moves the functions `test_fail`, `test_set_step`, `test_skip` and the struct
`test_info` from `tests/suites/helpers.function` to `tests/src/helpers.*`.
This is done to open these functions up to the API where they can be used by
other functions in the 'src' test infrastructure module.

As the functions are now contained within the src folder of the testing
infrastructure, the `mbedtls_` prefix has been added to the functions.

Signed-off-by: Chris Jones <christopher.jones@arm.com>
diff --git a/tests/src/helpers.c b/tests/src/helpers.c
index a18f1d4..a2f9c3f 100644
--- a/tests/src/helpers.c
+++ b/tests/src/helpers.c
@@ -44,6 +44,8 @@
 static mbedtls_platform_context platform_ctx;
 #endif
 
+test_info_t test_info;
+
 /*----------------------------------------------------------------------------*/
 /* Helper Functions */
 
@@ -77,6 +79,33 @@
     return( 0 );
 }
 
+void mbedtls_test_fail( const char *test, int line_no, const char* filename )
+{
+    if( test_info.result == TEST_RESULT_FAILED )
+    {
+        /* We've already recorded the test as having failed. Don't
+         * overwrite any previous information about the failure. */
+        return;
+    }
+    test_info.result = TEST_RESULT_FAILED;
+    test_info.test = test;
+    test_info.line_no = line_no;
+    test_info.filename = filename;
+}
+
+void mbedtls_test_set_step( unsigned long step )
+{
+    test_info.step = step;
+}
+
+void mbedtls_test_skip( const char *test, int line_no, const char* filename )
+{
+    test_info.result = TEST_RESULT_SKIPPED;
+    test_info.test = test;
+    test_info.line_no = line_no;
+    test_info.filename = filename;
+}
+
 int mbedtls_test_unhexify( unsigned char *obuf,
                            size_t obufmax,
                            const char *ibuf,