From: Peter Johnson Date: Tue, 18 Sep 2001 22:06:09 +0000 (-0000) Subject: Print the test function name along with the test case name. Many of our X-Git-Tag: v0.1.0~324 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fb1246f7618c7b036f9ee4cb1c5e1de7c9ac8d29;p=yasm Print the test function name along with the test case name. Many of our functions are so small that it doesn't make sense to have a test case for every function (rather just a test function for every function). svn path=/trunk/yasm/; revision=194 --- diff --git a/check/check_impl.h b/check/check_impl.h index bca52c61..1fd74208 100644 --- a/check/check_impl.h +++ b/check/check_impl.h @@ -59,6 +59,7 @@ struct TestResult { char *file; /* File where the test occured */ int line; /* Line number where the test occurred */ char *tcname; /* Test case that generated the result */ + char *tfname; /* Test function that generated the result */ char *msg; /* Failure message */ }; diff --git a/check/check_print.c b/check/check_print.c index 31de5b9d..85fd44af 100644 --- a/check/check_print.c +++ b/check/check_print.c @@ -71,9 +71,10 @@ void tr_fprint (FILE *file, TestResult *tr, int print_mode) exact_msg = (tr->rtype == CRERROR) ? "(after this point) ": ""; if ((print_mode >= CRVERBOSE && tr->rtype == CRPASS) || (tr->rtype != CRPASS && print_mode >= CRNORMAL)) { - fprintf (file, "%s:%d:%s:%s: %s%s\n", + fprintf (file, "%s:%d:%s:%s:%s: %s%s\n", tr->file, tr->line, rtype_to_string(tr->rtype), tr->tcname, + tr->tfname, exact_msg, tr->msg); } } diff --git a/check/check_run.c b/check/check_run.c index 6a2462f2..96601b4c 100644 --- a/check/check_run.c +++ b/check/check_run.c @@ -34,7 +34,8 @@ static void srunner_run_tcase (SRunner *sr, TCase *tc); static void srunner_add_failure (SRunner *sr, TestResult *tf); static TestResult *tfun_run (int msqid, char *tcname, TF *tf); -static TestResult *receive_result_info (int msqid, int status, char *tcname); +static TestResult *receive_result_info (int msqid, int status, char *tcname, + char *tfname); static void receive_last_loc_info (int msqid, TestResult *tr); static void receive_failure_info (int msqid, int status, TestResult *tr); static List *srunner_resultlst (SRunner *sr); @@ -209,11 +210,13 @@ static void receive_failure_info (int msqid, int status, TestResult *tr) } } -static TestResult *receive_result_info (int msqid, int status, char *tcname) +static TestResult *receive_result_info (int msqid, int status, char *tcname, + char *tfname) { TestResult *tr = emalloc (sizeof(TestResult)); tr->tcname = tcname; + tr->tfname = tfname; receive_last_loc_info (msqid, tr); receive_failure_info (msqid, status, tr); return tr; @@ -232,7 +235,7 @@ static TestResult *tfun_run (int msqid, char *tcname, TF *tfun) _exit(EXIT_SUCCESS); } (void) wait(&status); - return receive_result_info(msqid, status, tcname); + return receive_result_info(msqid, status, tcname, tfun->name); }