Hi,
I am really happy to see test coming in osg. I have some for osgAnimation on my branch, but a bit more intrusiv because it needs external tools like lcov, unittest++

Cheers,
Cedric

Jean-Sébastien Guay wrote:
Hi all,

As discussed in the "HDRloader error" thread, I've started a little program that tests every (potentially valid) combination of an image reader and writer. See http://thread.gmane.org/gmane.comp.graphics.openscenegraph.cvs/4897/focus=4923

The hope is that it can turn into a way of automatically testing both model and image plugins prior to a release, to make sure what should read some data file actually does, and what should be able to write an image/3D model actually does.

For now I started with images. I went through the plugins looking for readFile and writeFile methods. Sometimes I found some weirdness (for example the VTF plugin implements a writeFile method, but it just calls another function that always returns false, so the file is created but writing fails) and some combinations didn't work (possibly because of pixel format, but should the writing plugin convert pixel formats automatically, or should OSG have facilities to do that for the plugin?)

Anyways, it's a start.


Notes:

The program reads files from a data/ directory, which must be called osgPluginsTest.<extension>. I've got about 15 images (all the same image just saved to the different formats) right now to test, but there are some formats I can't save to using the software I have, so perhaps we can build a collection of files to test collectively and we'll have better chances of getting all the formats OSG supports.

The program will write output files to an output/ directory which it will create. I have added a command line argument to tell it to keep output files (the default would be to delete them after having tested the writer) but I didn't want to do the deletion itself right now (platform-independent way...).

I've made the program build a default hard-coded list of readers and writers, and there's a way to override that list with extensions given on the command line (colon-separated list, untested).

I've put a way of skipping combinations that I think are incompatible by design (though that needs to be verified, so there's a --testIncompatibleCombinations command line option and there's a TODO comment where the blacklisting occurs in the code).

The program redirects cerr to cout so that any plugin error messages will also be picked up if you redirect stdout to a file. (I can never remember how to redirect stdout AND stderr to a file on Windows...)


I've attached the code (for discussion more than actual submission) and also the results it prints out.

Comments? Is this a good direction?

J-S
------------------------------------------------------------------------

_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

--
+33 (0) 6 63 20 03 56  Cedric Pinson mailto:[email protected] 
http://www.plopbyte.net


_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to