5 bin="${PWD}/../thtml2doxy.py"
6 includeslist="${PWD}/includes.txt"
8 function process_file() {
11 quiet="$2" # set it to 1 to activate
12 stop="$3" # set it to 1 to activate
15 [[ $quiet == 1 ]] && quiet_flag=''
17 t=$( mktemp -d /tmp/thtml2doxy-XXXXX )
21 out1="${t}/pass1/$( basename "${src}" )"
22 out2="${t}/pass2/$( basename "${src}" )"
26 "${bin}" -o $quiet_flag $(cat "${includeslist}") "${src}" > "${out1}"
28 if [[ $stop == 1 || $r1 != 0 ]] ; then
29 read -p "run1 terminated with ${r1}: type 'sh' to enter a shell..." ans
30 [[ "$ans" == 'sh' ]] && bash
33 if [[ $r1 != 0 ]] ; then
35 echo "run1 broken (exitcode ${r1}), makes no sense to continue"
43 "${bin}" -o $quiet_flag $(cat "${includeslist}") "${out1}" > "${out2}"
45 if [[ $stop == 1 || $r2 != 0 ]] ; then
46 read -p "run2 terminated with ${r2}: type 'sh' to enter a shell..." ans
47 [[ "$ans" == 'sh' ]] && bash
50 if [[ $quiet != 1 ]] ; then
53 echo '=== BEGIN DIFF1 ==='
54 diff -rupN "${src}" "${out1}" | pygmentize -ldiff
55 echo '=== END DIFF1 ==='
59 if [[ $r2 == 0 ]] ; then
60 echo '=== BEGIN DIFF2 ==='
61 diff -rupN "${out1}" "${out2}" | pygmentize -ldiff
62 echo '=== END DIFF2 ==='
67 echo '=== BEGIN REPORT ==='
70 echo '=== END REPORT ==='
81 r1s="r1:${red}fail${non}($r1)"
82 [[ $r1 == 0 ]] && r1s="r1:${gre}ok${non}"
84 r2s="r2:${red}fail${non}($r2)"
85 difs="diff:${red}fail${non}"
87 if [[ $r2 == 0 ]] ; then
89 r2s="r2:${gre}ok${non}"
91 diff -rupN "${out1}" "${out2}" > "${t}/diff2.txt"
92 ndif=$( cat "${t}/diff2.txt" | wc -l )
93 [[ $ndif == 0 ]] && difs="diff:${gre}ok${non}"
97 echo -e "${cya}${src}${non} ${r1s} ${r2s} ${difs}"
98 if [[ $ndif != 0 ]] ; then
99 cat "${t}/diff2.txt" | pygmentize -ldiff
101 read -p "unexpected diffs found between run1 and run2: type 'sh' to enter a shell..." ans
102 [[ "$ans" == 'sh' ]] && bash
120 if [[ ! -e "${includeslist}" ]] ; then
121 echo 'no list of includes found'
126 exec 3< <( find "${PWD}/../../TPC/" -name '*.h' )
127 while read -r -u3 file ; do
130 process_file "${file}" 1 0 || break
134 # e.g. test single classes
135 # class="${PWD}/../../TPC/TPCsim/AliTPC.cxx"
138 # process_file "${base}.cxx" 0 1