xref: /aoo41x/main/sal/qa/helper/gcov/gcov_run.sh (revision 9f22d7c2)
1cdf0e10cSrcweir#!/bin/tcsh -f
2*9f22d7c2SAndrew Rist# *************************************************************
3*9f22d7c2SAndrew Rist#
4*9f22d7c2SAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
5*9f22d7c2SAndrew Rist#  or more contributor license agreements.  See the NOTICE file
6*9f22d7c2SAndrew Rist#  distributed with this work for additional information
7*9f22d7c2SAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
8*9f22d7c2SAndrew Rist#  to you under the Apache License, Version 2.0 (the
9*9f22d7c2SAndrew Rist#  "License"); you may not use this file except in compliance
10*9f22d7c2SAndrew Rist#  with the License.  You may obtain a copy of the License at
11*9f22d7c2SAndrew Rist#
12*9f22d7c2SAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
13*9f22d7c2SAndrew Rist#
14*9f22d7c2SAndrew Rist#  Unless required by applicable law or agreed to in writing,
15*9f22d7c2SAndrew Rist#  software distributed under the License is distributed on an
16*9f22d7c2SAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17*9f22d7c2SAndrew Rist#  KIND, either express or implied.  See the License for the
18*9f22d7c2SAndrew Rist#  specific language governing permissions and limitations
19*9f22d7c2SAndrew Rist#  under the License.
20*9f22d7c2SAndrew Rist#
21*9f22d7c2SAndrew Rist# *************************************************************
22cdf0e10cSrcweir
23cdf0e10cSrcweir# This is a helper file, to start a coverage test by hand
24cdf0e10cSrcweir
25cdf0e10cSrcweir# ----- INIT ENVIRONMENT -----
26cdf0e10cSrcweir# setup a complete build environment, copy from our beanshell environment
27cdf0e10cSrcweirsetenv SHELL /bin/tcsh
28cdf0e10cSrcweirsource /net/margritte/usr/qaapi/workspace/qadev/scripts/init/staroffice.cshrc
29cdf0e10cSrcweir
30cdf0e10cSrcweir#   do a setsolar
31cdf0e10cSrcweir
32cdf0e10cSrcweirsetenv SOURCE_ROOT /cws/so-cwsserv06/qadev16
33cdf0e10cSrcweirsetsolar  -cwsname qadev16 -sourceroot -src680 -ver m25 -jdk14   unxlngi5
34cdf0e10cSrcweir
35cdf0e10cSrcweir
36cdf0e10cSrcweir# ----- CLEAN OLD COVERAGE INFOS -----
37cdf0e10cSrcweir
38cdf0e10cSrcweirsetenv SALDIR /cws/so-cwsserv06/qadev16/SRC680/src.m25/sal
39cdf0e10cSrcweir
40cdf0e10cSrcweir# this is a patch for sal, to see also "ustr" in string
41cdf0e10cSrcweircd $SALDIR/rtl/source
42cdf0e10cSrcweir
43cdf0e10cSrcweir# strtmpl.c contains code, which is used for strings and ustrings. This file contain lot of makros
44cdf0e10cSrcweir# which unpacked at compile time. Due to the fact, gcov has some problems with such things, an idea is
45cdf0e10cSrcweir# to copy strtmpl.c to ustrtmpl.c and replace the include command in ustring.c
46cdf0e10cSrcweir# this is done be the follows lines.
47cdf0e10cSrcweir
48cdf0e10cSrcweir# cat ustring.c | sed -e "s/strtmpl.c/ustrtmpl.c/" > ustring.c.new ; mv -f ustring.c.new ustring.c
49cdf0e10cSrcweir# cp strtmpl.c ustrtmpl.c
50cdf0e10cSrcweir
51cdf0e10cSrcweircd $SALDIR
52cdf0e10cSrcweir
53cdf0e10cSrcweirrm -f `find . -type f -name '*.bb' -print`
54cdf0e10cSrcweirrm -f `find . -type f -name '*.bbg' -print`
55cdf0e10cSrcweirrm -f `find . -type f -name '*.f' -print`
56cdf0e10cSrcweirrm -f `find . -type f -name '*.da' -print`
57cdf0e10cSrcweirrm -f `find . -type f -name '*.gcov' -print`
58cdf0e10cSrcweir
59cdf0e10cSrcweirrm -rf unxlngi5
60cdf0e10cSrcweir
61cdf0e10cSrcweir# ----- START A NEW BUILD WITH COVERAGE -----
62cdf0e10cSrcweirsetenv ENVCFLAGS "-O0 -ftest-coverage -fprofile-arcs"
63cdf0e10cSrcweirbuild TESTCOVERAGE=t
64cdf0e10cSrcweirdeliver
65cdf0e10cSrcweir
66cdf0e10cSrcweir
67cdf0e10cSrcweir# ----- START THE TESTS -----
68cdf0e10cSrcweir
69cdf0e10cSrcweir# unsetenv ENVCFLAGS
70cdf0e10cSrcweircd cd $SALDIR/qa
71cdf0e10cSrcweir# cd qa/osl/file
72cdf0e10cSrcweirdmake test
73cdf0e10cSrcweir
74cdf0e10cSrcweir
75cdf0e10cSrcweir# ----- BUILD GCOV (coverage) FILES -----
76cdf0e10cSrcweircd cd $SALDIR/qa/helper/gcov
77cdf0e10cSrcweirstatistics
78cdf0e10cSrcweir
79cdf0e10cSrcweir# the statistics file create some *.txt files, the most interesting one is realallchecked.txt,
80cdf0e10cSrcweir# which contain only the interface functions and it's run through in percent.
81cdf0e10cSrcweir# the gcov_resultcompare.pl use two of these files to give out a compare.
82cdf0e10cSrcweir
83cdf0e10cSrcweir# usage: gcov_resultcompare.pl -o realallchecked.txt -c <other>/realallchecked.txt
84cdf0e10cSrcweir
85