commit eb2f88b44f6fccf96cf349cd95a65ecf1f25b73a
parent 8ee45fa4dfcf947a8c119a1d3c7ab8cd20c2535c
Author: Daniel Gultsch <daniel@gultsch.de>
Date: Sat, 18 Jun 2016 20:14:13 +0200
very hacky tools to render a table from the reports
Diffstat:
2 files changed, 83 insertions(+), 0 deletions(-)
diff --git a/reports/tohtml.php b/reports/tohtml.php
@@ -0,0 +1,71 @@
+#!/usr/bin/php
+<!DOCTYPE html>
+<html>
+ <head>
+ <link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
+ <style type="text/css">
+ body {
+ color: rgba(0,0,0,0.87);
+ font-family: 'Roboto', sans-serif;
+ font-weight: 400;
+ font-size: 13pt;
+ background-color: #fafafa;
+ }
+ table tbody tr td.passed {
+ background-color: #43a047;
+ }
+ table tbody tr td.failed {
+ background-color: #e53935;
+ }
+ table tr:hover td.passed {
+ background-color: #2e7d32;
+ }
+ table tr:hover td.failed {
+ background-color: #c62828;
+ }
+ table tr:hover td {
+ background-color: #e0e0e0;
+ }
+ a {
+ color: #3f51b5;
+ }
+ p.small {
+ font-size: 10pt;
+ }
+ </style>
+ </head>
+ <body>
+<?php
+$reports = json_decode(file_get_contents('complete.json'),true);
+$headers = array_keys(reset($reports));
+?>
+<table>
+ <thead>
+ <tr>
+ <th></th>
+ <?php
+ foreach($headers as &$head) {
+ echo "<th>".htmlentities($head)."</th>";
+ }
+ ?>
+ </tr>
+ </thead>
+ <tbody>
+ <?php
+ foreach($reports as $server => $report) {
+ echo '<tr>';
+ echo '<td>'.htmlentities($server).'</td>';
+ foreach($report as $data) {
+ $pass = 'PASSED' === $data;
+ echo '<td class="';
+ echo $pass ? 'passed' : 'failed';
+ echo '"></td>';
+ }
+ echo '</tr>';
+ }
+ ?>
+ </tbody>
+</table>
+<p class="small">Copyright 2016 <a href="https://gultsch.de">Daniel Gultsch</a> · Data gathered with <a href="https://github.com/iNPUTmice/ComplianceTester">XMPP Compliance Tester</a> · Last update <?= date("Y-m-d")?> (actual data might be older)</p>
+</body>
+</html>
diff --git a/reports/tojson.sh b/reports/tojson.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+reports=(*.txt)
+pos=$(( ${#reports[*]} - 1 ))
+last=${reports[$pos]}
+echo -n '{'
+for report in "${reports[@]}"; do
+ server=$(echo $report | sed 's/.txt//')
+ echo -n "\"$server\":"
+ echo -n '{' ; tail -n 16 $report | head -n 11 | sed 's/running //' | sed 's/…//' | awk -F '\t\t' '{ printf "\"" $1 "\":\"" $2 "\""; if (NR != 11) printf "," }'; echo -n '}'
+ if [[ $report != $last ]]; then echo -n ','; fi;
+done;
+echo '}'