diff -r 044383f39525 -r be27ed110b50 buildframework/helium/tools/testing/ats/ats.ant.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/buildframework/helium/tools/testing/ats/ats.ant.xml Wed Oct 28 14:39:48 2009 +0000 @@ -0,0 +1,550 @@ + + + + + + ATS testing targets. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +import os +import re +import sysdef.api +import pathaddition.match +import traceback +## using create-canonical-sysdef-file target, it works and gets tsrc paths + +if project.getProperty('canonical.sysdef.file') == None : + raise Exception("'canonical.sysdef.file' property is not defined") + +try: + sdf = sysdef.api.SystemDefinition(str(project.getProperty('canonical.sysdef.file'))) + + modules = {} + paths_list = [] + for la in sdf.layers: + if re.match(r".*_test_layer$", la): + try: + if re.search(r"\b%s\b" % la, project.getProperty('exclude.test.layers')): + continue + except TypeError, exp: + pass + + layer = sdf.layers[la] + for mod in layer.modules: + if mod.name not in modules: + modules[mod.name] = [] + for unit in mod.units: + include_unit = True + if project.getProperty('ido.build.filter') != None: + if project.getProperty('ido.build.filter') != "": + include_unit = False + if hasattr(unit, 'filters'): + if len(unit.filters) > 0: + for filter in unit.filters: + if re.search(r"\b%s\b" % filter, project.getProperty('ido.build.filter')): + include_unit = True + else: + include_unit = False + elif len(unit.filters) == 0: + include_unit = True + else: + include_unit = False + else: + include_unit = False + if hasattr(unit, 'filters'): + if len(unit.filters) == 0: + include_unit = True + if include_unit: + #if pathaddition.match.ant_match(unit.path, "**/tsrc/**", False): + modules[mod.name].append(os.path.join(project.getProperty('build.drive') + os.sep, unit.path)) + #else: + # project.log('tcrc not found in ' + str(unit.path)) + + #substituting paths in the modules dictionary from path list using keys + for name in modules.keys(): + if not modules[name] == []: + project.setProperty(str("%s.%s" % (attributes.get('prefix'), name)), str(" ".join(modules[name]))) + else: + del modules[name] + + project.setProperty(str(attributes.get('property')), str(",".join(modules.keys()))) + +except Exception, e: + traceback.print_exc() + project.log("ERROR: could not generate tsrc path list. %s" % e) + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${ats.drop.file} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + data: xml(${canonical.sysdef.file}) + ant: antProperties() + + + + + ats.ctc.monsyms: ${ats.ctc.monsyms} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +