Unit tests for SDL?

Hello,

It would be great if SDL had some unit tests.

This would make porting a lot easier, and also make testing before
releases easier.

It would also help with the SDL 1.2 to SDL 1.3/2 transition.

If you set up a compile+testing farm, then it is easy for people to
test their changes on all platforms (that are set up in the compile
farm). You just commit your change, and wait for the compile farm to
do the tests on the other platforms.

A compile farm, can also show you warning messages from different
compilers, on different platforms you don’t have.

It would also make testing different drivers quicker. eg testing the
different video drivers on windows/linux.

Unit tests are also good for documentation. People can look at the
tests and see how things work.

With the compile+test farm you can make automatic builds available
that have been tested.

To begin the process, it would be good to set up a testing framework,
and then begin adding tests for new features and bug fixes.

These are some of the benefits that the pygame project has been
getting with its compile farm combined with the unittests. It’s made
our lives a lot easier - and saved us a lot of work.

Here’s the current pygame testing, and compile farm:
http://thorbrian.com/pygame/builds.php

It makes installers for windows, and mac every few hours… which is
another nice thing about it. People can keep up with svn more easily

  • without needing to compile the library themselves. We’re going to
    improve it to compile+test on other platforms in the near future.

What are peoples thoughts about this?

Is this something SDL would like?

Which unittest framework to use?

Would SDL accept patches to add unittests?

The pygame project is thinking perhaps we could share our compile+test
farm with SDL… but making it also compile+test SDL - as well as
pygame.

cu,

What are peoples thoughts about this?

I think this is a great idea.

Is this something SDL would like?

Yes!

Would SDL accept patches to add unittests?

Yes, I’ve started a better framework for tests in SDL 1.3, and I’d love
to see it extended and improved.

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment

hi,

where is the framework in 1.3? Can you explain how I can run the unit tests?

cheers,On Wed, Apr 23, 2008 at 1:25 PM, Sam Lantinga wrote:

What are peoples thoughts about this?

I think this is a great idea.

Is this something SDL would like?

Yes!

Would SDL accept patches to add unittests?

Yes, I’ve started a better framework for tests in SDL 1.3, and I’d love
to see it extended and improved.

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

hi,

where is the framework in 1.3?

The general framework is in test/common.c, and is used by a few of the new
test programs.

Can you explain how I can run the unit tests?

They’re not unit tests per-se, but my general process is to build and run
the programs in the test subdirectory and make sure the output looks correct
on a given platform.

See ya!
-Sam Lantinga, Lead Software Engineer, Blizzard Entertainment