int check_minor_version = CHECK_MINOR_VERSION;
int check_micro_version = CHECK_MICRO_VERSION;
+const char* current_test_name = NULL;
+
static int non_pass(int val);
static Fixture *fixture_create(SFun fun, int ischecked);
static void tcase_add_fixture(TCase * tc, SFun setup, SFun teardown,
#endif /* HAVE_FORK */
}
-void tcase_fn_start(const char *fname CK_ATTRIBUTE_UNUSED, const char *file,
+void tcase_fn_start(const char *fname, const char *file,
int line)
{
send_ctx_info(CK_CTX_TEST);
send_loc_info(file, line);
+
+ current_test_name = fname;
+}
+
+const char* tcase_name()
+{
+ return current_test_name;
}
void _mark_point(const char *file, int line)
CK_DLL_EXP void CK_EXPORT tcase_fn_start(const char *fname, const char *file,
int line);
+/**
+ * Retreive the name of the current running test. This is the name
+ * of the test passed to START_TEST. This is only valid when called
+ * from a running test. The value return outside of a running test is
+ * undefined.
+ *
+ * @since 0.11.0
+ */
+CK_DLL_EXP const char* CK_EXPORT tcase_name();
+
/**
* Start a unit test with START_TEST(unit_name), end with END_TEST.
*