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.
For discussion of the code running behind the game
1 post • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 7 guests