forked from dnschneid/crouton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
genreport.sh
executable file
·61 lines (56 loc) · 1.1 KB
/
genreport.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Collect list of tests
tests="`ls */results/*-test | sed -e 's|.*/\([^\.]*\)\..*|\1|' | sort -u`"
machines="`ls -d */status | sed -e 's|\([^/]*\)/.*|\1|' | sort -u`"
cat <<EOF
<html>
<head>
<style>
table.outer {
border-collapse: collapse;
}
th.outer,td.outer {
border: 1px solid black;
border-spacing: 0px;
padding: 0px;
}
th.outer {
padding: 3px
}
td.outer {
text-align: center;
}
table.inner {
width: 100%;
height: 100%;
border-collapse: collapse;
}
td.inner {
padding: 3px;
text-align: center;
}
#PASSED {
background-color: rgb(0, 255, 0);
}
#FAILED {
background-color: rgb(255, 0, 0);
}
#UNKNOWN {
background-color: rgb(128, 128, 128);
}
#BLANK {
background-color: rgb(240, 240, 240);
}
</style>
</head>
<body>
EOF
pwd="`pwd`"
echo "<h1>`basename "$pwd"`</h1>"
echo "<div>Last updated: `TZ= date` (`date +"%H:%M:%S %Z"`)</div>"
ls "`dirname $0`/reports/"* 2>/dev/null | sort | while read -r report; do
if [ -x "$report" -a "${report%\~}" = "$report" ]; then
echo "Sourcing $report" 1>&2
( . "$report" )
fi
done
echo '</body></html>'