-
Notifications
You must be signed in to change notification settings - Fork 1
/
bladeR
38 lines (28 loc) · 2.07 KB
/
bladeR
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
#!/bin/bash
#Copyright 2016 Patryk Bukowinski
#Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
#http://www.apache.org/licenses/LICENSE-2.0
#Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
[ ! -n $BUILD_DIR ] && (echo "missing build dir env, exiting ..."; exit 1)
yATFF=$(cat <<"EOF"
`.t set `T`E`N`G`q`r!(('[.[`.t.R;();,;];])@/:{.[x;(),y;0b]}@/:(1b~;~;('[~:;~]);>)),{ -1 sv["|";.z.x 1 2 3 9],/: .Q.s2 count each group x; exit any not x},{ r,:@[{system x; .t.R};"l ", .z.x 4;{ -2 x; 0b}]; .t.q[r]}; .t.r[]
EOF
)
for p in $(ls $BUILD_DIR); do P=$BUILD_DIR/$p/test/${TT:-a}.t;
[ -f $P ] && for c in `<$P`; do C=$BUILD_DIR/$p/test/$c/${TT:-a}.t;
brc=$BUILD_DIR/$p/test/$c/bashrc; [ -f $brc ] && source $brc >/dev/null 2>&1;
prep=$BUILD_DIR/$p/test/$c/prep.sh; [ -f $prep ] && eval $prep >/dev/null 2>&1;
[ -f $C ] && for tf in `<$C`; do T=$BUILD_DIR/$p/test/$c/$tf;
[ -f $T ] && q -br $p $c $tf $T -t 100 -q </dev/null 2>/dev/null <<< $yATFF;
done
tear=$BUILD_DIR/$p/test/$c/tear.sh; [ -f $tear ] && eval $tear >/dev/null 2>&1;
done
done | tee $BUILD_DIR/c.csv
c2ju=$(cat <<"EOF"
r:select failures:sum not pass, tests:1, sum assertions by testsuite,name:testcase from update testsuite:sv'[`;pkg,'testsuite] from flip `pkg`testsuite`testcase`pass`assertions!("SSSBJ";"|") 0: hsym `$ .z.x 1;
-1 "<?xml version=\"1.0\" encoding=\"utf-8\"?>", .h.htac[`testsuites;string sum get r] "\n" sv ((),/:string 0!select sum failures, sum tests, sum assertions by name:testsuite from r ).h.htac[`testsuite]'("\n" sv' get (.h.htac[`testcase;;""] each (),/:string delete testsuite from r) group[key[r]`testsuite]);
exit sum[get r]`failures
EOF
)
exec q -cf $BUILD_DIR/c.csv -q </dev/null > $BUILD_DIR/t.xml <<<$c2ju
exit $?