diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /dom/canvas/test/webgl-conf/checkout/deqp/genHTMLfromTest.py | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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 0000000000..47ad28ccc9 --- /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; |