From c4c624cb973af1f6d225333aefa51fe06e04e22f Mon Sep 17 00:00:00 2001 From: Dan Crosta Date: Tue, 31 Jan 2012 10:47:49 -0500 Subject: be smarter about picking python name to invoke smoke.py --- SConstruct | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index 0de0cea02cb..8d31c8f21a6 100644 --- a/SConstruct +++ b/SConstruct @@ -755,6 +755,15 @@ def add_exe(target): return target + ".exe" return target +def smoke_python_name(): + # if this script is being run by py2.5 or greater, + # then we assume that "python" points to a 2.5 or + # greater python VM. otherwise, explicitly use 2.5 + # which we assume to be installed. + if sys.version_info >= (2, 5): + return "python" + return "python2.5" + def setupBuildInfoFile( outFile ): version = utils.getGitVersion() if len(moduleNames) > 0: @@ -1250,7 +1259,7 @@ def addSmoketest( name, deps ): else: target = name[5].lower() + name[6:] - addTest(name, deps, [ "python2.5 buildscripts/smoke.py " + " ".join(smokeFlags) + ' ' + target ]) + addTest(name, deps, [ smoke_python_name() + " buildscripts/smoke.py " + " ".join(smokeFlags) + ' ' + target ]) addSmoketest( "smoke", [ add_exe( "test" ) ] ) addSmoketest( "smokePerf", [ "perftest" ] ) @@ -1648,7 +1657,7 @@ def build_and_test_client(env, target, source): call(scons_command + ["libmongoclient.a", "clientTests"], cwd=installDir) - return bool(call(["python2.5", "buildscripts/smoke.py", + return bool(call([smoke_python_name(), "buildscripts/smoke.py", "--test-path", installDir, "client"])) env.Alias("clientBuild", [mongod, installDir], [build_and_test_client]) env.AlwaysBuild("clientBuild") -- cgit v1.2.1