Game Development Community

Waiting for a debugger to connect to telnet

by Johan Janssen · in Torque Game Engine · 03/27/2007 (11:25 am) · 3 replies

I started using Torque two weeks ago and I'm currently writing a unittest framework for my TorqueScripts. I wrote a little app in C# that creates a torquescript testrunner file to run tests. These unit tests spit out log entries to let the framework know what tests have been executed and which assertions failed.

I currently have a very dirty solution that reads the console.log after every session and extracts this data, but was thinking of having a more gracefull solution using the telnet debugger and read the output from there.

The problem I am currently having is that the unit tests start running BEFORE the telnet session even connects. Even more so, my dummy unit tests are done before the first line can be read even if it manages to fall through the connect.

Is there a way to make Torque halt execution untill a debugger connects? Also, is there a way to make a script give control back to the engine so it can nicely flush al logging data before doing a quit() (which terminates the connection).

thanks in advance,

Johan Janssen

#1
03/27/2007 (3:20 pm)
It would be a lot easier just to execute your unit tests from the telnet connection itself. Write a function that calls them, then evaluate that function via the debugger session.
#2
03/27/2007 (11:27 pm)
Actually, that is not such a bad idea... that is not a bad idea at all.
I'm definately going to try this one!

Thanks!
#3
03/27/2007 (11:46 pm)
Also check out the TelnetDebugger docs. You can pass an optional 3rd parameter to dbgSetParameters to have it wait until a debugger connects.