| 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 |
COUNT=$1 |
| 19 |
# Assumes *full* data exists. This script only does 'head -${COUNT}' on the complete data files. |
| 20 |
# Should rename ${SUITE}_last20.data to something more general.. |
| 21 |
TOOLDIR="${DERBYDIR}/${BRANCH_DIR}/tools/testing/reporting/scripts" |
| 22 |
. ${TOOLDIR}/env |
| 23 |
|
| 24 |
# We have one catalog per platform |
| 25 |
if [ ! -e ${TESTLOGDIR} ] |
| 26 |
then |
| 27 |
echo "${TESTLOGDIR} does not exist" |
| 28 |
exit |
| 29 |
fi |
| 30 |
|
| 31 |
# Get the list of testsuite we are running: |
| 32 |
TESTLISTFILE="${DERBYDIR}/testing/testlist" |
| 33 |
SUITES=`gawk '{ print $1 }' ${TESTLISTFILE} | grep -v "^#"` |
| 34 |
|
| 35 |
# Get the set of platforms |
| 36 |
cd ${TESTLOGDIR} |
| 37 |
PLATFORMS=`ls` |
| 38 |
NOOFPLFS=`echo ${PLATFORMS} | wc -w` |
| 39 |
PLFNO=1 |
| 40 |
|
| 41 |
# Get the list of revisions |
| 42 |
# Here we use all. |
| 43 |
REVISIONSFILE="${REVISIONLIST}" |
| 44 |
# REVISIONS=`cat ${REVISIONSFILE} | head -${COUNT} | gawk '{ print $1 }' | grep -v "^#"` |
| 45 |
# The 'head -${COUNT}' is a bit rough: includes # comment lines... |
| 46 |
STARTREV=`head -${COUNT} ${REVISIONSFILE} | gawk '{ print $1 }' | grep -v "^#" | tail -1` |
| 47 |
|
| 48 |
# DEBUG echo "PLATFORMS: ${PLATFORMS}, SUITES: ${SUITES}" |
| 49 |
for PLATFORM in ${PLATFORMS} |
| 50 |
do |
| 51 |
echo "${PLATFORM} [${PLFNO}/${NOOFPLFS}]" |
| 52 |
for SUITE in ${SUITES} |
| 53 |
do |
| 54 |
echo " ${SUITE}" |
| 55 |
# head -${COUNT} ${DERBYDIR}/testing/Full/plot/${PLATFORM}/${SUITE}.data > ${DERBYDIR}/testing/Full/plot/${PLATFORM}/${SUITE}_last20.data |
| 56 |
|
| 57 |
echo -n "" > ${DERBYDIR}/testing/Full/plot/${PLATFORM}/${SUITE}_last20.data |
| 58 |
while read LINE |
| 59 |
do |
| 60 |
LINEREV=`echo ${LINE} | gawk '{ print $2 }'` |
| 61 |
if [ ${LINEREV} -lt ${STARTREV} ] |
| 62 |
then |
| 63 |
# echo " break on ${LINEREV}" |
| 64 |
break |
| 65 |
fi |
| 66 |
echo ${LINE} >> ${DERBYDIR}/testing/Full/plot/${PLATFORM}/${SUITE}_last20.data |
| 67 |
done < ${DERBYDIR}/testing/Full/plot/${PLATFORM}/${SUITE}.data |
| 68 |
|
| 69 |
done # SUITES |
| 70 |
let " PLFNO = ${PLFNO} + 1 " |
| 71 |
done # PLATFORMS |