[nexuiz-commits] r8677 - trunk/data/qcsrc/server-testcase

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Feb 27 12:38:13 EST 2010


Author: div0
Date: 2010-02-27 12:38:13 -0500 (Sat, 27 Feb 2010)
New Revision: 8677

Modified:
   trunk/data/qcsrc/server-testcase/framework.qc
   trunk/data/qcsrc/server-testcase/run.sh
Log:
GDB_ME env variable runs a test case in gdb now

Modified: trunk/data/qcsrc/server-testcase/framework.qc
===================================================================
--- trunk/data/qcsrc/server-testcase/framework.qc	2010-02-27 17:32:13 UTC (rev 8676)
+++ trunk/data/qcsrc/server-testcase/framework.qc	2010-02-27 17:38:13 UTC (rev 8677)
@@ -7,6 +7,7 @@
 void spawnfunc_worldspawn()
 {
 	float r;
+	dprint("TESTCASE: START\n");
 	r = test();
 	if(r == 1)
 		error("TESTCASE: PASS"); 

Modified: trunk/data/qcsrc/server-testcase/run.sh
===================================================================
--- trunk/data/qcsrc/server-testcase/run.sh	2010-02-27 17:32:13 UTC (rev 8676)
+++ trunk/data/qcsrc/server-testcase/run.sh	2010-02-27 17:38:13 UTC (rev 8677)
@@ -18,7 +18,21 @@
 map=$1; shift
 echo "$testcase" > "$dir/testcase.qc"
 if ( cd $dir && fteqcc ); then
-	r=`"$engine" -nexuiz -basedir "$dir/../../.." +sv_progs progs-testcase.dat "$@" +map "$map" | tee /dev/stderr`
+	set -- "$engine" -nexuiz -basedir "$dir/../../.." +sv_progs progs-testcase.dat "$@" +map "$map"
+	if [ -n "$GDB_ME" ]; then
+		cmdfile=`mktemp`
+		{
+			echo "break VM_dprint"
+			echo "run"
+			echo "delete 1"
+			echo "finish"
+		} > "$cmdfile"
+		gdb -x "$cmdfile" --args "$@"
+		rm -f "$cmdfile"
+		exit 0
+	else
+		r=`"$@" | tee /dev/stderr`
+	fi
 	case "$r" in
 		*"TESTCASE: PASS"*)
 			echo "PASS detected"



More information about the nexuiz-commits mailing list