JUnit Integration

classic Classic list List threaded Threaded
4 messages Options
Tim
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

JUnit Integration

Tim
Hello,

I've written a collection of logging functions that produce JUnit compatible logs (XML) with the further intention to integrate FCTX into Ant and Cruise Control. When complete, would you like the code?

This is a sample of the output:

<testsuite errors="1" failures="0" tests="4" name="libspd_load_spd"> 
        <testcase name="config_error"/> 
        <testcase name="driver_error" > 
                <error message="chq_eq_int: 1 != 0" type="fctx">file:unit_tests/load_dimm_spd.c, line:80</error> 
                <error message="chq_eq_int: 2 != 0" type="fctx">file:unit_tests/load_dimm_spd.c, line:81</error> 
        </testcase> 
        <testcase name="spd_used_size"/> 
        <testcase name="spd_data_transfer_fail"/> 
        <system-out></system-out> 
        <system-err></system-err> 
</testsuite>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: JUnit Integration

Ian Blumel
Administrator
Hi Tim,

Thanks for taking the time to hack on fctx.

2010/3/17 Tim [via fctx] <[hidden email]>:
> I've written a collection of logging functions that produce JUnit compatible
> logs (XML) with the further intention to integrate FCTX into Ant and Cruise Control.
> When complete, would you like the code?

This is great, I am glad you found the "hidden" logger feature. I was
always planning to extend fctx to product XML output, and it looks
like you beat me to it. Not only that you figured out a common
standard for xml.

I just moved my project over to github (http://github.com/imb/fctx). I
can accept a pull request or just a simple patch file. I am pretty
easy going at the moment.

I wonder what the best way to invoke something like this would be? The
way fctx is set up you can write out to multiple loggers. Thus you can
write out to stdout with some 'human readable log', as well as, write
out the xml format in the background.

I was thinking of reserving the --logger option for different types of
stdout loggers. Maybe we can grow a --fxmlout=<path> option?

A few quick uses cases that come to mind are,

  1. No stdout, write to a file.

      test_program.exe --logger=none --fxmlout=/path/to/log.xml

  2. Minimal stdout, write to a file.

      test_program.exe --logger=min --fxmlout=/path/to/log.xml

  3. Default stdout, write to a file

      test_program.exe --fxmlout=/path/to/log.xml

Any other ideas? Please let me know.

If you have a git branch of this code or a partially complete patch,
I'd be glad to help getting this out for an official release. If you
need any additions to the logger interface please let me know.

I just started a ticket in the github tracker:
http://github.com/imb/fctx/issues/#issue/10.

Thanks again for proposal!

--
Ian Blumel
www.wildbearsoftware.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: JUnit Integration

Tim Rule
OK, once I have proved the implementation with Ant and Cruise Control I will try my luck with Git. Probably next week.

I would be inclined to structure the command line like so:

test_program.exe --logger=<log formatter> --file=<file name> --fileformat=<file formatter>

where
<log formatter> = default | short | quiet | junit | xml
<file name> = some file path
<file format> = default | short | junit | xml, and overrides the setting for --logger

However having said that it could be that writing to a file is not so useful. Its easy enough to leave that complexity to a higher component (redirects, scripts, Ant etc) and just leave fctx doing what it does best.

The implementation you have is quite good, so far I don't see any particular limitation to adding the junit logger.

Cheers.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: JUnit Integration

Ian Blumel
Administrator
2010/3/18 Tim Rule [via fctx] <[hidden email]>:
> OK, once I have proved the implementation with Ant and Cruise Control I will try
> my luck with Git. Probably next week.

If you can do it through git that would be great, if not I can just
accept your fct.h file or a patch against the latest. Like I said
before, I am pretty easy going with the patches at the moment.

> I would be inclined to structure the command line like so:
>
> test_program.exe --logger=<log formatter> --file=<file name> --fileformat=<file formatter>
>
> where
> <log formatter> = default | short | quiet | junit | xml
> <file name> = some file path
> <file format> = default | short | junit | xml, and overrides the setting for --logger
>
> However having said that it could be that writing to a file is not so useful. Its easy
>  enough to leave that complexity to a higher component (redirects, scripts, Ant etc)
> and just leave fctx doing what it does best.

Upon further reflection, I agree your right about not worrying about
"file" support and leave that to the callee to deal with through
redirection, etc.

I'll also work on adding the code to let a fctx test app actually pick
a logger. It should be in the master branch within the next week.

Thanks again.

--
Ian Blumel
www.wildbearsoftware.com
Loading...