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:
kichik 2005-06-24 10:51:45 +00:00
parent 62c3903d7f
commit 4c7c2d74c7

View file

@ -28,31 +28,36 @@ env.Append(CCFLAGS = ['$EXCEPTION_FLAG'])
# test for CppUnit
conf = env.Configure()
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)
cppunit = conf.CheckLibWithHeader(libs, 'cppunit/extensions/HelperMacros.h', 'C++')
conf.Finish()
# compile files from parent directory
required_obj = []
if cppunit:
for i in required:
b = 'required/%s' % i[:-4]
s = '#Source/%s' % i
o = env.Object(b, s)
# compile files from parent directory
required_obj = []
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
tests = env.Program(target, tests + required_obj, LIBS = libs)
required_obj.append(o)
# alias running the test to 'test'
test = env.Alias('test', [tests], tests[0].abspath)
# build test program
tests = env.Program(target, tests + required_obj, LIBS = libs)
# always test when asked to
AlwaysBuild(test)
# alias running the test to '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)