]> granicus.if.org Git - yasm/commitdiff
Print the test function name along with the test case name. Many of our
authorPeter Johnson <peter@tortall.net>
Tue, 18 Sep 2001 22:06:09 +0000 (22:06 -0000)
committerPeter Johnson <peter@tortall.net>
Tue, 18 Sep 2001 22:06:09 +0000 (22:06 -0000)
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

check/check_impl.h
check/check_print.c
check/check_run.c

index bca52c61ea56830014f501877581bcdd7aa1686d..1fd74208c0d1f56591ab8086d2bda3876c88fbdc 100644 (file)
@@ -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 */
 };
 
index 31de5b9db0d7b810dde516eebe526e82693ee006..85fd44af1804ca1a28a240dec0deee61dcc2073b 100644 (file)
@@ -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);
   }
 }
index 6a2462f2bfc7b08a33cd6d5caa6d5bbc6f6a511a..96601b4c5851242745be136721e8fd08150908d5 100644 (file)
@@ -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);
 }