diff options
author | Eliot Horowitz <eliot@10gen.com> | 2012-03-26 13:21:30 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2012-03-26 13:23:23 -0400 |
commit | 87a4604930a9f4e2324bf5d5ccbec106d2a84e7f (patch) | |
tree | 5cea92194f69fabe40bb56dbdc093e1358c844b5 /buildscripts/errorcodes.py | |
parent | 70fbb3c95847225da73af93534851db1b32d9f50 (diff) | |
download | mongo-87a4604930a9f4e2324bf5d5ccbec106d2a84e7f.tar.gz |
fail to build if you use a bare assert SERVER-1259
Diffstat (limited to 'buildscripts/errorcodes.py')
-rwxr-xr-x | buildscripts/errorcodes.py | 10 |
1 files changed, 10 insertions, 0 deletions
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 ): |