This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 4c3c5c53d86f3703ae383dd8ca9d500836018e91 (commit) from c5456e61ba0c97fa143aca16463e9bd6d8e05468 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/4c3c5c53d86f3703ae383dd8ca9d500836018...
commit 4c3c5c53d86f3703ae383dd8ca9d500836018e91 Author: Cyril Hrubis metan@ucw.cz Date: Sun Aug 12 16:48:12 2012 +0200
tests: Edhance the html report.
diff --git a/tests/framework/tst_job.c b/tests/framework/tst_job.c index 34e0357..241e0fe 100644 --- a/tests/framework/tst_job.c +++ b/tests/framework/tst_job.c @@ -46,8 +46,8 @@ static void start_test(struct tst_job *job) // fprintf(stderr, "Starting test e[1;37m%se[0mn", job->test->name); }
-static void to_time(int *sec, int *nsec, struct timespec *start, - struct timespec *stop) +void tst_diff_timespec(int *sec, int *nsec, struct timespec *start, + struct timespec *stop) { if (stop->tv_nsec < start->tv_nsec) { *sec = stop->tv_sec - start->tv_sec - 1; @@ -64,7 +64,7 @@ static void stop_test(struct tst_job *job) int sec, nsec; const char *result = "";
- to_time(&sec, &nsec, &job->start_time, &job->stop_time); + tst_diff_timespec(&sec, &nsec, &job->start_time, &job->stop_time);
switch (job->result) { case TST_SUCCESS: @@ -87,11 +87,12 @@ static void stop_test(struct tst_job *job) break; } - fprintf(stderr, "Test e[1;37m%se[0m finished with %s " - "(duration %i.%09is, cputime %i.%09is)n", - name, result, sec, nsec, + fprintf(stderr, "e[1;37m%se[0m finished " + "(Time %i.%03is, CPU %i.%03is) %sn", + name, sec, nsec/1000000, (int)job->cpu_time.tv_sec, - (int)job->cpu_time.tv_nsec); + (int)job->cpu_time.tv_nsec/1000000, + result);
if (job->result == TST_MEMLEAK) tst_malloc_print(&job->malloc_stats); diff --git a/tests/framework/tst_job.h b/tests/framework/tst_job.h index c18cae8..bdc9ed8 100644 --- a/tests/framework/tst_job.h +++ b/tests/framework/tst_job.h @@ -86,4 +86,7 @@ void tst_job_run(struct tst_job *job); */ void tst_job_wait(struct tst_job *job);
+void tst_diff_timespec(int *sec, int *nsec, struct timespec *start, + struct timespec *stop); + #endif /* TST_JOB_H */ diff --git a/tests/framework/tst_log.c b/tests/framework/tst_log.c index 7277d3a..578c960 100644 --- a/tests/framework/tst_log.c +++ b/tests/framework/tst_log.c @@ -23,6 +23,7 @@ #include "tst_test.h" #include "tst_job.h" #include "tst_msg.h" +#include "tst_preload.h" #include "tst_log.h"
static const char *ret_to_bg_color(enum tst_ret ret) @@ -69,23 +70,94 @@ static const char *ret_to_str(enum tst_ret ret) return "Unknown"; }
+static void malloc_stats_html(struct tst_job *job, FILE *f, const char *padd) +{ + /* Create innter table */ + fprintf(f, "%s<tr>n", padd); + fprintf(f, "%s <td bgcolor="#ffffcc" colspan="3">n", padd); + fprintf(f, "%s <center>n", padd); + fprintf(f, "%s <table>n", padd); + + /* Create header */ + fprintf(f, "%s <tr>n", padd); + + fprintf(f, "%s <td bgcolor="#ffffaa">n", padd); + fprintf(f, "%s <small>Total size</small>n", padd); + fprintf(f, "%s </td>n", padd); + + fprintf(f, "%s <td bgcolor="#ffffaa">n", padd); + fprintf(f, "%s <small>Total chunks</small>n", padd); + fprintf(f, "%s </td>n", padd); + + fprintf(f, "%s <td bgcolor="#ffffaa">n", padd); + fprintf(f, "%s <small>Lost size</small>n", padd); + fprintf(f, "%s </td>n", padd); + + fprintf(f, "%s <td bgcolor="#ffffaa">n", padd); + fprintf(f, "%s <small>Lost chunks</small>n", padd); + fprintf(f, "%s </td>n", padd); + + fprintf(f, "%s </tr>n", padd); + + /* Create data */ + fprintf(f, "%s <tr>n", padd); + + fprintf(f, "%s <td bgcolor="#ffffaa">n", padd); + fprintf(f, "%s <center><small>%zu</small></center>n", + padd, job->malloc_stats.total_size); + fprintf(f, "%s </td>n", padd); + + fprintf(f, "%s <td bgcolor="#ffffaa">n", padd); + fprintf(f, "%s <center><small>%u</small></center>n", + padd, job->malloc_stats.total_chunks); + fprintf(f, "%s </td>n", padd); + + fprintf(f, "%s <td bgcolor="#ffffaa">n", padd); + fprintf(f, "%s <center><small>%zu</small></center>n", + padd, job->malloc_stats.lost_size); + fprintf(f, "%s </td>n", padd); + + fprintf(f, "%s <td bgcolor="#ffffaa">n", padd); + fprintf(f, "%s <center><small>%u</small></center>n", + padd, job->malloc_stats.lost_chunks); + fprintf(f, "%s </td>n", padd); + + fprintf(f, "%s </tr>n", padd); + + fprintf(f, "%s </table>n", padd); + fprintf(f, "%s </center>n", padd); + fprintf(f, "%s </td>n", padd); + fprintf(f, "%s</tr>n", padd); +} + static int append_html(struct tst_job *job, FILE *f) { const char *padd = " "; + int sec, nsec; + + tst_diff_timespec(&sec, &nsec, &job->start_time, &job->stop_time);
fprintf(f, "%s<tr>n", padd); - fprintf(f, "%s <td colspan=2 bgcolor="#ccccee">%s</td>n", padd, job->test->name); - fprintf(f, "%s <td bgcolor="%s"><font color="white">%s</td>n", padd, + fprintf(f, "%s <td bgcolor="#ccccee">%s </td>n", padd, job->test->name); + fprintf(f, "%s <td bgcolor="#ccccee">n", padd); + fprintf(f, "%s <small><font color="#222">%i.%03is %i.%03is</font></small>", + padd, sec, nsec/1000000, (int)job->cpu_time.tv_sec, (int)job->cpu_time.tv_nsec/1000000); + fprintf(f, "%s </td>n", padd); + fprintf(f, "%s <td bgcolor="%s"><center><font color="white"> %s </td></center>n", padd, ret_to_bg_color(job->result), ret_to_str(job->result));
struct tst_msg *msg;
+ /* If calculated include malloc report */ + if (job->test->flags & TST_MALLOC_CHECK) + malloc_stats_html(job, f, padd); + for (msg = job->store.first; msg != NULL; msg = msg->next) { - fprintf(f, "%s<tr>", padd); - fprintf(f, "%s <td colspan="3" bgcolor="#eeeeee">", padd); - fprintf(f, "%s %s", padd, msg->msg); - fprintf(f, "%s </td>", padd); - fprintf(f, "%s</tr>", padd); + fprintf(f, "%s<tr>n", padd); + fprintf(f, "%s <td colspan="3" bgcolor="#eeeeee">n", padd); + fprintf(f, "%s <small>%s</small>n", padd, msg->msg); + fprintf(f, "%s </td>n", padd); + fprintf(f, "%s</tr>n", padd); }
fprintf(f, "%s</tr>n", padd); @@ -115,10 +187,16 @@ FILE *open_html(const struct tst_suite *suite, const char *path) if (f == NULL) return NULL;
- fprintf(f, "<html>n <head>n </head>n <body>n <table>n"); + fprintf(f, "<html>n <head>n </head>n <body>n <table bgcolor="#99a">n"); + + fprintf(f, " <tr><td colspan="3" bgcolor="#bbbbff"><center><b>%s" + "</b></center></td></tr>n", suite->suite_name);
- fprintf(f, " <tr><td colspan="3" bgcolor="#bbbbff"><b>%s" - "</b></td></tr>n", suite->suite_name); + fprintf(f, " <tr>n"); + fprintf(f, " <td bgcolor="#eee"><center>Test Name</center></td>n"); + fprintf(f, " <td bgcolor="#eee"><center>Time/CPU</center></td>n"); + fprintf(f, " <td bgcolor="#eee"><center>Result</center></td>n"); + fprintf(f, " </tr>n");
return f; }
-----------------------------------------------------------------------
Summary of changes: tests/framework/tst_job.c | 15 ++++--- tests/framework/tst_job.h | 3 + tests/framework/tst_log.c | 98 ++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 99 insertions(+), 17 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.