From a4561c5f6253de226732ca9de883e603456832d6 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Tue, 5 Sep 2023 12:20:45 -0400 Subject: deqp-results-to-markdown: Add script --- deqp-results-to-markdown | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 deqp-results-to-markdown diff --git a/deqp-results-to-markdown b/deqp-results-to-markdown new file mode 100755 index 0000000..0874513 --- /dev/null +++ b/deqp-results-to-markdown @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 + +import csv +import collections + + +def main(): + outcomes = ('Pass', 'Fail', 'Skip', 'Warn', 'Timeout', 'Flake') + header = ''.join([ + '| | ', ' | '.join(outcomes), ' |\n', + '| ---------------- | ', ' | '.join([(len(o) - 1) * '-' + ':' for o in outcomes]), ' |', + ]) + test_results = ''.join([ + '| **dEQP-{API}** |{', '}|{'.join(outcomes), '}|', + ]) + + print(header) + + for API in ('gles2', 'gles3', 'gles31', 'vk'): + histogram = collections.Counter() + for o in outcomes: + histogram[o] = 0 + + with open(f'deqp-{API}/results.csv') as csvfile: + reader = csv.reader(csvfile) + for row in reader: + test_result = row[1] + histogram[test_result] += 1 + + for o in outcomes: + if histogram[o] == 0: + histogram[o] = ' ' + + print(test_results.format(API=API.upper(), **histogram)) + + +if __name__ == '__main__': + main() -- cgit v1.2.3