Source

SCons / runtest.py

#!/usr/bin/env python

import getopt, os, os.path, re, string, sys

opts, tests = getopt.getopt(sys.argv[1:], "dv:")

debug = ''
version = None

for o, a in opts:
    if o == '-d': debug = "/usr/lib/python1.5/pdb.py"
    if o == '-v': version = a

if not version:
    version = os.popen("aesub '$version'").read()[:-1]

match = re.compile(r'^[CD]0*')

def aegis_to_version(aever):
    arr = string.split(aever, '.')
    end = max(len(arr) - 1, 2)
    arr = map(lambda e: match.sub('', e), arr[:end])
    def rep(e):
    	if len(e) == 1:
	    e = '0' + e
	return e
    arr[1:] = map(rep, arr[1:])
    return string.join(arr, '.')

version = aegis_to_version(version)

cwd = os.getcwd()

map(os.path.abspath, tests)

build_test = os.path.join(cwd, "build", "test")
scons_ver = os.path.join(build_test, "scons-" + version)

os.chdir(scons_ver)

os.environ['PYTHONPATH']  = scons_ver + ':' + build_test

exit = 0

for path in tests:
    if not os.path.isabs(path):
	path = os.path.join(cwd, path)
    if os.system("python " + debug + " " + path):
	exit = 1

sys.exit(exit)
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.