Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
64 lines (47 sloc) 1.88 KB
import sys
# enable python to find the module
module_path = Dir('.').srcnode().abspath
from build.perftest import compile_test
import os
my_env = env.Clone()
def cu_build_function(source, target, env):
compile_test(str(source[0]), str(target[0]))
# define a rule to build a .cu from a .test
cu_builder = Builder(action = cu_build_function,
suffix = '.cu',
src_suffix = '.test')
my_env.Append(BUILDERS = {'CUFile' : cu_builder})
# define a rule to build a report from an executable
report_builder = Builder(action = os.path.join('"' + str(my_env.Dir('.')), '$SOURCE" > $TARGET'),
suffix = '.xml',
src_suffix = my_env['PROGSUFFIX'])
my_env.Append(BUILDERS = {'Report' : report_builder})
my_env.Append(CPPPATH = [Dir('.').srcnode(), Dir('#/testing')])
cu_list = []
program_list = []
report_list = []
build_files = [os.path.join('build', f) for f in ['', 'test_function_template.cxx']]
# describe dependency graph:
# report -> program -> .cu -> .test
for test in my_env.Glob('*.test'):
cu = my_env.CUFile(test)
my_env.Depends(cu, build_files)
prog = my_env.Program(cu)
report = my_env.Report(prog)
# make aliases for groups of targets
reports = my_env.Alias("reports", report_list)
programs = my_env.Alias("programs", program_list)
# when no build target is specified, by default we build the programs
# output a help message
Type: 'scons' to build all performance test programs.
Type: 'scons reports' to run all performance tests and output reports.
Type: 'scons <test name>' to build a single performance test program of interest.
Type: 'scons <test name>.xml' to run a single performance test of interest and output a report.
Jump to Line
Something went wrong with that request. Please try again.