Gilles Carry wrote:
> From: gilles.carry <[EMAIL PROTECTED]>
> 
> Dump tests results into XML file.
> ---
>  testcases/realtime/func/matrix_mult/matrix_mult.c |   35 
> ++++++++++++++++++++-
>  1 files changed, 34 insertions(+), 1 deletions(-)
> 
> diff --git a/testcases/realtime/func/matrix_mult/matrix_mult.c 
> b/testcases/realtime/func/matrix_mult/matrix_mult.c
> index 53184e0..c9e3dac 100644
> --- a/testcases/realtime/func/matrix_mult/matrix_mult.c
> +++ b/testcases/realtime/func/matrix_mult/matrix_mult.c
> @@ -203,6 +203,7 @@ void main_thread(void)
>       long smin = 0, smax = 0, cmin = 0, cmax = 0, delta = 0;
>       float savg, cavg;
>       int cpuid;
> +     FILE    *fd;
> 
>       if (    stats_container_init(&sdat, iterations) ||
>               stats_container_init(&shist, HIST_BUCKETS) ||
> @@ -319,6 +320,34 @@ void main_thread(void)
>               criteria);
>       printf("Result: %s\n", ret ? "FAIL" : "PASS");
> 
> +     if (! xml_dump)
> +             return;
> +
> +     /* XML dump */
> +     fd = xml_dump_init("matrix_mult_result.xml", "ltp-result", 
> "sequential");
> +     if (!fd) {
> +             fprintf(stderr, "Warning: could not save results as xml\n");
> +             return;
> +     }
> +     fprintf(fd, "<sequential>\n");

So I think with some specific XML functions in the stats lib that people 
would expect some higher level interface.  If the test writer has to 
explicitly write all the xml tags, I don't see what the value of having 
XML in the names of any of the libstats calls...

> +     fprintf(fd, "\t<min>%ld</min>\n",smin);
> +     fprintf(fd, "\t<max>%ld</max>\n",smax);
> +     fprintf(fd, "\t<avg>%.4f</avg>\n",savg);
> +     fprintf(fd, "\t<stddev>%.4f</stddev>\n",stats_stddev(&sdat));
> +     fprintf(fd, "</sequential>\n");
> +     fprintf(fd, "<concurrent>\n");
> +     fprintf(fd, "\t<min>%ld</min>\n",cmin);
> +     fprintf(fd, "\t<max>%ld</max>\n",cmax);
> +     fprintf(fd, "\t<avg>%.4f</avg>\n",cavg);
> +     fprintf(fd, "\t<stddev>%.4f</stddev>\n",stats_stddev(&cdat));
> +     fprintf(fd, "</concurrent>\n");
> +     fprintf(fd, "<ratio>\n");
> +     fprintf(fd, "\t<min>%.4f</min>\n",(float)smin/cmin);
> +     fprintf(fd, "\t<max>%.4f</max>\n",(float)smax/cmax);
> +     fprintf(fd, "\t<avg>%.4f</avg>\n",(float)savg/cavg);
> +     fprintf(fd, "</ratio>\n");
> +     xml_dump_close (fd, "ltp-result");
> +
>       return;
>  }
> 
> @@ -326,7 +355,11 @@ int main(int argc, char *argv[])
>  {
>       setup();
>       pass_criteria = PASS_CRITERIA;
> -     rt_init("jl:i:h", parse_args, argc, argv);
> +     test_name = "matrix_mult";
> +     if (rt_init("jl:i:h", parse_args, argc, argv)) {
> +             usage();
> +             exit(1);
> +     }
>       numcpus = sysconf(_SC_NPROCESSORS_ONLN);
>       /* the minimum avg concurrent multiplier to pass */
>       criteria = pass_criteria * numcpus;


-- 
Darren Hart
IBM Linux Technology Center
Real-Time Linux Team


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to