Listening to: Orff-Fortuna imperatrix mundi

Published June 19, 2004
Advertisement
Not much to report, progress-wise. I wired in the basics of the testing framework today. The testing framework is scavenged from an old project of mine. It's a XUnit style system, though much of the elegance of, say, JUnit is replaced with brute force hackery. C++ doesn't support reflection natively, which makes things interesting. From what I can tell it's fairly similar to unit++, though, as far as I know, unit++ didn't exist at the time that I started the original version. I guess it's a case of convergent evolution.

I do that a lot, incidently. For example, I've duplicated good chunks of boost without realizing it several times. Most recently, boost::transform_iterator. I've redone boost::array more times than I care to admit. (In my defense, boost::array is fairly trivial, so sometimes I don't realize I've done it until it's sitting on my screen.)

One thing I'm glad of is taking the time to run all the code through both MSVC 7.1 and gcc 3.3.1 simultaneously instead of my usual approach of coding a library in MSVC and then trying to shoehorn it into gcc.

In any case, the test system works pretty simply. You define a test class derived from a base test class in an anonymous namespace, create a static object that registers it with a the testing subsystem, and then after the entry point, you can invoke the testing subsystem to run all the tests. Some preprocessor trickery is used so that asserts in user code don't bring down the whole executable, but instead throw an exception. This is useful for automated build testing. It won't stop, for example, a memory assertion in the debug heap from bringing the whole thing crashing down, but generally, that kind of code would be caught before it got checked in. At least I hope.

One thing I forgot to mention yesterday was that part of the scaffolding I installed was a set of debug level macros. Basically every module, class and function has a priority associated with it. If the combinations of priorities in a given build aren't high enough, asserts don't fire in that function, which cuts down on runtime performance penalties.

So now that's all put down, tommorrow I can actually start working on the library proper.
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

New bug to me

1910 views

Week/Class 9

1740 views

Week/Class 8

1788 views

Week/Class 7

1835 views

The promised files

2115 views

Week/Class 6

1518 views

Week/Session 5

1578 views

Week/Session 4

1519 views

On the soapbox

1636 views

Week/Session 3

1493 views
Advertisement