Skip to content
Snippets Groups Projects
Commit d5e15b18 authored by Atlas-Software Librarian's avatar Atlas-Software Librarian Committed by Graeme Stewart
Browse files

'CMakeLists.txt' (ReleaseTests-00-00-02)

parent 33323ebc
No related branches found
No related tags found
No related merge requests found
################################################################################
# Package: ReleaseTests
################################################################################
# Declare the package name:
atlas_subdir( ReleaseTests )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PRIVATE
TestPolicy )
# Install files from the package:
atlas_install_runtime( test/ReleaseTests_TestConfiguration.xml )
#!/usr/bin/env python
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
import os
import xml.etree.ElementTree as ET
import re
import commands
# list = commands.getstatusoutput("cmt show packages /afs/cern.ch/work/s/seuster/sel | gawk '{print $3 \"/\" $1}'")[1].split()
list = commands.getstatusoutput("cmt show packages | gawk '{print $3 \"/\" $1}'")[1].split()
# list = os.getenv("CMTPATH").split(':')
# list = ['/afs/cern.ch/atlas/software/builds/nightlies/devval/AtlasAnalysis/rel_2/Reconstruction/egamma/egammaPhysCalib/egammaPhysCalib/selection.xml']
ErrorList = {}
ErrorContent = {}
GUIDList = {}
GUIDListDup = {}
print "Processing these packages:"
for index, item in enumerate(list):
print index, item
for path in list:
#print path
from os.path import join, getsize
for root, dirs, files in os.walk(path):
if os.path.exists(root):
for name in files:
path=join(root, name)
if os.path.exists(path) and name=="selection.xml":
#print ("file ", path," size ",getsize(path))
with open(path, 'r') as content_file:
content = content_file.read()
old="different"
while old != content:
old = content
content = re.sub(r"(class +[a-zA-Z]+ *= *\")([a-zA-Z0-9:_* ,&;]+)<([a-zA-Z0-9:_* ,<&;]+)>([a-zA-Z0-9:_* ,>&;]*)", r"\1\2&lt;\3&gt;\4", content)
#print "TEST"
#print
#print content
try:
tree = ET.fromstring(content)
#for child in tree:
# print child.tag, child.attrib
for neighbor in tree.findall('./class'):
guid=neighbor.get("id")
clnm=neighbor.get("name")
#print "id: ",clnm,guid
if guid != None:
if guid in GUIDList:
print "Duplicate ! ", guid, " found twice !!"
print " 1. ", GUIDList[guid]
print " 2. ", path, " (", clnm, ")"
GUIDListDup[guid]=path + " (" + clnm + ")"
else:
GUIDList[guid]=path + " (" + clnm + ")"
except Exception as e:
#print "ERROR: ", type(e)
#print "ERROR: ", e.args
#print "ERROR: ", content
# ErrorList.append(path)
ErrorList[path]=e.args
ErrorContent[path]=content
pass
if len(ErrorList):
print "Failed reading these selection.xml files:"
for index, item in enumerate(ErrorList):
print index, item, ErrorList[item]
print " Error was : ", ErrorList[item]
print " selection.xml was: "
print ErrorContent[item]
else:
print "All selection.xml files in all packages were read successfully"
if len(GUIDListDup):
print "Found following Duplicates in selection.xml:"
for index, item in enumerate(GUIDListDup):
print index, item, GUIDListDup[item]
print " also declared in ", GUIDList[item]
import sys
sys.exit(len(GUIDListDup))
package ReleaseTests
author Rolf Seuster
branches bin
private
use TestPolicy TestPolicy-*
apply_pattern validate_xml
end_private
macro ReleaseTests_TestConfiguration "../test/ReleaseTests_TestConfiguration.xml"
apply_pattern declare_runtime extras="../test/ReleaseTests_TestConfiguration.xml"
<?xml version="1.0"?>
<!DOCTYPE unifiedTestConfiguration SYSTEM "http://www.hep.ucl.ac.uk/atlas/AtlasTesting/DTD/unifiedTestConfiguration.dtd">
<unifiedTestConfiguration>
<atn>
<TEST name="ReleaseTests" type="script" suite="Examples">
<options_atn>
${ATN_PACKAGE}/bin/testSelectionXML.py
</options_atn>
<timelimit>60</timelimit>
<author>Rolf Seuster</author>
<prescript>rm -f $ATN_WORK_AREA/*</prescript>
<expectations>
<returnValue>0</returnValue>
</expectations>
</TEST>
</atn>
</unifiedTestConfiguration>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment