From 24ecf7a5fa9404f7e3125894d3fa001a0069a0c6 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Wed, 20 Jan 2016 19:48:51 +0100 Subject: drop obsolete cruft Change-Id: Ia9b9431252c010d910ed0e9461398651de1de260 --- sal/qa/helper/gcov/build_coverage | 40 --- sal/qa/helper/gcov/deprecated.txt | 229 -------------- sal/qa/helper/gcov/gcov_all | 31 -- sal/qa/helper/gcov/gcov_filter.pl | 442 --------------------------- sal/qa/helper/gcov/gcov_result.pl | 247 --------------- sal/qa/helper/gcov/gcov_resultcompare.pl | 166 ---------- sal/qa/helper/gcov/gcov_resultinterpreter.pl | 187 ------------ sal/qa/helper/gcov/gcov_run.sh | 81 ----- sal/qa/helper/gcov/readme.txt | 13 - sal/qa/helper/gcov/statistics | 36 --- 10 files changed, 1472 deletions(-) delete mode 100755 sal/qa/helper/gcov/build_coverage delete mode 100644 sal/qa/helper/gcov/deprecated.txt delete mode 100755 sal/qa/helper/gcov/gcov_all delete mode 100644 sal/qa/helper/gcov/gcov_filter.pl delete mode 100644 sal/qa/helper/gcov/gcov_result.pl delete mode 100644 sal/qa/helper/gcov/gcov_resultcompare.pl delete mode 100644 sal/qa/helper/gcov/gcov_resultinterpreter.pl delete mode 100755 sal/qa/helper/gcov/gcov_run.sh delete mode 100644 sal/qa/helper/gcov/readme.txt delete mode 100755 sal/qa/helper/gcov/statistics (limited to 'sal') diff --git a/sal/qa/helper/gcov/build_coverage b/sal/qa/helper/gcov/build_coverage deleted file mode 100755 index a84da9072120..000000000000 --- a/sal/qa/helper/gcov/build_coverage +++ /dev/null @@ -1,40 +0,0 @@ -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - -# this is a helper, to build sal with the right compiler parameters -# IMPORTANT, this works only within Linux - -if ( `uname` == "Linux" ) then - echo "running on Linux Intel, ok." - - build killobj - - # setenv OLDCFLAGS $ENVCFLAGS - - setenv ENVCFLAGS "-fprofile-arcs -ftest-coverage" - - build - - # setenv ENVCFLAGS $OLDCFLAGS - -else - - echo "Sorry, gcov works only within Linux environment." - -endif - diff --git a/sal/qa/helper/gcov/deprecated.txt b/sal/qa/helper/gcov/deprecated.txt deleted file mode 100644 index 62d5636a101c..000000000000 --- a/sal/qa/helper/gcov/deprecated.txt +++ /dev/null @@ -1,229 +0,0 @@ -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - -# contain all functions, which are mark as deprecated -# this function will removed from the allexportlist -# Format of a line MUST be / (.*);/ - - rtl_ustr_trim; - rtl_str_trim; - -# since 16.9.2003 -# Function List: -# A. deprecated functions: -# 1) Profile class and all its sub C API: - osl_openProfile; - osl_closeProfile; - osl_flushProfile; - osl_readProfileString; - - osl_readProfileBool; - osl_readProfileIdent; - osl_writeProfileString; - - osl_writeProfileBool; - osl_writeProfileIdent; - osl_removeProfileEntry; - - osl_getProfileSectionEntries; - osl_getProfileSections; - -# 2) VolumeDevice class and all this sub C API: - osl_releaseVolumeDeviceHandle; - - osl_acquireVolumeDeviceHandle; - osl_getVolumeDeviceMountPath; - -# 3) in FileBase class: - osl_getCanonicalName; - -# B. untested functions: -# functions need Client/Server model and blocking mode of transmission. some of the functions -# can not run through on testshl2 env while the same code can run successfully in normal separate -# files. -# 1) in DatagramSocket class: -# osl_receiveFromSocket; -# osl_sendToSocket; - -# 2) in StreamSocket class: -# osl_readSocket; -# osl_writeSocket; -# osl_receiveSocket; -# osl_sendSocket; - -# 3) in Socket class: - osl_isExceptionPending; -# osl_shutdownSocket; - -# 4) in Pipe class: -# osl_acceptPipe; - -# 5) in StreamPipe class: -# osl_readPipe; -# osl_writePipe; -# osl_receivePipe; -# osl_sendPipe; - -#C. unreachable functions -# (*)in .map file but does not appear in.hxx header file thus unreachable, -# mostly for internal use, can not be reached by accessing class, so need -# not be tested. -# 1) in file module*: - osl_abbreviateSystemPath; - -# 2) in socket module*: - osl_addToSocketSet; - osl_clearSocketSet; - osl_createSocketSet; - osl_destroySocketSet; - osl_isInSocketSet; - osl_removeFromSocketSet - - osl_createHostAddrByName; - osl_createHostAddrByAddr; - - osl_createHostAddr; - osl_copyHostAddr; - osl_destroyHostAddr; - osl_getHostnameOfHostAddr; - osl_getSocketAddrOfHostAddr; - osl_createInetBroadcastAddr; - - osl_demultiplexSocketEvents; - osl_getDottedInetAddrOfSocketAddr; - osl_getFamilyOfSocketAddr; - -# 3) in thread module*: - osl_createThread; - osl_setThreadTextEncoding; - -# or (#)does not wrapper into a class, only in C API. does not in our Class -# check list. -# 1) all diagnose module#: - osl_breakDebug; - osl_assertFailedLine; - osl_trace; - osl_reportError; - - osl_setDebugMessageFunc; - -# 2) all signal module#: - osl_addSignalHandler; - osl_removeSignalHandler; - osl_raiseSignal; - -# 3) all time module#: - osl_getSystemTime; - osl_getDateTimeFromTimeValue; - - osl_getTimeValueFromDateTime; - osl_getLocalTimeFromSystemTime; - - osl_getSystemTimeFromLocalTime; - osl_getGlobalTimer; - -# 4) all process module#: - osl_executeProcess; - osl_executeProcess_WithRedirectedIO; - - osl_terminateProcess; - osl_getProcess; - - osl_freeProcessHandle; - osl_joinProcess; - osl_joinProcessWithTimeout; - - osl_getProcessInfo; - osl_getExecutableFile; - osl_getCommandArgCount; - - osl_getCommandArg; - osl_getEnvironment; - osl_getProcessWorkingDir; - - osl_getProcessLocale; - osl_setProcessLocale; - osl_sendResourcePipe; - - osl_receiveResourcePipe; - -# 5) all util module#: - osl_getEthernetAddress; - - - -### -# LLA: -# these functions are not deprecated, they only marked as deprecated, to say that -# there is no test need. -### - rtl_zeroMemory; - rtl_fillMemory; - rtl_copyMemory; - rtl_moveMemory; - rtl_compareMemory; - rtl_findInMemory; - -# LLA: -# Marked as deprecated by Stephan Bergmann - - rtl_byte_sequence_reference2One; - rtl_byte_sequence_realloc; - rtl_byte_sequence_acquire; - rtl_byte_sequence_release; - rtl_byte_sequence_construct; - rtl_byte_sequence_constructNoDefault; - rtl_byte_sequence_constructFromArray; - rtl_byte_sequence_assign; - rtl_byte_sequence_equals; - rtl_byte_sequence_getConstArray; - rtl_byte_sequence_getLength; - -# LLA: -# old test environment need no extra test - rtl_tres_create; - rtl_tres_destroy; - -# LLA: -# found in source code, marked as deprecated -# rtl_locale_getDefault; -# rtl_locale_setDefault; - -# LLA: -# marked as deprecated, due to the fact there is no access from outside -# so these functions are not really accessible -# They are used in rtl/source/locale.c - rtl_hashentry_destroy; - rtl_hashfunc; - rtl_hashtable_add; - rtl_hashtable_destroy; - rtl_hashtable_find; - rtl_hashtable_grow; - rtl_hashtable_init; - -# LLA: -# marked as deprecated by Joachim Lingner 20040414 - rtl_moduleCount_acquire; - rtl_moduleCount_release; - rtl_moduleCount_canUnload; - rtl_registerModuleForUnloading; - rtl_unregisterModuleForUnloading; - rtl_unloadUnusedModules; - rtl_addUnloadingListener; - rtl_removeUnloadingListener; - diff --git a/sal/qa/helper/gcov/gcov_all b/sal/qa/helper/gcov/gcov_all deleted file mode 100755 index dbae002a0a84..000000000000 --- a/sal/qa/helper/gcov/gcov_all +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# -# This helper run lists all c and cxx files from selected directories. - -# PRJ points to the flat project directory -PRJ='../../..' - -# selected directories -FILES=`/bin/ls $PRJ/osl/unx/*.c $PRJ/osl/unx/*.cxx $PRJ/rtl/source/*.c $PRJ/rtl/source/*.cxx $PRJ/osl/all/*.c $PRJ/osl/all/*.cxx $PRJ/textenc/*.c` - -# Use gcov_filter on every c/cxx file. -for file in $FILES; do - # echo $file - perl gcov_filter.pl -o $PRJ/unxlngi6/slo -i $PRJ/util/sal.map $file $* -done diff --git a/sal/qa/helper/gcov/gcov_filter.pl b/sal/qa/helper/gcov/gcov_filter.pl deleted file mode 100644 index c5373c0468e3..000000000000 --- a/sal/qa/helper/gcov/gcov_filter.pl +++ /dev/null @@ -1,442 +0,0 @@ -#!/usr/bin/env perl -w -# -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# -# -# GCOV_FILTER -# -# Helper to filter the gcov output. -# Handle a compare between the hole gcov output and a given select list of exported functions. -# -# Q: Why perl? -# A: regexp ;-) -# - - -use strict; -use File::Basename; -use Getopt::Long; - -# Global constants -our $version_info = 'gcov helper: 1.4 '; -our $help; # Help option flag -our $version; # Version option flag -our $cwd = `pwd`; # current working directory -chomp($cwd); -# our $tool_dir = dirname($0); -# our $tool_file = basename($0); - -# our $output_filename; -our $input_allfunc; -# our $input_filename; - -our $allfuncinfo; # allfuncinfo option flag -our $showallfunc; # showallfunc option flag -our $no_percentage; # no_percentage option flag -our $donotfilter; # donotfilter option flag -our $objectdir; - -# Prototypes -sub print_usage(*); -sub read_gcov_function_file($); -sub get_PRJ_from_makefile_mk(); -# sub read_ExportedFunctionList(); -sub read_List($); - -# if (! ($tool_dir =~ /^\/(.*)$/)) -# { -# $tool_dir = "$cwd/$tool_dir"; -# } - -# Parse command line options -if (!GetOptions( "input-allfunc=s" => \$input_allfunc, - "allfuncinfo" => \$allfuncinfo, - "showallfunc" => \$showallfunc, - "no-percentage" => \$no_percentage, - "do-not-filter" => \$donotfilter, - "objectdir=s" => \$objectdir, - "help" => \$help, - "version" => \$version - )) -{ - print_usage(*STDERR); - exit(1); -} - -# Check for help option -if ($help) -{ - print_usage(*STDOUT); - exit(0); -} - -# Check for version option -if ($version) -{ - print("$version_info\n"); - exit(0); -} - -# check if enough parameters -if ($#ARGV < 0) -{ - print("No input filename specified\n"); - print_usage(*STDERR); - exit(1); -} - -# special case: -# the filename contains a . or '/' at the beginning -my $startdir = $ARGV[0]; -if ( ($startdir =~ /^\.\./) || - ($startdir =~ /^\//) ) -{ - $startdir = dirname($startdir); - # print("start directory is $startdir\n"); - # chdir $startdir; -} -else -{ - $startdir = ""; -} - -# check for sal.map -if ( ! $input_allfunc ) -{ - # this is a try, to get the project directory form a found makefile.mk - # may work, but fails due to some disunderstandings may be problems in perl :-( - my $sDir = get_PRJ_from_makefile_mk(); - # chomp($sDir); - # HDW: print("PRJ is $dir\n"); - - # $sDir2 = "../.."; - my $sMapFile = "$sDir" . "/util/sal.map"; - # $sMapFile = "$sDir2" . "/util/sal.map"; - - if ( -e $sMapFile) - { - $input_allfunc = $sMapFile; - } - else - { - print("No input-allfunc filename specified\n"); - print_usage(*STDERR); - exit(1); - } -} -our @aDeprecatedList; -our @aExportedFunctionList; -# read_ExportedFunctionList(); -@aExportedFunctionList = read_List($input_allfunc); -@aDeprecatedList = read_List("deprecated.txt"); - -if ($allfuncinfo) -{ - print("Count of all functions: $#aExportedFunctionList\n"); - exit(0); -} - -if ($showallfunc) -{ - my $func; - foreach $func (@aExportedFunctionList) - { - print("$func\n"); - } - exit(0); -} - -# back to current directory -# this chdir was for a before chdir (in $startdir creation) but due to the fact, -# that the get_PRJ_from_makefile_mk works but the after concat of strings not, this -# chdir is also remarked. -# chdir $cwd; - -# HWD: print "count of param: \n"; -# $input_filename = $ARGV[0]; - -my $nCount = $#ARGV + 1; -my $nIdx; - -for ($nIdx = 0; $nIdx < $nCount ; ++$nIdx) -{ - my $file = $ARGV[$nIdx]; - # print("processing: $file\n"); - - # change directory, to the current file, due to the fact, that we may be need to call gcov - # and gcov will create some extra files, like *.gcov near the current file. - # if ( $startdir ne "" ) - # { - # chdir $startdir; - # $file = basename($file); - # } - - my $OBJECTS=""; - if ($objectdir) - { - $OBJECTS = "-o " . $objectdir; - } - - if (! ($file =~ /\.f$/ )) - { - my $filef = "$file.f"; - # if (! -e $filef ) - # { - # print "gcov $OBJECTS -l -f $file >$filef\n"; - my $blah = `gcov $OBJECTS -n -f $file >$filef`; - # } - $file = $filef; - } - read_gcov_function_file($file); - - # go back to old directory, because it's possible to change relative to an other directory. - if ( $startdir ne "" ) - { - chdir $cwd; - } -} - -# print "$tool_dir\n"; -# print "all is right\n"; -exit(0); - - -# -------------------------------------------------------------------------------- -# Read the map file, which should contain all exported functions. -sub read_List($) -{ - local *INPUT_HANDLE; - my $filename = $_[0]; - my @list; - my $line = ""; - open(INPUT_HANDLE, $filename); - # or die("ERROR: cannot open $filename!\n"); - - while ($line = ) - { - chomp($line); - # reg exp: [spaces]functionname[semicolon][line end] - if ($line =~ /^\s+(\w*);$/) - { - # print("$1\n"); - push(@list, $1); - } - } - close(INPUT_HANDLE); - return @list; -} - -# -------------------------------------------------------------------------------- -# Helper function, test is a given value is found in the global exported function list. -# the given value format could be a simple function name -# or a prototype -# e.g. -# osl_getSystemPathFromFileURL -# or -# void getSystemPathFromFileURL( const char* rtl_...) -# -sub contain_in_List($$) -{ - my $func; - my $value = $_[0]; - my $list = $_[1]; - - if ($donotfilter) - { - return $value; - } - - foreach $func (@$list) # (@aExportedFunctionList) - { - # first try, direct check - if ($value eq $func) - { - # HWD: print("$value eq $func\n"); - return $value; - } - - # value not found, second try, may be we found it if we search word wise. - # helper, to insert a space after the word, before '(' - $value =~ s/\(/ \(/g; - # may be here we should replace all white spaces by ' ' - - # split by 'space' - my @list = split(' ', $value); - for(@list) - { - # HWD: print "$list[$n]\n"; - if ($_ eq $func) - { - # HWD: print ("found $func in $value\n"); - return $_; - } - } - } - # not found - return ""; -} -# -------------------------------------------------------------------------------- -# Read the gcov function (gcov -f) file -# and compare line by line with the export function list -# so we get a list of functions, which are only exported, and not all stuff. -# sample of output -# new gcov gcc 3.4 format -sub read_gcov_function_file($) -{ - local *INPUT_HANDLE; - my $file = $_[0]; - my $line = ""; - open(INPUT_HANDLE, $file) - or die("ERROR: cannot open $file!\n"); - - while ($line = ) - { - chomp($line); - # sample line (for reg exp:) - # 100.00% of 3 source lines executed in function osl_thread_init_Impl - if ($line =~ /^Function \`(.*)\'$/ ) - { - my $sFunctionName = $1; - my $sPercentage; - $line = ; - if ($line =~ /^Lines executed:(.*)% of/ ) - { - $sPercentage = $1; - } - my $value = contain_in_List( $sFunctionName, \@aExportedFunctionList ); - if ($value) - { - my $isDeprecated = contain_in_List( $sFunctionName, \@aDeprecatedList ); - if ($isDeprecated) - { - # Function is deprecated, do not export it. - } - else - { - if ($no_percentage) - { - print("$value\n"); - } - else - { - print("$sPercentage $value\n"); - } - } - } - # push(@aExportedFunctionList, $1); - } - } - close(INPUT_HANDLE); -} - -# gcov format since gcc 3.3.6 -# 100.00% von 3 Zeilen in function helloworld ausgeführt -# 100.00% von 5 Zeilen in function main ausgeführt -# 100.00% von 8 Zeilen in file tmp.c ausgeführt -sub read_gcov_function_file_old_gcc_3($) -{ - local *INPUT_HANDLE; - my $file = $_[0]; - my $line = ""; - open(INPUT_HANDLE, $file) - or die("ERROR: cannot open $file!\n"); - - while ($line = ) - { - chomp($line); - # sample line (for reg exp:) - # 100.00% of 3 source lines executed in function osl_thread_init_Impl - if ($line =~ /^(.*)% of \d+ source lines executed in function (.*)$/ ) - { - my $value = contain_in_List( $2, \@aExportedFunctionList ); - if ($value) - { - my $isDeprecated = contain_in_List( $2, \@aDeprecatedList ); - if ($isDeprecated) - { - # Function is deprecated, do not export it. - } - else - { - if ($no_percentage) - { - print("$value\n"); - } - else - { - print("$1 $value\n"); - } - } - } - # push(@aExportedFunctionList, $1); - } - } - close(INPUT_HANDLE); -} - -# ------------------------------------------------------------------------------ -# helper, to read the PRJ value out of a makefile.mk file -sub get_PRJ_from_makefile_mk() -{ - local *INPUT_HANDLE; - # my $startdir = @_[0]; - my $line = ""; - my $value = ""; - open(INPUT_HANDLE, "makefile.mk") - or die("ERROR: cannot open makefile.mk\n"); - - while ($line = ) - { - chomp($line); - # sample line - # PRJ= - # HWD: print("$line\n"); - if ($line =~ /^PRJ\s*=(.*)\s*$/) - { - # HWD: print("FOUND #####\n"); - $value = $1; - chomp($value); - $value =~ s/\$\//\//g; - } - } - close(INPUT_HANDLE); - return $value; -} - -# ---------------------------------------------------------------------------- -sub print_usage(*) -{ - local *HANDLE = $_[0]; - my $tool_name = basename($0); - - print(HANDLE < 0 -our $nonusedFunctions; # name of all functions filename, which have a value == 0 -our $complete; # name of all functions filename, which have a value == 100 -our $incomplete; # name of all functions filename, which have a value > 0 && < 100 - -our $environment; -our $major; -our $minor; -our $cwsname; -our $outputDir; - -# Prototypes -sub print_usage(*); -sub read_gcov_function_file($); -sub create2DigitNumber($); - -# Parse command line options -if (!GetOptions( - "help" => \$help, - "version" => \$version, - - "usedfunctions=s" => \$usedFunctions, - "nonusedfunctions=s" => \$nonusedFunctions, - "complete=s" => \$complete, - "incomplete=s" => \$incomplete, - "cwsname=s" => \$cwsname, - "major=s" => \$major, - "minor=s" => \$minor, - "environment=s" => \$environment, - "outputdir=s" => \$outputDir - )) -{ - print_usage(*STDERR); - exit(1); -} - -# Check for help option -if ($help) -{ - print_usage(*STDOUT); - exit(0); -} - -# Check for version option -if ($version) -{ - print("$version_info\n"); - exit(0); -} - -# check if enough parameters -# if ($#ARGV < 0) -# { -# print("No input filename specified\n"); -# print_usage(*STDERR); -# exit(1); -# } - -# ------------------------------------------------------------------------------ - -my $sURL = "http://mahler.germany.sun.com/qadev/baselib/gcov_result_in_db_putter.php"; - -my $next = "?"; - -if ($complete) -{ - my $result = `cat $complete | wc -l`; - chomp($result); - $result =~ / *(\d+)/; - $sURL = $sURL . "$next" . "complete=$1"; - $next = "&"; -} - -if ($nonusedFunctions) -{ - my $result = `cat $nonusedFunctions | wc -l`; - chomp($result); - $result =~ / *(\d+)/; - $sURL = $sURL . "$next" . "notused=$1"; - $next = "&"; -} -if ($usedFunctions) -{ - my $result = `cat $usedFunctions | wc -l`; - chomp($result); - $result =~ / *(\d+)/; - $sURL = $sURL . "$next" . "used=$1"; - $next = "&"; -} -if ($incomplete) -{ - my $result = `cat $incomplete | wc -l`; - chomp($result); - $result =~ / *(\d+)/; - $sURL = $sURL . "$next" . "incomplete=$1"; - $next = "&"; -} - -if ($cwsname) -{ - # qadev8 - $sURL = $sURL . "$next" . "cwsname=$cwsname"; - $next = "&"; -} -if ($major) -{ - # srx645 - $sURL = $sURL . "$next" . "major=$major"; - $next = "&"; -} -if ($minor) -{ - # m3s1 - $sURL = $sURL . "$next" . "minor=$minor"; - $next = "&"; -} - -if ($environment) -{ - # unxlngi5 - $sURL = $sURL . "$next" . "environment=$environment"; - $next = "&"; -} - -my $year = localtime->year() + 1900; -my $month = create2DigitNumber(localtime->mon() + 1); -my $day = create2DigitNumber(localtime->mday()); -$sURL = $sURL . "$next" . "date=$year-$month-$day"; -$next = "&"; - -my $output; -if ($outputDir) -{ - chomp($outputDir); - $output = $outputDir; -} - -# check if output ends with "/" -if ( $output =~ /\/$/ ) -{ - print "Output name ends with '/'\n"; -} -else -{ - print "Output name does not end with '/'\n"; - $output = $output . "/"; -} -$output = $output . "php_result.txt"; - -my $result = `wget -O $output "$sURL"`; -print "$sURL\n"; - -print `cat $output`; - - -# ---------------------------------------------------------------------------- -sub print_usage(*) -{ - local *HANDLE = $_[0]; - my $tool_name = basename($0); - - print(HANDLE < 0 - -n, --nonusedfunctions count of all functions, which have a value == 0 - -co, --complete count of all functions, which have a value == 100 - -i, --incomplete count of all functions, which have a value > 0 && < 100 - - -cw, --cwsname set cwsname - -ma, --major set major number - -mi, --minor set minor number - -e, --environment set environment - - -o, --outputdir set the directory, where to store the wget result - - -h, --help Print this help, then exit - -v, --version Print version number, then exit - -END_OF_USAGE - ; -} -# ------------------------------------------------------------------------------ -sub create2DigitNumber($) -{ - my $digit = $_[0]; - my $str; - my $nDigitLen = length $digit; - - if ($nDigitLen == 1) - { - $str = "0" . $digit; - } - else - { - if ($nDigitLen > 2) - { - $str = substr $digit, $nDigitLen - 2, 2; - } - else - { - $str = $digit; - } - } - return $str; -} diff --git a/sal/qa/helper/gcov/gcov_resultcompare.pl b/sal/qa/helper/gcov/gcov_resultcompare.pl deleted file mode 100644 index 704475ce4b28..000000000000 --- a/sal/qa/helper/gcov/gcov_resultcompare.pl +++ /dev/null @@ -1,166 +0,0 @@ -#!/usr/bin/env perl -w -# -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# -# -# GCOV_RESULTCOMPARE -# -# Helper, to compare two different results -# -# Q: Why perl? -# A: regexp ;-) -# - -use strict; -use File::Basename; -use Getopt::Long; - -our $version_info = 'gcov_resultcompare: 1.2 '; - -our $help; # Help option flag -our $version; # Version option flag -# our $infile; - -our $orig; -our $compare; - -# Prototypes -sub print_usage(*); -sub read_gcov_function_file($); - -# Parse command line options -if (!GetOptions( - "o=s" => \$orig, - "c=s" => \$compare, - "help" => \$help, - "version" => \$version - )) -{ - print_usage(*STDERR); - exit(1); -} - -# Check for help option -if ($help) -{ - print_usage(*STDOUT); - exit(0); -} - -# Check for version option -if ($version) -{ - print("$version_info\n"); - exit(0); -} - -# check if enough parameters -# if ($#ARGV < 1) -# { -# print("No input filenames specified\n"); -# print_usage(*STDERR); -# exit(1); -# } - -if (! $orig) -{ - print_usage(*STDOUT); - exit(0); -} -if (! $compare) -{ - print_usage(*STDOUT); - exit(0); -} - -# ------------------------------------------------------------------------------ - -my %origlist = read_gcov_function_file($orig); -my %cmplist = read_gcov_function_file($compare); - -my $key; -my $value; - -while (($key, $value) = each %origlist) -{ - my $cmpvalue = $cmplist{$key}; - - if ($cmpvalue != 0.00) - { - if ($value < 100.00) - { - if ($cmpvalue > $value && $value < 90.0) - { - print "$key, $value, CMP:$cmpvalue\n"; - } - } - } -} - -# -------------------------------------------------------------------------------- -# Read the gcov function (gcov -f) file -# and compare line by line with the export function list -# so we get a list of functions, which are only exported, and not all stuff. - -sub read_gcov_function_file($) -{ - local *INPUT_HANDLE; - my $file = shift; - my %list; - my $line = ""; - - open(INPUT_HANDLE, $file) - or die("ERROR: cannot open $file!\n"); - - while ($line = ) - { - chomp($line); - # sample line (for reg exp:) - # 100.00 rtl_ustr_toDouble - if ($line =~ /^(.{6}) (\w+)$/ ) - { - my $percent = $1; - my $value = $2; - - $list{$value} = $percent; - } - } - close(INPUT_HANDLE); - return %list; -} - -# ---------------------------------------------------------------------------- -sub print_usage(*) -{ - local *HANDLE = $_[0]; - my $tool_name = basename($0); - - print(HANDLE < 0 -our $nonusedFunctions; # show all functions, which have a value == 0 -our $nPercent; # show all functions, which have a value > $nPercent -our $complete; # show all functions, which have a value == 100 -our $incomplete; # show all functions, which have a value > 0 && < 100 - -# Prototypes -sub print_usage(*); -sub read_gcov_function_file($); - -# Parse command line options -if (!GetOptions( - "usedfunctions" => \$usedFunctions, - "nonusedfunctions" => \$nonusedFunctions, - "percent=s" => \$nPercent, - "complete" => \$complete, - "incomplete" => \$incomplete, - "help" => \$help, - "version" => \$version - )) -{ - print_usage(*STDERR); - exit(1); -} - -# Check for help option -if ($help) -{ - print_usage(*STDOUT); - exit(0); -} - -# Check for version option -if ($version) -{ - print("$version_info\n"); - exit(0); -} - -# check if enough parameters -if ($#ARGV < 0) -{ - print("No input filename specified\n"); - print_usage(*STDERR); - exit(1); -} - -if ($complete) -{ - $nPercent = 100.00; -} -# ------------------------------------------------------------------------------ - -my %list = read_gcov_function_file($ARGV[0]); - -my $key; -my $value; - -while (($key, $value) = each %list) -{ - # print "function: $key = $value\n"; - if ($nonusedFunctions) - { - if ($value <= 0.00) - { - print "$key\n"; - } - } - elsif ($usedFunctions) - { - if ($value != 0.00) - { - print "$key, $value\n"; - } - } - elsif ($nPercent) - { - if ($value >= $nPercent) - { - print "$key, $value\n"; - } - } - elsif ($incomplete) - { - if ($value > 0.00 && $value < 100.00) - { - print "$key, $value\n"; - } - } - else - { - print "$key, $value\n"; - } -} - -# -------------------------------------------------------------------------------- -# Read the gcov function (gcov -f) file -# and compare line by line with the export function list -# so we get a list of functions, which are only exported, and not all stuff. - -sub read_gcov_function_file($) -{ - local *INPUT_HANDLE; - my $file = $_[0]; - my %list; - my $line = ""; - - open(INPUT_HANDLE, $file) - or die("ERROR: cannot open $file!\n"); - - while ($line = ) - { - chomp($line); - # sample line (for reg exp:) - # 100.00 rtl_ustr_toDouble - if ($line =~ /^(.*) (\w+)$/ ) - { - my $percent = $1; - my $value = $2; - - $list{$value} = $percent; - } - } - close(INPUT_HANDLE); - return %list; -} - -# ---------------------------------------------------------------------------- -sub print_usage(*) -{ - local *HANDLE = $_[0]; - my $tool_name = basename($0); - - print(HANDLE < 0 - -n, --nonusedFunctions show all functions, which have a value == 0 - -p, --percent show all functions, which have a value > percent - -c, --complete show all functions, which have a value == 100 - -i, --incomplete show all functions, which have a value > 0 && < 100 - - -h, --help Print this help, then exit - -v, --version Print version number, then exit - -END_OF_USAGE - ; -} diff --git a/sal/qa/helper/gcov/gcov_run.sh b/sal/qa/helper/gcov/gcov_run.sh deleted file mode 100755 index f08ab259050c..000000000000 --- a/sal/qa/helper/gcov/gcov_run.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/tcsh -f -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - -# This is a helper file, to start a coverage test by hand - -# ----- INIT ENVIRONMENT ----- -# setup a complete build environment, copy from our beanshell environment -setenv SHELL /bin/tcsh -source /net/margritte/usr/qaapi/workspace/qadev/scripts/init/staroffice.cshrc - -# do a setsolar - -setenv SOURCE_ROOT /cws/so-cwsserv06/qadev16 -setsolar -cwsname qadev16 -sourceroot -src680 -ver m25 -jdk14 unxlngi5 - - -# ----- CLEAN OLD COVERAGE INFOS ----- - -setenv SALDIR /cws/so-cwsserv06/qadev16/SRC680/src.m25/sal - -# this is a patch for sal, to see also "ustr" in string -cd $SALDIR/rtl/source - -# strtmpl.c contains code, which is used for strings and ustrings. This file contain lot of makros -# which unpacked at compile time. Due to the fact, gcov has some problems with such things, an idea is -# to copy strtmpl.c to ustrtmpl.c and replace the include command in ustring.c -# this is done be the follows lines. - -# cat ustring.c | sed -e "s/strtmpl.c/ustrtmpl.c/" > ustring.c.new ; mv -f ustring.c.new ustring.c -# cp strtmpl.c ustrtmpl.c - -cd $SALDIR - -rm -f `find . -type f -name '*.bb' -print` -rm -f `find . -type f -name '*.bbg' -print` -rm -f `find . -type f -name '*.f' -print` -rm -f `find . -type f -name '*.da' -print` -rm -f `find . -type f -name '*.gcov' -print` - -rm -rf unxlngi5 - -# ----- START A NEW BUILD WITH COVERAGE ----- -setenv ENVCFLAGS "-O0 -ftest-coverage -fprofile-arcs" -build TESTCOVERAGE=t -deliver - - -# ----- START THE TESTS ----- - -# unsetenv ENVCFLAGS -cd cd $SALDIR/qa -# cd qa/osl/file -dmake test - - -# ----- BUILD GCOV (coverage) FILES ----- -cd cd $SALDIR/qa/helper/gcov -statistics - -# the statistics file create some *.txt files, the most interesting one is realallchecked.txt, -# which contain only the interface functions and it's run through in percent. -# the gcov_resultcompare.pl use two of these files to give out a compare. - -# usage: gcov_resultcompare.pl -o realallchecked.txt -c /realallchecked.txt - diff --git a/sal/qa/helper/gcov/readme.txt b/sal/qa/helper/gcov/readme.txt deleted file mode 100644 index 6c9f46b225cb..000000000000 --- a/sal/qa/helper/gcov/readme.txt +++ /dev/null @@ -1,13 +0,0 @@ -GCOV Coverage information helper functions - -# Files: -deprecated.txt -gcov_all -gcov_filter.pl -gcov_result.pl -gcov_resultinterpreter.pl -statistics - -\\mahler\automat\docs\qadev\baselib\gcov_result_in_db_putter.php - - diff --git a/sal/qa/helper/gcov/statistics b/sal/qa/helper/gcov/statistics deleted file mode 100755 index 74cd9e1bf299..000000000000 --- a/sal/qa/helper/gcov/statistics +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - -./gcov_filter.pl -i ../../../util/sal.map --showallfunc FOO | sort | uniq >exportedfunctions.txt - -# gives the number off all files. -./gcov_filter.pl -i ../../../util/sal.map --allfuncinfo FOO - -./gcov_all --no-percentage | sort | uniq >allchecked.txt - -# gives the number of all testable functions -echo -n " testable functions: " -cat allchecked.txt | wc -l - -# gives a list of all checked functions within gcov. -./gcov_all | sort +1 | uniq >realallchecked.txt - -# output all functions, which are not tested by gcov -f, due to the fact, that they where not found -comm -3 exportedfunctions.txt allchecked.txt >notfound.txt - -- cgit