6 ##########################
7 # Important: This script is to be run from trunk/moon/test
8 # This file converts a Moonlight DRTList.xml to the MS DRTList.txt
9 ##########################
12 def __init__(self
,id):
14 self
.feature
= 'unknown'
15 self
.owner
= 'moonlight'
17 def _tif_or_png(self
):
18 filename
= self
.master10
.split('/')[-1] # mytest.xaml
20 filename
= filename
.split('.')[0] # mytest
22 if self
.feature
== "Animation":
26 self
.master10
= "../harness/masters/%s" % filename
31 x
= '\t<Test id="%s">\n' % (self
.id)
32 x
+= '\t\t<inputFile="%s"/>\n' % self
.input
33 x
+= '\t\t<masterFile10="%s"/>\n' % self
.master10
34 if self
.master11
!= None and self
.master11
!= '':
35 x
+= '\t\t<masterFile11="%s"/>\n' % self
.master11
36 x
+= '\t\t<owner="%s"/>\n' % self
.owner
37 x
+= '\t\t<featureName="%s"/>\n' % self
.feature
41 print "\nUsage: convert-drt.py [--missing]\n"
42 print " --missing Creates a drtlist.txt of only test with missing master files"
46 # saveMasters.py --missing, --regen
53 longopts
= ['help','missing',]
54 opts
, args
= getopt
.getopt(sys
.argv
[1:],shortopts
, longopts
)
55 except getopt
.GetoptError
, err
:
61 if o
in ('-h','--help'):
64 if o
in ('-m','--missing'):
68 doc
= xml
.dom
.minidom
.parse("xaml/drtlist.xml")
69 drtnode
= doc
.childNodes
[0]
73 for testnode
in drtnode
.childNodes
:
74 if ((testnode
.localName
is not None) and (testnode
.localName
!= "")):
75 #print'\t<Test id="%s">' % (testnode.getAttribute("id"))
79 test
= drtTest(testnode
.getAttribute("id"))
80 test
.input = testnode
.getAttribute("inputFile")
81 test
.master10
= testnode
.getAttribute('masterFile10')
82 test
.master11
= testnode
.getAttribute('masterFile11')
84 if testnode
.getAttribute('inputFile').find('animation') != -1:
85 test
.feature
= "Animation"
86 elif testnode
.getAttribute('featureName') != '':
87 test
.feature
= testnode
.getAttribute('featureName')
89 #print '\t\t<featureName="%s"/>' % feature
91 # Added these attributes if non-existent
92 if testnode
.getAttribute('owner') != '':
93 test
.owner
= testnode
.getAttribute('owner')
102 if __name__
== '__main__':