Index: /pjproject/trunk/tests/automated/configure.py
===================================================================
--- /pjproject/trunk/tests/automated/configure.py	(revision 3120)
+++ /pjproject/trunk/tests/automated/configure.py	(revision 3120)
@@ -0,0 +1,87 @@
+#!/usr/bin/python
+
+import optparse
+import os
+import platform
+import socket
+import subprocess
+import sys
+
+PROG = "r" + "$Rev: 17 $".strip("$ ").replace("Rev: ", "")
+
+#
+# Get gcc version
+#
+def gcc_version(gcc):
+    proc = subprocess.Popen(gcc + " -v", stdout=subprocess.PIPE,
+                            stderr=subprocess.STDOUT, shell=True)
+    ver = ""
+    while True:
+        s = proc.stdout.readline()
+        if not s:
+            break
+        if s.find("gcc version") >= 0:
+            ver = s.split(None, 3)[2]
+            break
+    proc.wait()
+    return "gcc-" + ver
+
+def replace_vars(text):
+        while True:
+                if text.find("$(PJSUA-TESTS)") >= 0:
+                        proc = subprocess.Popen("python runall.py --list-xml", cwd="../pjsua",
+                                                shell=True, stdout=subprocess.PIPE)
+                        content = proc.stdout.read()
+                        text = text.replace("$(PJSUA-TESTS)", content)
+                elif text.find("$(GCC)") >= 0:
+                        text = text.replace("$(GCC)", gcc_version("gcc"))
+                elif text.find("$(DISABLED)") >= 0:
+                        text = text.replace("$(DISABLED)", "0")
+                elif text.find("$(OS)") >= 0:
+                        os_info = platform.system() + platform.release() + "-" + platform.machine()
+                        if platform.system().lower() == "linux":
+                                os_info =  os_info + "-" + "-".join(platform.linux_distribution()[0:2])
+                        text = text.replace("$OS", os_info)
+                elif text.find("$(SUFFIX)") >= 0:
+                        proc = subprocess.Popen("sh config.guess", cwd="../..",
+                                                shell=True, stdout=subprocess.PIPE)
+                        plat = proc.stdout.readline().rstrip(" \r\n")
+                        text = text.replace("$(SUFFIX)", plat)
+                elif text.find("$(HOSTNAME)") >= 0:
+                        text = text.replace("$(HOSTNAME)", socket.gethostname())
+                elif text.find("$(PJDIR)") >= 0:
+                        wdir = os.path.join(os.getcwd(), "../..")
+                        wdir = os.path.normpath(wdir)
+                        text = text.replace("$(PJDIR)", wdir)
+                else:
+                        break
+        return text
+
+
+def main(args):
+        usage = """Usage: configure.py scenario_template_file
+"""
+
+        args.pop(0)
+        if not len(args):
+                print usage
+                return 1
+        
+        tpl_file = args[len(args)-1]
+        if not os.path.isfile(tpl_file):
+                print "Error: unable to find template file '%s'" % (tpl_file)
+                return 1
+                
+        f = open(tpl_file, "r")
+        tpl = f.read()
+        f.close()
+        
+        tpl = replace_vars(tpl)
+        print tpl
+        return 0
+
+
+if __name__ == "__main__":
+    rc = main(sys.argv)
+    sys.exit(rc)
+
Index: /pjproject/trunk/tests/automated/gnu.xml.template
===================================================================
--- /pjproject/trunk/tests/automated/gnu.xml.template	(revision 3120)
+++ /pjproject/trunk/tests/automated/gnu.xml.template	(revision 3120)
@@ -0,0 +1,28 @@
+<?xml version="1.0" ?>
+<Scenario site="$(HOSTNAME)" url="http://my.cdash.org/submit.php?project=PJSIP" wdir="$(PJDIR)">
+ 
+	<Submit group="Experimental" build="$(SUFFIX)-$(GCC)-default" disabled="$(DISABLED)" >
+		<Update />
+		<Write file="user.mak">
+		  <![CDATA[
+# Written by ccdash
+]]>			
+		</Write>
+		<Write file="pjlib/include/pj/config_site.h">
+		  <![CDATA[
+/* Written by ccdash */
+#define PJ_HAS_IPV6		1
+#define PJMEDIA_HAS_G7221_CODEC 1
+]]>			
+		</Write>
+		<Configure cmd="./aconfigure" />
+		<Build cmd="make dep &amp;&amp; make distclean &amp;&amp; make" />
+		<Test name="pjlib-test" info="" wdir="pjlib/bin" cmd="./pjlib-test-$(SUFFIX)" />
+		<Test name="pjlib-util-test" info="" wdir="pjlib-util/bin" cmd="./pjlib-util-test-$(SUFFIX)" />
+		<Test name="pjnath-test" info="" wdir="pjnath/bin" cmd="./pjnath-test-$(SUFFIX)" />
+		<Test name="pjmedia-test" info="" wdir="pjmedia/bin" cmd="./pjmedia-test-$(SUFFIX)" />
+		<Test name="pjsip-test" info="" wdir="pjsip/bin" cmd="./pjsip-test-$(SUFFIX)" />
+		$(PJSUA-TESTS)
+	</Submit>
+	
+</Scenario>
Index: /pjproject/trunk/tests/pjsua/runall.py
===================================================================
--- /pjproject/trunk/tests/pjsua/runall.py	(revision 3119)
+++ /pjproject/trunk/tests/pjsua/runall.py	(revision 3120)
@@ -58,38 +58,65 @@
     tests = [t for t in tests if t.find(pat)==-1]
 
