Anonymous avatar Anonymous committed 00bddf4

runtest.py follow-on fixes

Comments (0)

Files changed (3)

         their own just to help out with SCons development.
 
 runtest.py
-runtest.sh
-        Scripts for running our tests.  The Python version is used
-        by Aegis for running tests against a copy of the source as
-        extracted from an archive.  The shell version runs tests against
-        the local src/ tree, so you don't have to do a build before
-        testing your changes.  (Hmm, that should probably just be an
-        option to runtest.py...)
+	Script for running our tests.  By default, this will run a
+	test against the code in the local src/ tree, so you don't
+	have to do a build before testing your changes.  Aegis uses
+	it with an option that requires that you've done a build
+	(aeb) before running tests.
 
 src/
 	Where the actual source code is kept, of course.
  * written to conform to Perl conventions) and Aegis' expectations.
  * See the comments in the test.pl script itself for details.
  */
-test_command = "python runtest.py -b aegis -v ${VERsion} ${File_Name}";
+test_command = "python runtest.py -b aegis -q -v ${VERsion} ${File_Name}";
 
 new_test_filename = "test/CHANGETHIS.py";
 
 #!/usr/bin/env python
+#
+# runtests.py - wrapper script for running SCons tests
+#
+# This script mainly exists to set PYTHONPATH to the right list of
+# directories to test the SCons modules.
+#
+# By default, it directly uses the modules in the local tree:
+# ./src/ (source files we ship) and ./etc/ (other modules we don't)
+#
+# When "-b aegis" is specified, it assumes it's in a directory
+# in which an Aegis build (aeb) has been performed, and sets
+# PYTHONPATH so that it *only* references the modules that have
+# unpacked from the built packages, to test whether the packages
+# are good.
+#
+# Options:
+#
+#	-a		Run all tests; does a virtual 'find' for
+#			all SCons tests under the current directory.
+#
+#	-b system	Assume you're in the specified built system.
+#			'aegis' is the only one currently defined.
+#
+#	-d		Debug.  Runs the script under the Python
+#			debugger (pdb.py) so you don't have to
+#			muck with PYTHONPATH yourself.
+#
+#	-q		Quiet.  By default, runtest.py prints the
+#			command line it will execute before
+#			executing it.  This suppresses that print.
+#
+#	-v		Version.  Specifies the version number to
+#			be used for Aegis interaction.
+#
 
 import getopt
 import os
 build = None
 debug = ''
 tests = []
+printcmd = 1
 version = None
 
-opts, tests = getopt.getopt(sys.argv[1:], "ab:dv:",
-			    ['all','build=','debug','version='])
+opts, tests = getopt.getopt(sys.argv[1:], "ab:dqv:",
+			    ['all','build=','debug','quiet','version='])
 
 for o, a in opts:
     if o == '-a' or o == '--all': all = 1
-    elif o == '-b' or o == '-build': build = a
-    elif o == '-d' or o == '--debug': debug = "/usr/lib/python1.5/pdb.py"
+    elif o == '-b' or o == '--build': build = a
+    elif o == '-d' or o == '--debug': debug = os.path.join(
+					sys.exec_prefix,
+					"lib",
+					"python" + sys.version[0:3],
+					"pdb.py")
+    elif o == '-q' or o == '--quiet': printcmd = 0
     elif o == '-v' or o == '--version': version = a
 
 cwd = os.getcwd()
     else:
 	abs = os.path.join(cwd, path)
     cmd = string.join(["python", debug, abs], " ")
-    if all:
+    if printcmd:
 	print cmd
     if os.system(cmd):
 	fail.append(path)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.