Code Testing Interface

For discussion of the code running behind the game

Moderator: Staff

User avatar
Roots
Dictator
Posts: 8662
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Code Testing Interface

Postby Roots » Sun Jul 01, 2007 6:37 pm

I have to admit that I am rather lazy about fully testing new engine code that I've written. The main reason is it is hard to "extract" a particular engine component and do thorough testing on it, since many parts of the engine and the rest of the code are tied in together. Usually when I need to test something that doesn't involve drawing operations (which are even more difficult to test), I just insert a block of code in main.cpp after the engine is initialized but before the main game loop.


What I would like to propose is that we write a battery of engine code tests, and add new tests as we add new features. I propose that we do something like the following:

- Create a new directory: src/test/ that contains all the testing code files
- Add a new --test/-t command-line argument that when invoked, runs the specified test or tests
- When the command-line arg is activated, we go to the test code instead of the main game loop


I think this would be extremely useful to have, although it may take us a while to code up all the tests we may want to run. We could also use this test code to help us diagnose if there are any engine problems running on another person's machine. If we're lucky, perhaps we can hire a new programmer to the team with the initial task of constructing a test battery for us.

Thoughts? :hack:
Image

Return to “Programming”

Who is online

Users browsing this forum: No registered users and 11 guests