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