]> ocean-lang.org Git - ocean/blob - tools/mark-untested
oceani: pass 'rules' into the 'compat' type function.
[ocean] / tools / mark-untested
1 #!/bin/sh
2
3 sed -i -e 's,   // UNTESTED$,,' $(git grep -l  '// UNTESTED$' .)
4
5 case $1 in
6   remove )
7         exit 0
8     ;;
9
10   * )
11         rm coverage/*.mdc.gcov
12         make SKIP_VALGRIND=1 SKIP_COVERAGE_CHECK=1 oceani_test_suite || exit 1
13         for i in coverage/*.mdc.gcov
14         do
15          b=${i%.gcov}
16          b=${b#coverage/}
17          if [ ! -f "$b" ]; then 
18             continue
19          fi
20          grep '#####:' "$i" | grep -vE '(NOTEST|UNTESTED|:      *##|}\$$|:$|:[  ]*(\||\$))' |
21              awk -F: '{printf "%ds,$,   // UNTESTED,\n", $2}' |
22              sed -i -e 's,[      ]*// UNTESTED$,,' -f - "$b"
23          grep '[0-8]: *[1-9][0-9]*:.*// NOTEST$' "$i" |
24              awk -F: '{printf "%ds,[    ]*// NOTEST$,,\n", $2}' |
25                 sed -i -f - "$b"
26          grep -c UNTESTED "$b"
27         done
28 esac
29