Debian Codegraph @

tools/testing/reporting/scripts/mkGNUplot

raw
1 #!/bin/bash
2
3 # Licensed to the Apache Software Foundation (ASF) under one or more
4 # contributor license agreements. See the NOTICE file distributed with
5 # this work for additional information regarding copyright ownership.
6 # The ASF licenses this file to you under the Apache License, Version 2.0
7 # (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17
18 TOOLDIR="${DERBYDIR}/${BRANCH_DIR}/tools/testing/reporting/scripts"
19 . ${TOOLDIR}/env
20
21 # We have one catalog per platform
22 if [ ! -e ${TESTLOGDIR} ]
23 then
24 echo "${TESTLOGDIR} does not exist"
25 exit
26 fi
27
28 # Get the list of testsuite we are running:
29 TESTLISTFILE="${DERBYDIR}/testing/testlist"
30 SUITES=`gawk '{ print $1 }' ${TESTLISTFILE} | grep -v "^#"`
31
32 # Get the set of platforms
33 cd ${TESTLOGDIR}
34 PLATFORMS=`ls`
35 NOOFPLFS=`echo ${PLATFORMS} | wc -w`
36 PLFNO=1
37
38 # Get the list of revisions
39 # Here we use all.
40 REVISIONSFILE="${REVISIONLIST}"
41 REVISIONS=`cat ${REVISIONSFILE} | gawk '{ print $1 }' | grep -v "^#"`
42
43 mkdir -p ${DERBYDIR}/testing/Full/plot
44 chmod go+rx ${DERBYDIR}/testing/Full/plot
45
46 for PLATFORM in ${PLATFORMS}
47 do
48 echo "${PLATFORM} [${PLFNO}/${NOOFPLFS}]"
49 mkdir -p ${DERBYDIR}/testing/Full/plot/${PLATFORM}
50 chmod go+rx ${DERBYDIR}/testing/Full/plot/${PLATFORM}
51 for SUITE in ${SUITES}
52 do
53 echo " ${SUITE}"
54 echo -n "" > ${DERBYDIR}/testing/Full/plot/${PLATFORM}/${SUITE}.data
55 for REVISION in ${REVISIONS}
56 do
57 # echo " ${REVISION}"
58 # x = ${revision}
59 # baseRev = platform.baseline.revision
60 BASELINE=`head -1 ${PLATFORM}/baseline.csv | gawk '{ print $2 }'`
61 # durBase = platform.baseRev(suite).duration
62 BASETIME=`grep "^${SUITE} " ${PLATFORM}/${BASELINE}.csv | gawk '{ print $6 }'`
63 BASESECONDS=`grep "^${SUITE} " ${PLATFORM}/baseline.csv | gawk '{ print $3 }'`
64 # Jeez.... Shouldn't read this EVERY round...
65 REVDATE=`gawk '{ print $1 }' ${DERBYDIR}/UpdateLog/${REVISION}/UpdateTime`
66 if [ -e ${PLATFORM}/${REVISION}.csv ]
67 then
68 # 2: Number, 3: OK, 4: Failed, 5: Skipped
69 RES=`grep "^${SUITE} " ${PLATFORM}/${REVISION}.csv`
70 # yDur = platform.revision(suite).duration
71 TIME=`echo ${RES} | grep "^${SUITE} " | gawk '{ print $6 }'`
72 SECONDS=`${TOOLDIR}/toSeconds ${TIME}`
73 # yPercent= (yDur/durBase)*100
74 PERCENT=`${TOOLDIR}/calcPercent ${SECONDS} ${BASESECONDS}`
75 # echo "$x $yPercent" >> tmp.dur
76 # yNtests = platform.revision(suite).NumberOfTests
77 NTESTS=`echo ${RES} | grep "^${SUITE} " | gawk '{ print $2 }'`
78 # "$x $yNtests" >> tmp.Ntests
79 # yNok = platform.revision(suite).NumberOK
80 NOK=`echo ${RES} | grep "^${SUITE} " | gawk '{ print $3 }'`
81 # "$x $yNok" >> tmp.Nok
82 # yNfail = platform.revision(suite).NumberFail
83 NFAIL=`echo ${RES} | grep "^${SUITE} " | gawk '{ print $4 }'`
84 # "$x $yNfail" >> tmp.Nfail
85 echo "${REVDATE} ${REVISION} ${PERCENT} ${NTESTS} ${NOK} ${NFAIL}" \
86 >> ${DERBYDIR}/testing/Full/plot/${PLATFORM}/${SUITE}.data
87 echo -n "."
88 else
89 # echo " No ${REVISION} for ${PLATFORM}"
90 echo -n "-"
91 fi
92 done # REVISIONS
93 echo ""
94 done # SUITES
95 let " PLFNO = ${PLFNO} + 1 "
96 done # PLATFORMS