diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/canvas/test/webgl-conf/checkout/deqp/genHTMLfromTest.py | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/canvas/test/webgl-conf/checkout/deqp/genHTMLfromTest.py')
-rw-r--r-- | dom/canvas/test/webgl-conf/checkout/deqp/genHTMLfromTest.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/dom/canvas/test/webgl-conf/checkout/deqp/genHTMLfromTest.py b/dom/canvas/test/webgl-conf/checkout/deqp/genHTMLfromTest.py new file mode 100644 index 000000000..47ad28ccc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/deqp/genHTMLfromTest.py @@ -0,0 +1,43 @@ +import os +import re + +# Generate an HTML file for each .test file in the current directory +# + +TEST_LIST_FILE = '00_test_list.txt'; +TEMPLATE = 'template.html'; + +def genHTML(template, test): + contents = re.sub('___TEST_NAME___', "'" + test + "'", template); + filename = test + '.html'; + print "Generating " + filename; + with open(test + '.html', 'w') as f: + f.write(contents); + return filename; + + +def process_test_files(template): + generated = []; + files = os.listdir(os.getcwd()); + for file in files: + found = re.search('(^[^.].*)\.test$', file); + if found: + generated.append(genHTML(template,found.group(1))); + return generated; + +def readTemplate(): + contents = None; + with open(TEMPLATE, 'r') as f: + contents = f.read(); + return contents; + + +template = readTemplate(); +if (template): + test_list = process_test_files(template); + print "Generating " + TEST_LIST_FILE; + with open(TEST_LIST_FILE, 'w') as f: + for item in test_list: + f.write(item + '\n'); +else: + print "Couldn't find template file: " + TEMPLATE; |