mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
Add new scons targets for convenience: smoke, checkSource, and push
This commit is contained in:
parent
9114640a56
commit
4097bfec55
28
SConstruct
28
SConstruct
@ -157,9 +157,14 @@ clientEnv.Program( "firstExample" , [ "client/examples/first.cpp" ] )
|
||||
clientEnv.Program( "secondExample" , [ "client/examples/second.cpp" ] )
|
||||
|
||||
# testing
|
||||
testEnv.Program( "test" , Glob( "dbtests/*.cpp" ) )
|
||||
test = testEnv.Program( "test" , Glob( "dbtests/*.cpp" ) )
|
||||
clientEnv.Program( "clientTest" , [ "client/examples/clientTest.cpp" ] )
|
||||
|
||||
# ---- RUNNING TESTS ----
|
||||
|
||||
testEnv.Alias( "smoke", "test", test[ 0 ].abspath )
|
||||
testEnv.AlwaysBuild( "smoke" )
|
||||
|
||||
# ---- INSTALL -------
|
||||
|
||||
installDir = "/usr/local"
|
||||
@ -182,3 +187,24 @@ env.Install( installDir + "/lib/mongo-jars" , Glob( "jars/*" ) )
|
||||
#final alias
|
||||
env.Alias( "install" , installDir )
|
||||
|
||||
# ---- CONVENIENCE ----
|
||||
|
||||
def tabs( env, target, source ):
|
||||
from subprocess import Popen, PIPE
|
||||
from re import search, match
|
||||
diff = Popen( [ "git", "diff", "-U0", "origin", "master" ], stdout=PIPE ).communicate()[ 0 ]
|
||||
sourceFile = False
|
||||
for line in diff.split( "\n" ):
|
||||
if match( "diff --git", line ):
|
||||
sourceFile = not not search( ".(h|hpp|c|cpp)\s*$", line )
|
||||
if sourceFile and match( "\+ *\t", line ):
|
||||
return True
|
||||
return False
|
||||
env.Alias( "checkSource", [], [ tabs ] )
|
||||
env.AlwaysBuild( "checkSource" )
|
||||
|
||||
def gitPush( env, target, source ):
|
||||
import subprocess
|
||||
return subprocess.call( [ "git", "push" ] )
|
||||
env.Alias( "push", [ ".", "smoke", "checkSource" ], gitPush )
|
||||
env.AlwaysBuild( "push" )
|
||||
|
Loading…
Reference in New Issue
Block a user