SConscript (12310:054571e07fc9) SConscript (12313:6a633c9a8cfb)
1# -*- mode:python -*-
2
3# Copyright (c) 2004-2005 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 255 unchanged lines hidden (view full) ---

264 for src in sources:
265 if not isinstance(src, SourceFile):
266 src = Source(src, tags=str(target))
267 srcs.append(src)
268
269 self.sources = srcs
270 self.target = target
271 self.main = kwargs.get('main', False)
1# -*- mode:python -*-
2
3# Copyright (c) 2004-2005 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 255 unchanged lines hidden (view full) ---

264 for src in sources:
265 if not isinstance(src, SourceFile):
266 src = Source(src, tags=str(target))
267 srcs.append(src)
268
269 self.sources = srcs
270 self.target = target
271 self.main = kwargs.get('main', False)
272 UnitTest.all.append(self)
272 self.all.append(self)
273
273
274class GTest(UnitTest):
275 '''Create a unit test based on the google test framework.'''
276
277 all = []
278
274# Children should have access
275Export('Source')
276Export('PySource')
277Export('SimObject')
278Export('ProtoBuf')
279Export('UnitTest')
279# Children should have access
280Export('Source')
281Export('PySource')
282Export('SimObject')
283Export('ProtoBuf')
284Export('UnitTest')
285Export('GTest')
280
281########################################################################
282#
283# Debug Flags
284#
285debug_flags = {}
286def DebugFlag(name, desc=None):
287 if name in debug_flags:

--- 726 unchanged lines hidden (view full) ---

1014 for test in UnitTest.all:
1015 test_sources = Source.all.with_tag(str(test.target))
1016 test_objs = [ make_static(s) for s in test_sources ]
1017 if test.main:
1018 test_objs += main_objs
1019 path = 'unittest/%s.%s' % (test.target, label)
1020 new_env.Program(path, test_objs + static_objs)
1021
286
287########################################################################
288#
289# Debug Flags
290#
291debug_flags = {}
292def DebugFlag(name, desc=None):
293 if name in debug_flags:

--- 726 unchanged lines hidden (view full) ---

1020 for test in UnitTest.all:
1021 test_sources = Source.all.with_tag(str(test.target))
1022 test_objs = [ make_static(s) for s in test_sources ]
1023 if test.main:
1024 test_objs += main_objs
1025 path = 'unittest/%s.%s' % (test.target, label)
1026 new_env.Program(path, test_objs + static_objs)
1027
1028 gtest_env = new_env.Clone()
1029 gtest_env.Append(LIBS=gtest_env['GTEST_LIBS'])
1030 gtest_env.Append(CPPFLAGS=gtest_env['GTEST_CPPFLAGS'])
1031 for test in GTest.all:
1032 test_sources = Source.all.with_tag(str(test.target))
1033 test_objs = [ gtest_env.StaticObject(s.tnode) for s in test_sources ]
1034 gtest_env.Program('unittest/%s.%s' % (test.target, label), test_objs)
1035
1022 progname = exename
1023 if strip:
1024 progname += '.unstripped'
1025
1026 targets = new_env.Program(progname, main_objs + static_objs)
1027
1028 if strip:
1029 if sys.platform == 'sunos5':

--- 118 unchanged lines hidden ---
1036 progname = exename
1037 if strip:
1038 progname += '.unstripped'
1039
1040 targets = new_env.Program(progname, main_objs + static_objs)
1041
1042 if strip:
1043 if sys.platform == 'sunos5':

--- 118 unchanged lines hidden ---