From aa598b3ad1d91e974378f18837f2fbcca909e805 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 1 May 2017 17:50:43 -0700 Subject: scons: Merge reading test SConscripts into makeEnv. We're already visiting each of the environments, there's no reason to track them all and then set up test SConscripts on a second pass. Change-Id: I2d1166f58ac907e874d6ad5de7bd53ff7ad645f8 Reviewed-on: https://gem5-review.googlesource.com/2980 Reviewed-by: Jason Lowe-Power Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg --- src/SConscript | 59 +++++++++++++++++++++++++--------------------------------- 1 file changed, 25 insertions(+), 34 deletions(-) (limited to 'src/SConscript') diff --git a/src/SConscript b/src/SConscript index 6cb497695..fd6753320 100755 --- a/src/SConscript +++ b/src/SConscript @@ -1113,7 +1113,11 @@ def makeEnv(env, label, objsfx, strip = False, **kwargs): MakeAction('ln $SOURCE $TARGET', Transform("HARDLINK"))) new_env.M5Binary = targets[0] - return new_env + + # Set up regression tests. + SConscript(os.path.join(env.root.abspath, 'tests', 'SConscript'), + variant_dir=variantd('tests', new_env.Label), + exports={ 'env' : new_env }, duplicate=False) # Start out with the compiler flags common to all compilers, # i.e. they all use -g for opt and -g -pg for prof @@ -1183,53 +1187,40 @@ def makeEnvirons(target, source, env): # cause any later Source() calls to be fatal, as a diagnostic. Source.done() - envList = [] - # Debug binary if 'debug' in needed_envs: - envList.append( - makeEnv(env, 'debug', '.do', - CCFLAGS = Split(ccflags['debug']), - CPPDEFINES = ['DEBUG', 'TRACING_ON=1'], - LINKFLAGS = Split(ldflags['debug']))) + makeEnv(env, 'debug', '.do', + CCFLAGS = Split(ccflags['debug']), + CPPDEFINES = ['DEBUG', 'TRACING_ON=1'], + LINKFLAGS = Split(ldflags['debug'])) # Optimized binary if 'opt' in needed_envs: - envList.append( - makeEnv(env, 'opt', '.o', - CCFLAGS = Split(ccflags['opt']), - CPPDEFINES = ['TRACING_ON=1'], - LINKFLAGS = Split(ldflags['opt']))) + makeEnv(env, 'opt', '.o', + CCFLAGS = Split(ccflags['opt']), + CPPDEFINES = ['TRACING_ON=1'], + LINKFLAGS = Split(ldflags['opt'])) # "Fast" binary if 'fast' in needed_envs: - envList.append( - makeEnv(env, 'fast', '.fo', strip = True, - CCFLAGS = Split(ccflags['fast']), - CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'], - LINKFLAGS = Split(ldflags['fast']))) + makeEnv(env, 'fast', '.fo', strip = True, + CCFLAGS = Split(ccflags['fast']), + CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'], + LINKFLAGS = Split(ldflags['fast'])) # Profiled binary using gprof if 'prof' in needed_envs: - envList.append( - makeEnv(env, 'prof', '.po', - CCFLAGS = Split(ccflags['prof']), - CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'], - LINKFLAGS = Split(ldflags['prof']))) + makeEnv(env, 'prof', '.po', + CCFLAGS = Split(ccflags['prof']), + CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'], + LINKFLAGS = Split(ldflags['prof'])) # Profiled binary using google-pprof if 'perf' in needed_envs: - envList.append( - makeEnv(env, 'perf', '.gpo', - CCFLAGS = Split(ccflags['perf']), - CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'], - LINKFLAGS = Split(ldflags['perf']))) - - # Set up the regression tests for each build. - for e in envList: - SConscript(os.path.join(env.root.abspath, 'tests', 'SConscript'), - variant_dir = variantd('tests', e.Label), - exports = { 'env' : e }, duplicate = False) + makeEnv(env, 'perf', '.gpo', + CCFLAGS = Split(ccflags['perf']), + CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'], + LINKFLAGS = Split(ldflags['perf'])) # The MakeEnvirons Builder defers the full dependency collection until # after processing the ISA definition (due to dynamically generated -- cgit v1.2.3