More config tests

This commit is contained in:
Thomas Nagy 2016-04-03 13:30:03 +02:00
parent a1a24c8456
commit 61d1bd74ee
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
1 changed files with 13 additions and 4 deletions

View File

@ -100,7 +100,7 @@ def configure(conf):
return 'conf.env.DEFINES_LIBPNG = %r' % val
@test
def fun7():
def modversion1():
"modversion=libpng -> DEFINES=['LIBPNG_VERSION=X']"
conf.check_cfg(modversion='libpng')
val = conf.env.DEFINES
@ -109,7 +109,7 @@ def configure(conf):
return 'conf.env.DEFINES = %r' % val
@test
def fun8():
def modversion2():
"modversion=libpng,uselib_store=foo -> DEFINES=['FOO_VERSION=X']"
conf.check_cfg(modversion='libpng', uselib_store='foo')
val = conf.env.DEFINES
@ -118,14 +118,23 @@ def configure(conf):
return 'conf.env.DEFINES = %r' % val
@test
def fun9():
def modversion3():
"modversion=libpng,uselib_store=foo,define_name=bar -> DEFINES=['bar=X']"
conf.check_cfg(modversion='libpng', uselib_store='foo', define_name='bar')
val = conf.env.DEFINES
# automatic uppercase
if not isinstance(val, list) or not val[0].startswith("bar="):
return 'conf.env.DEFINES = %r' % val
@test
def atleast_version():
"atleast_version=1.0,uselib_store=foo -> DEFINES=['HAVE_FOO=1']"
conf.check_cfg(package='libpng', uselib_store='foo', atleast_version='1.0', args='--libs --cflags')
val = conf.env.DEFINES
if not isinstance(val, list) or not 'HAVE_FOO=1' in val:
return 'conf.env.DEFINES = %r' % val
if not conf.env.LIB_foo:
return 'expected conf.env.LIB_foo to be defined :-/'
if conf.failure:
conf.fatal('One or several test failed, check the outputs above')