def IMPModuleBin(env, files): if env["IMP_PASS"] != "BUILD": return prgs=stb.handle_bins(env, files, stp.get_build_bin_dir(env, _get_module_name(env)), extra_modules=[_get_module_name(env)]) scons_tools.data.get(env).add_to_alias(_get_module_alias(env), prgs)
def IMPModuleTest(env, python_tests=[], cpp_tests=[], expensive_python_tests=[], expensive_cpp_tests=[], plural_exceptions=[], show_exceptions=[], function_name_exceptions=[], value_object_exceptions=[], class_name_exceptions=[], spelling_exceptions=[], check_standards=True): """Pseudo-builder to run tests for an IMP module. The single target is generally a simple output file, e.g. 'test.passed', while the single source is a Python script to run (usually run-all-tests.py). Right now, the assumption is made that run-abll-tests.py executes all files called test_*.py in the current directory and subdirectories.""" if env["IMP_PASS"] != "RUN": return files= [x.abspath for x in python_tests] expensive_files= [x.abspath for x in expensive_python_tests] module=_get_module_name(env) if len(cpp_tests)>0: #print "found cpp tests", " ".join([str(x) for x in cpp_tests]) prgs= stb.handle_bins(env, cpp_tests, stp.get_build_test_dir(env, module), extra_modules=[module]) #print [x[0].abspath for x in prgs] cpptest= env.IMPModuleCPPTest(target=File("#/build/test/%s_cpp_test_programs.py"%module), source= prgs) files.append(cpptest) if len(expensive_cpp_tests)>0: #print "found cpp tests", " ".join([str(x) for x in cpp_tests]) prgs= _make_programs(env, Dir("#/build/test"), expensive_cpp_tests, prefix=module) #print [x[0].abspath for x in prgs] cpptest= env.IMPModuleCPPTest(target="%s_expensive_cpp_test_programs.py"%module, source= prgs) expensive_files.append(cpptest) if check_standards: standards=_standards.add(env, plural_exceptions=plural_exceptions, show_exceptions=show_exceptions, function_name_exceptions=function_name_exceptions, value_object_exceptions=value_object_exceptions, class_name_exceptions=class_name_exceptions, spelling_exceptions=spelling_exceptions) #found=False #for f in files: # if str(f).endswith("test_standards.py"): # found=f #if found: # files.remove(found) files.append(standards) tests = scons_tools.test.add_tests(env, source=files, expensive_source=expensive_files, type='module unit test')