-# List the tests only?
-if len(sys.argv)==2 and sys.argv[1]=="--list":
-    for t in tests:
-	print t
-    sys.exit(0)
 
-# Resume test?
 resume_script=""
-if len(sys.argv) > 1:
-    if sys.argv[1]=='-r' or sys.argv[1]=='--resume':
-	resume_script=sys.argv[2]
-    if sys.argv[1]=='/h' or sys.argv[1]=='-h' or sys.argv[1]=='--help' or sys.argv[1]=='/help':
-        print "Usage:"
-	print "  runall.py [OPTIONS] [run.py-OPTIONS]"
-	print "Options:"
-	print "  --resume,-r RESUME"
-	print "      RESUME is string/substring to specify where to resume tests."
-	print "      If this argument is omited, tests will start from the beginning."
-	print "  run.py-OPTIONS are applicable here"
-	sys.exit(0)
+shell_cmd=""
+
+# Parse arguments
+sys.argv.pop(0)
+while len(sys.argv):
+        if sys.argv[0]=='/h' or sys.argv[0]=='-h' or sys.argv[0]=='--help' or sys.argv[0]=='/help':
+                sys.argv.pop(0)
+                print "Usage:"
+                print "  runall.py [OPTIONS] [run.py-OPTIONS]"
+                print "OPTIONS:"
+                print " --list"
+                print "     List the tests"
+                print "  --list-xml"
+                print "     List the tests as XML format suitable for ccdash"
+                print "  --resume,-r RESUME"
+                print "      RESUME is string/substring to specify where to resume tests."
+                print "      If this argument is omited, tests will start from the beginning."
+                print "  --shell,-s SHELL"
+                print "      Run the tests with the specified SHELL cmd. This can also be"
+                print "      used to run the test with ccdash. Example:"
+                print "        --shell '/bin/sh -c'"
+                print "  run.py-OPTIONS are applicable here"
+                sys.exit(0)
+	elif sys.argv[0] == '-r' or sys.argv[0] == '--resume':
+	        if len(sys.argv) > 1:
+			resume_script=sys.argv[1]
+			sys.argv.pop(0)
+			sys.argv.pop(1)
+	        else:
+	                sys.argv.pop(0)
+                        sys.stderr.write("Error: argument value required")
+                        sys.exit(1)
+	elif sys.argv[0] == '--list':
+	        sys.argv.pop(0)
+		for t in tests:
+		      print t
+		sys.exit(0)
+        elif sys.argv[0] == '--list-xml':
+                sys.argv.pop(0)
+                for t in tests:
+                        (mod,param) = t.split(None,2)
+		        tname = mod[4:mod.find(".py")] + "_" + \
+		                param[param.find("/")+1:param.find(".py")]
+                        tcmd = 'python run.py ' + t
+                        print '\t\t<Test name="%s" cmd="%s" wdir="tests/pjsua" />' % (tname, tcmd)
+                sys.exit(0)
+        elif sys.argv[0] == '-s' or sys.argv[0] == '--shell':
+                if len(sys.argv) > 1:
+			shell_cmd = sys.argv[1]
+			sys.argv.pop(0)
+			sys.argv.pop(1)
+                else:
+                        sys.argv.pop(0)
+                        sys.stderr.write("Error: argument value required")
+                        sys.exit(1)
 
 
 # Generate arguments for run.py
-argv = sys.argv
-argv_to_skip = 1
-if resume_script != "":
-    argv_to_skip += 2
-argv_st = ""
-for a in argv:
-    if argv_to_skip > 0:
-        argv_to_skip -= 1
-    else:
-        argv_st += a + " "
-
+argv_st = " ".join(sys.argv)
 
 # Init vars
@@ -109,12 +136,18 @@
 
 # Now run the tests
+total_cnt = len(tests)
 for t in tests:
 	if resume_script!="" and t.find(resume_script)==-1:
 	    print "Skipping " + t +".."
+            total_cnt = total_cnt - 1
 	    continue
 	resume_script=""
 	cmdline = "python run.py " + argv_st + t
+        if shell_cmd:
+                cmdline = "%s '%s'" % (shell_cmd, cmdline)
 	t0 = time.time()
-	print "Running " + cmdline + "...",
+	msg = "Running %d/%d: %s..." % (tests_cnt+1, total_cnt, cmdline)
+        sys.stdout.write(msg)
+        sys.stdout.flush()
 	ret = os.system(cmdline + " > output.log")
 	t1 = time.time()
