source: rtems-testing/rtems-coverage/do_coverage @ c6ae584

4.11
Last change on this file since c6ae584 was c6ae584, checked in by Jennifer Averett <Jennifer.Averett@…>, on May 25, 2010 at 5:51:12 PM

2010-05-25 Jennifer Averett <Jennifer.Averett@…>

  • do_coverage, rtems_items.sed: Moved the summary report to the covoar common reports in the report class and out of the rtems specific items in the report index.
  • Property mode set to 100755
File size: 19.9 KB
Line 
1#! /bin/sh
2#
3#  Script to perform a single coverage test run on a single BSP
4#  in a specific configuration.  This script automates all steps
5#  of building RTEMS, running the tests, and generating the reports.
6#
7#  $Id$
8#
9
10vfile=`dirname $0`/VERSIONS-COVERAGE
11if [ ! -r ${vfile} ] ; then
12  echo VERSIONS-COVERAGE file not found
13  exit 1
14fi
15
16source ${vfile}
17
18if [ ! -d ${BASEDIR} ] ; then
19  echo Have you set the BASEDIR in VERSIONS correctly?
20  exit 1
21fi
22
23progname=${0##*/}        # fast basename hack for ksh, bash
24
25USAGE="
26usage: $progname [ -opts ]
27        -v        -- verbose (default=no)
28        -d        -- analyze Core Configuration (default=yes)
29        -D        -- analyze Developmental Configuration (default=yes)
30        -A        -- Execute all steps (default=no)
31        -B BSP    -- Specify BSP to test
32        -P        -- Enable POSIX API (default=yes)
33        -S        -- Optimize for size (default=no)
34        -m        -- Update and build covMerge (default=no)
35        -u        -- Do CVS update on RTEMS (default=no)
36        -c        -- Configure RTEMS (default=no)
37        -b        -- Build RTEMS (default=no)
38        -C        -- get tests from build to test execution point (default=no)
39        -L        -- do not link files to test execution point (default=link)
40        -r        -- run the tests (default=no)
41        -R        -- generate reports (default=no)
42        -f        -- publish the results to ftp site (default=no)
43        -t        -- save the results locally (default=no)
44        -O        -- output directory (default=BSP-CONF-YYYYMMDD-HHMM)
45        -p        -- project name (default empty)
46
47Notes:  + There are currently NO checks at each step to determine if
48          the previous steps were performed!!!
49        + Use of each option toggles the setting.  For example, \"-v -v -A -u\"
50          results in verbose=no and all steps done except CVS update on RTEMS."
51
52#   log an error to stderr
53prerr()
54{
55    echo "$*" >&2
56}
57
58fatal() {
59    prerr "$USAGE"
60    [ "$1" ] && (prerr ; prerr $*);
61    exit 1
62}
63
64check_status()
65{
66  if [ $1 -ne 0 ] ; then
67    shift
68    echo "FAILED: " "$*" >&2
69    exit 1
70  fi
71}
72
73toggle()
74{
75  case $1 in
76    no)  echo "yes" ;;
77    yes) echo "no" ;;
78    *)   fatal "Unknown value to toggle ($1)" ;;
79  esac
80}
81
82# parse arguments for these
83verbose="no"
84do_all="no"
85do_posix="yes"
86do_optimize_size="no"
87do_covmerge="no"
88do_rtems_update="no"
89do_rtems_configure="no"
90do_rtems_build="no"
91do_copy_tests="no"
92do_link_tests="yes"
93do_run_tests="no"
94do_reports="no"
95do_publish="no"
96do_save_tarballs="no"
97do_core="yes"
98do_developmental="yes"
99outputDir=""
100BSP="not_set"
101
102while getopts vB:PSmAucbCLrRftO:dD OPT
103do
104    case "$OPT" in
105        A)
106          do_all="yes"
107          do_covmerge="yes"
108          do_posix="yes"
109          do_rtems_update="yes"
110          do_rtems_configure="yes"
111          do_rtems_build="yes"
112          do_copy_tests="yes"
113          do_run_tests="yes"
114          do_reports="yes"
115          ;;
116        d) do_core=`toggle ${do_core}` ;;
117        D) do_developmental=`toggle ${do_developmental}` ;;
118        B) BSP="${OPTARG}";;
119        O) outputDir="${OPTARG}";;
120        v) verbose=`toggle ${verbose}` ;;
121        m) do_covmerge=`toggle ${do_covmerge}` ;;
122        P) do_posix=`toggle ${do_posix}` ;;
123        S) do_optimize_size=`toggle ${do_optimize_size}` ;;
124        u) do_rtems_update=`toggle ${do_rtems_update}` ;;
125        c) do_rtems_configure=`toggle ${do_rtems_configure}` ;;
126        b) do_rtems_build=`toggle ${do_rtems_build}` ;;
127        C) do_copy_tests=`toggle ${do_copy_tests}` ;;
128        L) do_link_tests=`toggle ${do_link_tests}` ;;
129        r) do_run_tests=`toggle ${do_run_tests}` ;;
130        R) do_reports=`toggle ${do_reports}` ;;
131        f) do_publish=`toggle ${do_publish}` ;;
132        t) do_save_tarballs=`toggle ${do_save_tarballs}` ;;
133        *) fatal;;
134    esac
135done
136
137#  If we are to update or configure RTEMS, then we need to clean the
138#  RTEMS build tree up.
139do_clean="no"
140if [ ${do_rtems_update} = "yes" -o \
141     ${do_rtems_configure} = "yes" ] ; then
142  do_clean="yes"
143fi
144
145# allow bsp override
146if [ ${BSP} == "not_set" ] ; then
147  fatal "No BSP selected"
148fi
149
150# you can't publish unless ftp directory is accessible
151if [ ${do_publish} = "yes" ] ; then
152  if [ ! -d ${FTPDIR} ] ; then
153    fatal "Publishing results requested and ${FTPDIR} does not exist"
154  fi
155fi
156
157# For most BSPs, there is a script with the same name as the BSP.
158RUNNER=${BSP}
159
160RTEMSEXT=${DEFAULT_EXEEXT}
161COVEXT=cov
162case ${BSP} in
163  pc386)
164    CPU=i386
165    COVERAGE_FORMAT=QEMU
166    RTEMS_EXTRA_ARGS="USE_COM1_AS_CONSOLE=1"
167    RTEMS_EXTRA_ARGS="${RTEMS_EXTRA_ARGS} BSP_PRESS_KEY_FOR_RESET=0"
168    RTEMSEXT=exe
169    ;;
170  uC5282)
171    CPU=m68k
172    COVERAGE_FORMAT=QEMU
173    RTEMSEXT=exe
174    COVEXT=tra
175    ;;
176  qemuppc)
177    RTEMSEXT=ralf
178    CPU=powerpc
179    COVERAGE_FORMAT=QEMU
180    ;;
181  lm32_evr)
182    CPU=lm32
183    COVERAGE_FORMAT=QEMU
184    RTEMSEXT=exe
185    COVEXT=tra
186    RUNNER=qemu-lm32_evr
187    RTEMS_EXTRA_ARGS="ON_SIMULATOR=1"
188    ;;
189  erc32|leon2|leon3)
190    CPU=sparc
191    COVERAGE_FORMAT=TSIM
192    ;;
193  edb7312|rtl22xx|gumstix|smdk2410)
194    CPU=arm
195    COVERAGE_FORMAT=Skyeye
196    RTEMS_EXTRA_ARGS="ON_SKYEYE=1"
197    ;;
198  *)
199    fatal "Unsupported BSP (${BSP}) for coverage analysis."
200    ;;
201esac
202
203if [ ${RTEMS_VERSION} = 4.6 -o ${RTEMS_VERSION} = 4.5 ] ; then
204  TARGET=${CPU}-rtems
205else
206  TARGET=${CPU}-rtems${RTEMS_VERSION}
207fi
208
209##### VERBOSE
210print_verbose()
211{
212  echo "BSP:                  " ${BSP}
213  echo "Target:               " ${TARGET}
214  echo "Compiler version:     " `${TARGET}-gcc --version  | grep gcc`
215  echo "do_optimize_size:     " ${do_optimize_size}
216  echo "Optimization Level:   " ${c_opt}
217  echo "POSIX Enabled:        " ${do_posix}
218  echo "Core Configuration    " ${do_core}
219  echo "Developmental Code:   " ${do_developmental}
220  echo "do_all:               " ${do_all}
221  echo "do_covmerge           " ${do_covmerge}
222  echo "do_rtems_update:      " ${do_rtems_update}
223  echo "do_rtems_configure:   " ${do_rtems_configure}
224  echo "do_rtems_build:       " ${do_rtems_build}
225  echo "do_copy_tests:        " ${do_copy_tests}
226  echo "do_link_tests:        " ${do_link_tests}
227  echo "do_run_tests:         " ${do_run_tests}
228  echo "do_reports:           " ${do_reports}
229  echo "do_publish:           " ${do_publish}
230  echo "do_save_tarballs:     " ${do_save_tarballs}
231  echo "Clean Before:         " ${do_clean}
232  echo "Executable Extension: " ${RTEMSEXT}
233  echo "Coverage Extension:   " ${COVEXT}
234}
235
236if [ ${do_optimize_size} = yes ] ; then
237 c_opt=-Os
238else
239 c_opt=-O2
240fi
241
242if [ ${do_core} = "no" -a ${do_developmental} = "no" ]; then
243  fatal "No symbol configurations to analyze selected"
244fi
245
246if [ ${verbose} = "yes" ] ; then
247  print_verbose
248fi
249
250# Basic error checking and sanity checking on the directory structure
251# and PATH
252if [ ! -d ${COVBASE} ] ; then
253  echo "The directory you specified for the base of the coverage run is "
254  echo "not present. (${COVBASE})"
255  exit 1
256fi
257
258if [ ! -d ${RTEMSDIR} ] ; then
259  echo "Check out RTEMS!!!"
260  exit 1
261fi
262
263type ${TARGET}-gcc
264check_status $? "Path appears to be broken"
265
266# Start real action
267NM=${TARGET}-nm
268type ${NM}
269check_status $? "Cannot find ${NM} on PATH"
270
271# Locate the custom file
272custom=${RTEMSDIR}/make/custom/${BSP}.cfg
273if [ ! -r ${custom} ] ; then
274  custom=`ls -1 \
275     ${RTEMSDIR}/c/src/lib/libbsp/${CPU}/*/make/custom/${BSP}.cfg 2>/dev/null`
276  check_status $? "unable to find a custom file"
277  if [ x${custom} = x -o ! -r ${custom} ] ; then
278    echo "Unable to read ${custom}"
279    exit 1
280  fi
281fi
282
283grep "^CFLAGS_OPTIMIZE_V.*=.*-O[s01234]" ${custom} >/dev/null
284if [ $? -ne 0 ] ; then
285  echo "Unable to find CFLAGS_OPTIMIZE_V in ${custom}"
286  exit 1
287fi
288
289EXTENSION=${c_opt}
290if [ ${do_posix} = yes ] ; then
291  EXTENSION=${EXTENSION}P
292else
293  EXTENSION=${EXTENSION}p
294fi
295
296year=`date +%Y`
297day=`date +%Y%m%d`
298hour=`date +%H`
299minute=`date +%M`
300
301echo "Testing ${TARGET}/${BSP} at optimization (${c_opt})"
302
303# print a data element in table
304print_element()
305{
306  echo "  <TD>"${*}"</TD>"
307}
308
309# generate table row of results in html
310generate_html()
311{
312  summary=$1
313  echo "<TR>"
314    print_element ${day}
315    print_element ${hour}:${minute}
316    print_element ${c_opt}
317    print_element ${do_posix}
318    print_element ${analyze_developmental}
319    print_element `grep "Uncovered range" ${summary} | cut -d ':' -f2`
320    print_element `grep "age Not Exec" ${summary} | cut -d ':' -f2`
321    print_element `grep "age Exec" ${summary} | cut -d ':' -f2`
322    print_element `grep "Bytes Not Exec" ${summary} | cut -d ':' -f2`
323    print_element `grep "Bytes Analyzed" ${summary} | cut -d ':' -f2`
324    print_element "<A HREF=\"${results_dir}\">untarred</A> " \
325                  "<A HREF=\"${results_dir}.tar.bz2\">tarball</A> "
326  echo "</TR>"
327}
328
329# generate the coverage report set
330generate_reports()
331{
332  if [ $# -ne 3 ] ; then
333    echo Usage: ${0} TARGET BSP COVERAGE_FORMAT
334    exit 1
335  fi
336
337  TARGET=${1}
338  BSP=${2}
339  COVERAGE_FORMAT=${3}
340
341  cd ${BASEDIR}/${BSP}-tests/
342  check_status $? "cd ${BSP}-tests"
343
344  sed -e "s/@FORMAT@/${COVERAGE_FORMAT}/" \
345      -e "s/@TARGET@/${TARGET}/" \
346      -e "s,@EXPLANATIONS@,${COVBASE}/Explanations.txt," \
347      -e "s,@SYMBOLS_FILE@,${BASEDIR}/${BSP}-tests/rtems.syms," \
348      -e "s,@OUTPUT_DIRECTORY@,${results_dir}," \
349      -e "s/@EXECUTABLE_EXTENSION@/exe/" \
350      -e "s/@COVERAGE_EXTENSION@/${RTEMSEXT}.${COVEXT}/" \
351      -e "s/@PROJECT_NAME@/RTEMS ${RTEMS_VERSION}/" \
352      <${COVBASE}/rtems_config.in \
353      >${BASEDIR}/${BSP}-tests/config
354  check_status $? "Unable to generate COVOAR config file"
355
356  rm -rf ${results_dir}
357  mkdir  ${results_dir}
358  covoar -C ${BASEDIR}/${BSP}-tests/config \
359    *.exe
360  check_status $? "covoar failed"
361
362  # This should be made obsolete by sortable tables.
363  #(echo "====== Largest Range Sizes (Size and Count)======" ; \
364  #  grep ^Size uncovered.txt | cut -d':' -f2 | sort -n | uniq -c | \
365  #     tail -15 | sed -e 's/ *\([0-9]*\) *\([0-9]*\)/\2 \1/' | sort -n -r | \
366  #     while read l; do printf "%6d %6d\n" $l; done ; \
367  #  echo "=====================================" ) >>summary.txt
368
369  check_endof >${results_dir}/testsWithNoEndOfTest.txt
370
371  # Generate the configuration settings file
372  (
373    echo "#"
374    echo "#  Settings for this coverage test run"
375    echo "#"
376    echo
377    print_verbose
378  ) >${results_dir}/configuration.txt
379
380  # XXX summary should be in output directory
381  generate_html ${results_dir}/summary.txt >${results_dir}/row.html
382
383  cat ${results_dir}/summary.txt ${results_dir}/testsWithNoEndOfTest.txt
384
385  mv ${results_dir}/index.html ${results_dir}/index.html.tmp
386  sed -f ${COVBASE}/rtems_items.sed  \
387    <${results_dir}/index.html.tmp \
388    >${results_dir}/index.html
389
390  RTEMSLIB=${BASEDIR}/b-${BSP}/${TARGET}/${BSP}/lib/librtemscpu.a
391
392  if [ -r ${RTEMSLIB} ] ; then
393    while read symbol
394    do
395      line=`${TARGET}-nm --format=sysv \
396        ${BASEDIR}/b-${BSP}/${TARGET}/${BSP}/lib/librtemscpu.a | \
397        grep FUNC | sed -e's/|/ | /g' | grep ${symbol}`
398      size=`echo ${line} | cut -d'|' -f5 | tr "[:lower:]" "[:upper:]"`
399      size=`echo 16 i ${size} p | dc`
400      echo "${size}     ${symbol}       unknown"
401    done <${results_dir}/no_range_uncovered.txt | sort -n -r \
402         >${results_dir}/sizes_unreferenced.txt
403  fi
404
405  cat ${results_dir}/sizes_unreferenced.txt ${results_dir}/sizes.txt | \
406    sort -n -r >${results_dir}/sizes_all.txt
407
408  # Now create the archive of information
409  cp ${COVOARBASE}/covoar.css ${COVOARBASE}/*gif ${COVOARBASE}/table.js ${results_dir}
410  echo "Results saved in ${results_dir}.tar.bz2"
411  tar cjf ${results_dir}.tar.bz2 ${results_dir}
412}
413
414# This grabs the list of methods from a library or object file
415filter_nm()
416{
417  for l in $*
418  do
419    if [ -r ${l} ] ; then
420      test ${verbose} = "yes" && echo Generating symbols from ${l} >&2
421      # echo "========= START $l"
422      ${TARGET}-nm --format=sysv $l | grep "FUNC|" | \
423        cut -d'|' -f1 | sed -e 's/ *$//'
424      # echo "========= END $l"
425    else
426      echo "${l} is not readable"
427    fi
428  done
429}
430
431# generate the list of symbols to analyze
432generate_symbols()
433{
434  if [ ${RTEMS_VERSION} = 4.6 -o ${RTEMS_VERSION} = 4.5 ] ; then
435    cd ${BASEDIR}/b-${BSP}/${TARGET}/c/${BSP}/exec
436    check_status $? "could not cd to object directory"
437
438    subd=o-optimize/
439  else
440    cd ${BASEDIR}/b-${BSP}/${TARGET}/c/${BSP}/cpukit
441    check_status $? "could not cd to object directory"
442
443    subd=
444  fi
445
446  if [ ${RTEMS_VERSION} = 4.5 ] ; then
447    filter_nm wrapup/rtems/o-optimize/librtems.a
448    if [ ${do_posix} = "yes" ] ; then
449      filter_nm wrapup/posix/o-optimize/libposix.a
450    fi
451
452    if [ ${analyze_developmental} = "yes" ] ; then
453      filter_nm ../lib/libc/${subd}libcsupport.a
454      filter_nm ../lib/libmisc/wrapup/${subd}libmisc.a
455    fi
456  else  # 4.6 or newer
457
458    # Base set of libraries to analyse.  Do NOT include libscorecpu.a!!!
459    filter_nm score/${subd}libscore.a
460    filter_nm sapi/${subd}libsapi.a
461    filter_nm rtems/${subd}librtems.a
462
463    # Now add the POSIX API onto that
464    if [ ${do_posix} = "yes" ] ; then
465      filter_nm posix/${subd}libposix.a
466    fi
467
468    # Now add developmental libraries
469    # NOTE: all non-network libraries are listed here.  --joel 5 March 2010
470    if [ ${analyze_developmental} = "yes" ] ; then
471      # filter_nm libfs/${subd}librfs.a
472      # filter_nm libfs/${subd}libdosfs.a
473      filter_nm libfs/${subd}libimfs.a
474      filter_nm libcsupport/${subd}libcsupport.a
475      # filter_nm libi2c/${subd}libi2c.a
476      # filter_nm zlib/${subd}libz.a
477      # filter_nm libmd/${subd}libmd.a
478      # filter_nm libmisc/${subd}libshell.a
479      filter_nm libmisc/${subd}libbspcmdline.a
480      filter_nm libmisc/${subd}libcpuuse.a
481      # filter_nm libmisc/${subd}libuuid.a
482      filter_nm libmisc/${subd}libstackchk.a
483      # filter_nm libmisc/${subd}libmw-fb.a
484      # NEVER INCLUDE libdummy.a!!!
485      # filter_nm libmisc/${subd}libdummy.a
486      # filter_nm libmisc/${subd}libfsmount.a
487      filter_nm libmisc/${subd}libstringto.a
488      filter_nm libmisc/${subd}libdevnull.a
489      # filter_nm libmisc/${subd}libcapture.a
490      filter_nm libmisc/${subd}libdumpbuf.a
491      # filter_nm libmisc/${subd}libmonitor.a
492      # filter_nm libmisc/${subd}libserdbg.a
493      # filter_nm libmisc/${subd}libuntar.a
494      # filter_nm libblock/${subd}libblock.a
495    fi
496  fi
497}
498
499# Now we are ready to start doing real work
500start=`date`
501
502# If necessary, clean up the RTEMS build and test run directories
503if [ ${do_clean} = "yes" ] ; then
504  echo "Cleaning before building"
505  rm -rf ${BASEDIR}/b-${BSP}
506  rm -rf ${BASEDIR}/${BSP}-tests
507else
508  echo "Skipping clean before building"
509fi
510
511# If they don't exist, create the RTEMS build and test run directories
512test -d ${BASEDIR}/b-${BSP}     || mkdir ${BASEDIR}/b-${BSP}
513test -d ${BASEDIR}/${BSP}-tests || mkdir ${BASEDIR}/${BSP}-tests
514
515# If requested, update and build the coverage support tools
516if [ ${do_covmerge} = "yes" ] ; then
517  echo "Updating and building covmerge..."
518
519  cd ${COVBASE}
520  check_status $? "cd covmerge"
521
522  cvs up -Pd 2>&1 | grep -v ^cvs
523  make clean all
524  check_status $? "build covmerge"
525
526  make
527  check_status $? "make covmerge"
528else
529  echo "Skipping Updating and building covmerge..."
530fi
531
532# If requested, update the RTEMS tree
533if [ ${do_rtems_update} = "yes" ] ; then
534  echo "Updating RTEMS ..."
535  cd ${RTEMSDIR}
536  check_status $? "cd rtems"
537
538  cvs up -Pd 2>&1 | grep -v ^cvs
539  ./bootstrap -c
540  ./bootstrap
541else
542  echo "Skipping Updating RTEMS ..."
543fi
544
545# If requested, configure RTEMS
546if [ ${do_rtems_configure} = "yes" ] ; then
547  # Now let's patch the make/custom file
548  sed -e "s/-O[0123s]/${c_opt}/" <${custom} >${custom}.tmp
549  mv ${custom}.tmp ${custom}
550
551  echo "Configuring RTEMS..."
552  rm -rf ${BASEDIR}/b-${BSP}/
553  mkdir ${BASEDIR}/b-${BSP}/
554  cd ${BASEDIR}/b-${BSP}/
555  check_status $? "cd b-${BSP}"
556
557  ##################
558  ################## WARNING!!!!!!
559  ##################
560  ################## BE CAREFUL ABOUT THIS CONFIGURE COMMAND.  IT IS
561  ################## VERY SPECIFIC TO COVERAGE TESTING
562  ##################
563  if [ ${do_posix} = "yes" ] ; then
564    posix_en=en
565  else
566    posix_en=dis
567  fi
568
569  if [ ${RTEMS_VERSION} = 4.5 ] ; then
570    ${RTEMSDIR}/configure \
571      --target=${TARGET} --enable-rtemsbsp=${BSP} \
572      --enable-maintainer-mode \
573      --disable-itron --${posix_en}able-posix --enable-tests \
574      --disable-networking --disable-ada --disable-cxx \
575      --prefix=${BASEDIR}/coverage/install >c.log 2>&1
576  else
577    ${RTEMSDIR}/configure NDEBUG=1 \
578      RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH=1 \
579      RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE=1 \
580      RTEMS_DO_NOT_UNROLL_THREADQ_ENQUEUE_PRIORITY=1 \
581      ${RTEMS_EXTRA_ARGS} \
582      --target=${TARGET} --enable-rtemsbsp=${BSP} \
583      --enable-maintainer-mode \
584      --disable-itron --${posix_en}able-posix --enable-tests \
585      --disable-networking --disable-ada --disable-cxx \
586      --prefix=${BASEDIR}/coverage/install >c.log 2>&1
587  fi
588  check_status $? "configuring RTEMS for ${BSP}"
589else
590  echo "Skipping Configuring RTEMS ..."
591fi
592
593# If requested, build RTEMS
594if [ ${do_rtems_build} = "yes" ] ; then
595  echo "Building RTEMS..."
596
597  cd ${BASEDIR}/b-${BSP}/
598  check_status $? "cd b-${BSP}"
599
600  if [ ${RTEMS_VERSION} = 4.6 -o ${RTEMS_VERSION} = 4.5 ] ; then
601    sleep 5  # 4.5 on chroot'ed env needs this for some reason
602    make >b.log 2>&1
603  else
604    cpus=`/usr/bin/getconf _NPROCESSORS_ONLN`
605    make -j${cpus} >b.log 2>&1
606  fi
607  check_status $? "Building RTEMS for ${BSP}"
608else
609  echo "Skipping Building RTEMS ..."
610fi
611
612# If requested, copy the tests from the build tree to the run tree
613if [ ${do_copy_tests} = "yes" ] ; then
614  echo "Copying tests..."
615
616  # clean destination
617  rm -rf ${BASEDIR}/${BSP}-tests/*
618  check_status $? "clean test directory"
619
620  cd ${BASEDIR}/b-${BSP}/
621  check_status $? "cd b-${BSP}"
622
623  find `pwd` -name "*.ralf" -o -name "*.exe" | while read f
624  do
625    rm -f ../${BSP}-tests/`basename ${f}`
626    if [ ${do_link_tests} = "yes" ] ; then
627      ln -s ${f} ../${BSP}-tests
628    else
629      cp ${f} ../${BSP}-tests
630    fi
631  done
632 
633else
634  echo "Skipping copying tests..."
635fi
636
637# If requested, run the tests with coverage reporting enabled
638if [ ${do_run_tests} = "yes" ] ; then
639  echo "Running tests..."
640  cd ${BASEDIR}/${BSP}-tests/
641  check_status $? "cd ${BSP}-tests"
642
643  time ${RUNNER} -c *.${RTEMSEXT}
644else
645  echo "Skipping Running tests..."
646fi
647
648# If requested, generate the coverage reports
649if [ ${do_reports} = "yes" ] ; then
650  echo "Generating reports..."
651
652  cd ${BASEDIR}/${BSP}-tests/
653  check_status $? "cd ${BSP}-tests"
654
655  to_analyze=""
656  if [ ${do_core} = "yes" ] ; then
657    to_analyze="${to_analyze} no"
658  fi
659  if [ ${do_developmental} = "yes" ]; then
660    to_analyze="${to_analyze} yes"
661  fi
662
663  for analyze_developmental in ${to_analyze}
664  do
665    if [ ${analyze_developmental} = yes ] ; then
666      echo "Processing coverage for developmental configuration ..."
667      EXT=${EXTENSION}D
668    else
669      echo "Processing coverage for core source configuration ..."
670      EXT=${EXTENSION}d
671    fi
672    if [ "X${outputDir}" = "X" ] ; then
673      results_dir=${BSP}${EXT}-${day}-${hour}${minute}
674    else
675      results_dir=${outputDir}
676    fi
677
678    generate_symbols >${BASEDIR}/${BSP}-tests/rtems.syms
679    syms=`cat ${BASEDIR}/${BSP}-tests/rtems.syms | wc -l`
680    if [ ${syms} -eq 0 ] ; then
681      fatal "no symbols found"
682    fi
683
684    generate_reports ${TARGET} ${BSP} ${COVERAGE_FORMAT}
685  done
686else
687  echo "Skipping Generating reports..."
688fi
689
690# If requested, publish the coverage reports
691if [ ${do_publish} = "yes" -o ${do_save_tarballs} = "yes" ] ; then
692  if [ -d ${BASEDIR}/${BSP}-tests ] ; then
693    cd ${BASEDIR}/${BSP}-tests/
694    if [ ${do_publish} = "yes" ] ; then
695      cp ${BSP}${EXTENSION}[dD]-${day}-${hour}${minute}.tar.bz2 ${FTPDIR}
696      check_status $? "cp ${BSP} results to ftp site failed"
697      ${COVBASE}/generate_coverage_html ${FTPDIR}
698    fi
699    if [ ${do_save_tarballs} = "yes" ] ; then
700      if [ ! -d ${TARDIR} ] ; then
701         echo "Creating ${TARDIR}"
702         mkdir -p ${TARDIR}
703         check_status $? "Failed to mkdir ${TARDIR}"
704      fi
705      cp ${BSP}${EXTENSION}[dD]-${day}-${hour}${minute}.tar.bz2 ${TARDIR}
706      check_status $? "cp ${BSP} results to save directory"
707    fi
708  else
709    echo "No results to publish or save"
710  fi
711else
712  echo "Skipping Publishing reports..."
713fi
714stop=`date`
715
716echo "Started: " ${start}
717echo "Stopped: " ${stop}
718
719exit 0
720
Note: See TracBrowser for help on using the repository browser.