fail to build if you use a bare assert SERVER-1259

This commit is contained in:
Eliot Horowitz
2012-03-26 13:21:30 -04:00
parent 70fbb3c958
commit 87a4604930

View File

@@ -38,6 +38,8 @@ def readErrorCodes( callback, replaceZero = False ):
ps = [ re.compile( "(([umsgf]asser(t|ted))) *\(( *)(\d+)" ) ,
re.compile( "((User|Msg|MsgAssertion)Exceptio(n))\(( *)(\d+)" )
]
bad = [ re.compile( "\sassert *\(" ) ]
for x in utils.getAllSourceFiles():
@@ -55,6 +57,14 @@ def readErrorCodes( callback, replaceZero = False ):
break
if found:
if x.find( "src/mongo/" ) >= 0:
for b in bad:
if len(b.findall( line )) > 0:
print( x )
print( line )
raise Exception( "you can't use a bare assert" )
for p in ps:
def repl( m ):