renamed target to test-code
and made conf test alias the target to an error
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4133 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
62c3903d7f
commit
4c7c2d74c7
1 changed files with 26 additions and 21 deletions
|
@ -28,31 +28,36 @@ env.Append(CCFLAGS = ['$EXCEPTION_FLAG'])
|
||||||
|
|
||||||
# test for CppUnit
|
# test for CppUnit
|
||||||
conf = env.Configure()
|
conf = env.Configure()
|
||||||
|
cppunit = conf.CheckLibWithHeader(libs, 'cppunit/extensions/HelperMacros.h', 'C++')
|
||||||
if not conf.CheckLibWithHeader(libs, 'cppunit/extensions/HelperMacros.h', 'C++'):
|
|
||||||
|
|
||||||
if 'test' in BUILD_TARGETS:
|
|
||||||
|
|
||||||
print '*** error: CppUnit must be installed for testing!'
|
|
||||||
Exit(1)
|
|
||||||
|
|
||||||
conf.Finish()
|
conf.Finish()
|
||||||
|
|
||||||
# compile files from parent directory
|
if cppunit:
|
||||||
required_obj = []
|
|
||||||
|
|
||||||
for i in required:
|
# compile files from parent directory
|
||||||
b = 'required/%s' % i[:-4]
|
required_obj = []
|
||||||
s = '#Source/%s' % i
|
|
||||||
o = env.Object(b, s)
|
|
||||||
|
|
||||||
required_obj.append(o)
|
for i in required:
|
||||||
|
b = 'required/%s' % i[:-4]
|
||||||
|
s = '#Source/%s' % i
|
||||||
|
o = env.Object(b, s)
|
||||||
|
|
||||||
# build test program
|
required_obj.append(o)
|
||||||
tests = env.Program(target, tests + required_obj, LIBS = libs)
|
|
||||||
|
|
||||||
# alias running the test to 'test'
|
# build test program
|
||||||
test = env.Alias('test', [tests], tests[0].abspath)
|
tests = env.Program(target, tests + required_obj, LIBS = libs)
|
||||||
|
|
||||||
# always test when asked to
|
# alias running the test to 'test'
|
||||||
AlwaysBuild(test)
|
test = env.Alias('test-code', [tests], tests[0].abspath)
|
||||||
|
|
||||||
|
# always test when asked to
|
||||||
|
AlwaysBuild(test)
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
# no CppUnit
|
||||||
|
def err(target, source, env):
|
||||||
|
print '*** error: CppUnit must be installed for testing!'
|
||||||
|
return 1
|
||||||
|
|
||||||
|
cmd = env.Command(target, [tests], Action(err, ''))
|
||||||
|
env.Alias('test-code', cmd)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue