From 87a4604930a9f4e2324bf5d5ccbec106d2a84e7f Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Mon, 26 Mar 2012 13:21:30 -0400 Subject: [PATCH] fail to build if you use a bare assert SERVER-1259 --- buildscripts/errorcodes.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/buildscripts/errorcodes.py b/buildscripts/errorcodes.py index 3317e1a78dc..b0f92fb934c 100755 --- a/buildscripts/errorcodes.py +++ b/buildscripts/errorcodes.py @@ -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 ):