Merge pull request #191 from bitstadium/feature/remove-xcodecoverage

Remove XcodeCoverage
This commit is contained in:
Lukas Spieß 2015-09-09 14:11:55 +02:00
commit a25c3095bc
44 changed files with 5 additions and 24513 deletions

View File

@ -1180,7 +1180,6 @@
1E5954CC15B6F24A00A03429 /* Sources */,
1E5954DB15B6F24A00A03429 /* Frameworks */,
1E59558B15B6FD8800A03429 /* Headers */,
1EE9071A16F6871F003DDE1D /* ShellScript */,
);
buildRules = (
);
@ -1440,19 +1439,6 @@
shellPath = /bin/sh;
shellScript = "/usr/local/bin/appledoc \\\n --output \"${SOURCE_ROOT}/../documentation\" \\\n --ignore Vendor \\\n --ignore Products \\\n --ignore Support \\\n --ignore .m \\\n --ignore *Private.h \\\n --ignore BITAttributedLabel.h \\\n --ignore BITStoreButton.h \\\n --ignore BITFeedbackListViewCell.h \\\n --ignore BITAppStoreHeader.h \\\n --ignore BITFeedbackMessage.h \\\n --ignore BITFeedbackMessageAttachment.h \\\n --ignore BITAuthenticationViewController.h \\\n --ignore BITHockeyAppClient.h \\\n --create-html \\\n --create-docset \\\n --install-docset \\\n --keep-intermediate-files \\\n --project-name \"${HOCKEYSDK_DOCSET_NAME} ${VERSION_STRING}\" \\\n --project-version \"${VERSION_STRING}\" \\\n --project-company \"Bit Stadium GmbH\" \\\n --company-id \"de.bitstadium\" \\\n --docset-bundle-name \"${HOCKEYSDK_DOCSET_NAME} ${VERSION_STRING}\" \\\n --docset-feed-name \"${HOCKEYSDK_DOCSET_NAME}\" \\\n --docset-desc \"\" \\\n --docset-platform-family \"iphoneos\" \\\n --index-desc \"${SOURCE_ROOT}/../docs/index.md\" \\\n --include \"${SOURCE_ROOT}/../docs/index.html\" \\\n --include \"${SOURCE_ROOT}/../docs/\" \\\n --merge-categories \\\n --no-repeat-first-par \\\n --warn-undocumented-object \\\n --warn-undocumented-member \\\n --warn-empty-description \\\n --warn-unknown-directive \\\n --warn-invalid-crossref \\\n --warn-missing-arg \\\n --logformat xcode \\\n --exit-threshold 2 \\\n \"${SOURCE_ROOT}/../\"\n";
};
1EE9071A16F6871F003DDE1D /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/../Vendor/XcodeCoverage/exportenv.sh\"";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@ -2129,159 +2115,6 @@
};
name = Release;
};
1E68F4A716F7843F00053706 /* CodeCoverage */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 1E66CA9115D4100500F35BED /* buildnumber.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
COMPRESS_PNG_FILES = NO;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_GENERATE_TEST_COVERAGE_FILES = YES;
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"BITHOCKEY_STATIC_LIBRARY=1",
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_THUMB_SUPPORT = NO;
GCC_VERSION = "";
GCC_WARN_ABOUT_MISSING_NEWLINE = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_STRICT_SELECTOR_MATCH = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = "../Resources/HockeySDK-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
"IPHONEOS_DEPLOYMENT_TARGET[arch=arm64]" = 7.0;
MACOSX_DEPLOYMENT_TARGET = 10.5;
RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = iphoneos;
};
name = CodeCoverage;
};
1E68F4A816F7843F00053706 /* CodeCoverage */ = {
isa = XCBuildConfiguration;
buildSettings = {
"ARCHS[sdk=iphonesimulator*]" = "$(BIT_SIM_ARCHS)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
DSTROOT = /tmp/HockeySDK.dst;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/../Vendor\"",
);
GCC_THUMB_SUPPORT = NO;
GENERATE_PROFILING_CODE = YES;
PRODUCT_BUNDLE_IDENTIFIER = net.hockeyapp.sdk.ios;
PRODUCT_NAME = HockeySDK;
PUBLIC_HEADERS_FOLDER_PATH = "include/$(PRODUCT_NAME)";
SKIP_INSTALL = YES;
"VALID_ARCHS[sdk=iphonesimulator*]" = "$(BIT_SIM_ARCHS)";
WATCHOS_DEPLOYMENT_TARGET = 2.0;
};
name = CodeCoverage;
};
1E68F4A916F7843F00053706 /* CodeCoverage */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_THUMB_SUPPORT = NO;
INFOPLIST_FILE = "../Resources/HockeySDK-Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
PRODUCT_BUNDLE_IDENTIFIER = net.hockeyapp.sdk.resources.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
WRAPPER_EXTENSION = bundle;
};
name = CodeCoverage;
};
1E68F4AA16F7843F00053706 /* CodeCoverage */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_THUMB_SUPPORT = NO;
PRODUCT_BUNDLE_IDENTIFIER = net.hockeyapp.sdk.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = CodeCoverage;
};
1E68F4AB16F7843F00053706 /* CodeCoverage */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_BUNDLE_IDENTIFIER = net.hockeyapp.sdk.ios;
PRODUCT_NAME = HockeySDK.framework;
};
name = CodeCoverage;
};
1E68F4AC16F7843F00053706 /* CodeCoverage */ = {
isa = XCBuildConfiguration;
buildSettings = {
"ARCHS[sdk=iphonesimulator*]" = "$(BIT_SIM_ARCHS)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/../Vendor\"",
"\"$(SRCROOT)/HockeySDKTests\"",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "HockeySDKTests/HockeySDKTests-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GENERATE_PROFILING_CODE = YES;
HEADER_SEARCH_PATHS = "$(SRCROOT)/HockeySDKTests/";
INFOPLIST_FILE = "HockeySDKTests/HockeySDKTests-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.1;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/HockeySDKTests\"",
"$(PROJECT_DIR)/HockeySDKTests",
);
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"$(inherited)",
"-framework",
CoreText,
"-framework",
CoreGraphics,
"-framework",
Foundation,
"-framework",
QuartzCore,
"-framework",
SystemConfiguration,
"-framework",
UIKit,
"-framework",
Security,
"-framework",
AssetsLibrary,
"-framework",
MobileCoreServices,
"-framework",
QuickLook,
"-lc++",
"-ObjC",
);
PRODUCT_BUNDLE_IDENTIFIER = "net.hockeyapp.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = CodeCoverage;
};
1E7DE39019D44D88009AB8E5 /* ReleaseCrashOnly */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 1E7DE39619D44DC6009AB8E5 /* crashonly.xcconfig */;
@ -2498,57 +2331,6 @@
};
name = Debug;
};
1EB617541B0A30480035A986 /* CodeCoverage */ = {
isa = XCBuildConfiguration;
buildSettings = {
"ARCHS[sdk=iphonesimulator*]" = "$(BIT_SIM_ARCHS)";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/../Vendor",
"$(PROJECT_DIR)/HockeySDKTests",
);
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = "HockeySDK Framework/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = net.hockeyapp.sdk.ios;
PRODUCT_NAME = HockeySDK;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
"VALID_ARCHS[sdk=iphonesimulator*]" = "$(BIT_SIM_ARCHS)";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = CodeCoverage;
};
1EB617551B0A30480035A986 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -2725,78 +2507,6 @@
};
name = Debug;
};
1EB617591B0A30480035A986 /* CodeCoverage */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(PROJECT_DIR)/../Vendor",
"$(PROJECT_DIR)/HockeySDKTests",
);
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/HockeySDKTests/",
"-ObjC",
);
INFOPLIST_FILE = "HockeySDK FrameworkTests/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/HockeySDKTests",
);
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_LDFLAGS = (
"$(inherited)",
"-framework",
CoreText,
"-framework",
CoreGraphics,
"-framework",
Foundation,
"-framework",
QuartzCore,
"-framework",
SystemConfiguration,
"-framework",
UIKit,
"-framework",
Security,
"-framework",
AssetsLibrary,
"-framework",
MobileCoreServices,
"-framework",
QuickLook,
"-lc++",
"-ObjC",
);
PRODUCT_BUNDLE_IDENTIFIER = "net.hockeyapp.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
VALIDATE_PRODUCT = YES;
};
name = CodeCoverage;
};
1EB6175A1B0A30480035A986 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -3019,7 +2729,6 @@
isa = XCConfigurationList;
buildConfigurations = (
1E4F61EB1621AD970033EFC5 /* Debug */,
1E68F4AB16F7843F00053706 /* CodeCoverage */,
1E4F61EC1621AD970033EFC5 /* Release */,
1E7DE39419D44D88009AB8E5 /* ReleaseCrashOnly */,
1E27E6131B74F03000192AE2 /* ReleaseCrashOnlyExtensions */,
@ -3031,7 +2740,6 @@
isa = XCConfigurationList;
buildConfigurations = (
1E5954F015B6F24A00A03429 /* Debug */,
1E68F4A816F7843F00053706 /* CodeCoverage */,
1E5954F115B6F24A00A03429 /* Release */,
1E7DE39119D44D88009AB8E5 /* ReleaseCrashOnly */,
1E27E60D1B74F03000192AE2 /* ReleaseCrashOnlyExtensions */,
@ -3043,7 +2751,6 @@
isa = XCConfigurationList;
buildConfigurations = (
1E59551515B6F45800A03429 /* Debug */,
1E68F4A916F7843F00053706 /* CodeCoverage */,
1E59551615B6F45800A03429 /* Release */,
1E7DE39219D44D88009AB8E5 /* ReleaseCrashOnly */,
1E27E60F1B74F03000192AE2 /* ReleaseCrashOnlyExtensions */,
@ -3055,7 +2762,6 @@
isa = XCConfigurationList;
buildConfigurations = (
1E5A45A016F0DFC200B55C04 /* Debug */,
1E68F4AC16F7843F00053706 /* CodeCoverage */,
1E5A45A116F0DFC200B55C04 /* Release */,
1E7DE39519D44D88009AB8E5 /* ReleaseCrashOnly */,
1E27E60E1B74F03000192AE2 /* ReleaseCrashOnlyExtensions */,
@ -3067,7 +2773,6 @@
isa = XCConfigurationList;
buildConfigurations = (
1E8E66AE15BC3D7700632A2E /* Debug */,
1E68F4AA16F7843F00053706 /* CodeCoverage */,
1E8E66AF15BC3D7700632A2E /* Release */,
1E7DE39319D44D88009AB8E5 /* ReleaseCrashOnly */,
1E27E6121B74F03000192AE2 /* ReleaseCrashOnlyExtensions */,
@ -3079,7 +2784,6 @@
isa = XCConfigurationList;
buildConfigurations = (
1EB617531B0A30480035A986 /* Debug */,
1EB617541B0A30480035A986 /* CodeCoverage */,
1EB617551B0A30480035A986 /* Release */,
1EB617561B0A30480035A986 /* ReleaseCrashOnly */,
1E27E6101B74F03000192AE2 /* ReleaseCrashOnlyExtensions */,
@ -3091,7 +2795,6 @@
isa = XCConfigurationList;
buildConfigurations = (
1EB617581B0A30480035A986 /* Debug */,
1EB617591B0A30480035A986 /* CodeCoverage */,
1EB6175A1B0A30480035A986 /* Release */,
1EB6175B1B0A30480035A986 /* ReleaseCrashOnly */,
1E27E6111B74F03000192AE2 /* ReleaseCrashOnlyExtensions */,
@ -3103,7 +2806,6 @@
isa = XCConfigurationList;
buildConfigurations = (
E400563C148D79B500EB22B9 /* Debug */,
1E68F4A716F7843F00053706 /* CodeCoverage */,
E400563D148D79B500EB22B9 /* Release */,
1E7DE39019D44D88009AB8E5 /* ReleaseCrashOnly */,
1E27E60C1B74F03000192AE2 /* ReleaseCrashOnlyExtensions */,

View File

@ -37,10 +37,11 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "CodeCoverage"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
<TestableReference
skipped = "NO">

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
version = "1.7">
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
@ -37,30 +37,12 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "CodeCoverage"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES"
enableAddressSanitizer = "YES">
<PostActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "cd ${SRCROOT}/../Vendor/XcodeCoverage&#10;./getcov&#10;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1E5A458F16F0DFC200B55C04"
BuildableName = "HockeySDKTests.xctest"
BlueprintName = "HockeySDKTests"
ReferencedContainer = "container:HockeySDK.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PostActions>
<Testables>
<TestableReference
skipped = "NO">

View File

@ -1,2 +0,0 @@
env.sh
lcov-*

View File

@ -1,21 +0,0 @@
Copyright 2012 Jonathan M. Reid
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
(MIT License)

View File

@ -1,62 +0,0 @@
These scripts provide a simple way to generate HTML reports of the code coverage
of your Xcode 4.5 project.
For a detailed blog post, see http://qualitycoding.org/xcode-code-coverage/
Installation
============
1. Fork this repository; you're probably going to want to make your own
modifications.
2. Place the XcodeCoverage folder in the same folder as your Xcode project.
3. [Dowload lcov-1.10](http://downloads.sourceforge.net/ltp/lcov-1.10.tar.gz).
Place the lcov-1.10 folder inside the XcodeCoverage folder.
4. Get Xcode's coverage instrumentation by going to Xcode Preferences, into Downloads, and installing Command Line Tools.
5. In your Xcode project, enable these two build settings at the project level
for your Debug configuration only:
* Instrument Program Flow
* Generate Test Coverage Files
6. In your main target, add a Run Script build phase to execute
``XcodeCoverage/exportenv.sh``
A few people have been tripped up by the last step: Make sure you add the
script to your main target (your app or library), not your test target.
Execution
=========
1. Run your unit tests
2. In Terminal, cd to your project's XcodeCoverage folder, then
$ ./getcov
If you make changes to your test code without changing the production code and
want a clean slate, use the ``cleancov`` script:
$ ./cleancov
If you make changes to your production code, you should clear out all build
artifacts before measuring code coverage again. "Clean Build Folder" by holding
down the Option key in Xcode's "Product" menu.
Modification
============
There are two places you may want to modify:
1. In envcov.sh, ``LCOV_INFO`` determines the name shown in the report.
2. In getcov, edit ``exclude_data()`` to specify which files to exclude, for
example, third-party libraries.
More resources
==============
* [Sources](https://github.com/jonreid/XcodeCoverage)
* Testing tools: [OCHamcrest](https://github.com/hamcrest/OCHamcrest),
[OCMockito](https://github.com/jonreid/OCMockito),
[JMRTestTools](https://github.com/jonreid/JMRTestTools)
* [Quality Coding](http://qualitycoding.org/) blog - Tools, tips & techniques
for _building quality in_ to iOS development

View File

@ -1,11 +0,0 @@
#!/bin/sh
#
# Copyright 2012 Jonathan M. Reid. See LICENSE.txt
# Created by: Jon Reid, http://qualitycoding.org/
# Source: https://github.com/jonreid/XcodeCoverage
#
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIR}/envcov.sh
"${LCOV}" --zerocounters -d "${OBJ_DIR}"

View File

@ -1,15 +0,0 @@
#
# Copyright 2012 Jonathan M. Reid. See LICENSE.txt
# Created by: Jon Reid, http://qualitycoding.org/
# Source: https://github.com/jonreid/XcodeCoverage
#
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIR}/env.sh
# Change the report name if you like:
LCOV_INFO=Coverage.info
LCOV_PATH=${SRCROOT}/../Vendor/XcodeCoverage/lcov-1.10/bin
LCOV=${LCOV_PATH}/lcov
OBJ_DIR=${OBJECT_FILE_DIR_normal}/${CURRENT_ARCH}

View File

@ -1,8 +0,0 @@
#
# Copyright 2012 Jonathan M. Reid. See LICENSE.txt
# Created by: Jon Reid, http://qualitycoding.org/
# Source: https://github.com/jonreid/XcodeCoverage
#
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export | egrep '( BUILT_PRODUCTS_DIR)|(CURRENT_ARCH)|(OBJECT_FILE_DIR_normal)|(SRCROOT)|(OBJROOT)' > ${DIR}/env.sh

View File

@ -1,49 +0,0 @@
#!/bin/sh
#
# Copyright 2012 Jonathan M. Reid. See LICENSE.txt
# Created by: Jon Reid, http://qualitycoding.org/
# Source: https://github.com/jonreid/XcodeCoverage
#
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIR}/envcov.sh
remove_old_report()
{
pushd ${BUILT_PRODUCTS_DIR}
if [ -e lcov ]; then
rm -r lcov
fi
popd
}
enter_lcov_dir()
{
cd ${BUILT_PRODUCTS_DIR}
mkdir lcov
cd lcov
}
gather_coverage()
{
"${LCOV}" --capture -b "${SRCROOT}" -d "${OBJ_DIR}" -o ${LCOV_INFO}
}
exclude_data()
{
"${LCOV}" --remove ${LCOV_INFO} "/Applications/Xcode.app/*" -d "${OBJ_DIR}" -o ${LCOV_INFO}
"${LCOV}" --remove ${LCOV_INFO} "main.m" -d "${OBJ_DIR}" -o ${LCOV_INFO}
# Remove other patterns here...
}
generate_report()
{
"${LCOV_PATH}/genhtml" --output-directory . ${LCOV_INFO}
open index.html
}
remove_old_report
enter_lcov_dir
gather_coverage
exclude_data
generate_report

View File

@ -1,491 +0,0 @@
Version 1.10
============
All:
- Disabled branch coverage processing per default to improve processing
performance (can be re-enabled using a config file setting)
- Added option --rc to override config file settings from the command line
- Added option --config-file to override the config file location
- Fixed handling of '<' in filenames
genhtml:
- Added option --ignore-errors to continue after errors
- Added man page note to further explain branch coverage output
- Fixed man page description of default coverage rates
- Fixed HTML page title for directory pages
- Fixed handling of special characters in file and directory names
- Fixed directory prefix calculation
- Fixed warning when source files are found in root directory
geninfo:
- Added options --external and --no-external to include/exclude external
source files such as standard libary headers
- Added option --compat to specify compatibility modes
- Added missing man page sections for --derive-func-data and --no-markers
- Added support for MinGW output on MSYS. From martin.hopfeld@sse-erfurt.de
- Added support for gcc 4.7 .gcno file format. Based on patch by
berrange@redhat.com
- Added auto-detection of gcc-4.7 function record format. Includes
suggestions by garnold@google.com
- Fixed exclusion markers for --derive-func-data. Reported by bettse@gmail.com
- Fixed processing of pre-3.3 gcov files. Reported by georgysebastian@gmail.com
- Fixed handling of '<built-in>.gcov' files
- Fixed warning about unhandled .gcov files
- Improved --debug output
- Removed help text for obsolete parameter --function-coverage
genpng:
- Fixed handling of empty source files. Reported by: sylvestre@debian.org
lcov:
- Added options --external and --no-external to include/exclude external source
files such as standard libary headers
- Added option --summary to show summary coverage information
- Added option --compat to specify compatibility modes
- Fixed missing Perl version dependency in RPM spec file. Reported by
Martin Hopfeld <martin.hopfeld@sse-erfurt.de>
- Fixed geninfo not recognizing Objective-C functions. Based on patch
by abrahamh@web.de
- Fixed option --no-recursion not being passed to geninfo
- Fixed capitalization of the term 'Perl'
- Improved coverage rate calculation to only show 0%/100% when no/full coverage
is achieved. Based on suggestions by Paul.Zimmermann@loria.fr and
vincent@vinc17.net
lcovrc:
- Added description for geninfo_compat setting
- Added config file setting 'genhtml_charset' to specify HTML charset
- Added config file setting 'geninfo_external' to include/exclude external
source files such as standard libary headers
- Added config file setting 'geninfo_gcov_all_blocks' to modify lcov's use
of gcov's -a option
- Added config file setting 'geninfo_compat' to specify compatibility modes
- Added config file setting 'geninfo_adjust_src_path' to enabled source path
adjustments. Inspired by patch by ammon.riley@gmail.com
- Added config file setting 'geninfo_auto_base' to automatically determine
the base directory when collecting coverage data
- Added config file setting 'lcov_function_coverage' to enable/disable
function coverage processing
- Added config file setting 'lcov_branch_coverage' to enable/disable
branch coverage processing
Version 1.9
===========
genhtml:
- Improved wording for branch representation tooltip text
- Fixed vertical alignment of HTML branch representation
geninfo:
- Improved warning message about --initial not generating branch coverage data
- Debugging messages are now printed to STDERR instead of STDOUT
- Fixed problem with some .gcno files. Reported by gui@futarque.com.
(file.gcno: reached unexpected end of file)
- Fixed problem with relative build paths. Reported by zhanbiao2000@gmail.com.
(cannot find an entry for ^#src#test.c.gcov in .gcno file, skipping file!)
- Fixed problem where coverage data is missing for some files. Reported by
weston_schmidt@open-roadster.com
- Fixed problem where exclusion markers are ignored when gathering
initial coverage data. Reported by ahmed_osman@mentor.com.
- Fixed large execution counts showing as negative numbers in HTML output.
Reported by kkyriako@yahoo.com.
- Fixed problem that incorrectly associated branches outside of a block with
branches inside the first block
lcov:
- Fixed problem that made lcov ignore --kernel-directory parameters when
specifying --initial. Reported by hjia@redhat.com.
- Added --list-full-path option to prevent lcov from truncating paths in list
output
- Added lcov_list_width and lcov_list_truncate_max directives to the
lcov configuration file to allow for list output customization
- Improved list output
COPYING:
- Added license text to better comply with GPL recommendations
Version 1.8
===========
gendesc:
- Fixed problem with single word descriptions
genhtml:
- Added support for branch coverage measurements
- Added --demangle-cpp option to convert C++ function names to human readable
format. Based on a patch by slava.semushin@gmail.com.
- Improved color legend: legend display takes up less space in HTML output
- Improved coverage rate limits: all coverage types use the same limits
unless specified otherwise
- Fixed CRLF line breaks in source code when generating html output. Based
on patch by michael.knigge@set-software.de.
- Fixed warning when $HOME is not set
- Fixed problem with --baseline-file option. Reported by sixarm@gmail.com.
(Undefined subroutine &main::add_fnccounts called at genhtml line 4560.)
- Fixed problem with --baseline-file option and files without function
coverage data (Can't use an undefined value as a HASH reference at genhtml
line 4441.)
- Fixed short-name option ambiguities
- Fixed --highlight option not showing line data from converted test data
- Fixed warnings about undefined value used. Reported by nikita@zhuk.fi.
- Fixed error when processing tracefiles without function data. Reported
by richard.corden@gmail.com (Can't use an undefined value as a HASH
reference at genhtml line 1506.)
geninfo:
- Added support for branch coverage measurements
- Added support for exclusion markers: Users can exclude lines of code from
coverage reports by adding keywords to the source code.
- Added --derive-func-data option
- Added --debug option to better debug problems with graph files
- Fixed CRLF line breaks in source code when generating tracefiles. Based on
patch by michael.knigge@set-software.de.
- Fixed problems with unnamed source files
- Fixed warning when $HOME is not set. Reported by acalando@free.fr.
- Fixed errors when processing unnamed source files
- Fixed help text typo
- Fixed errors when processing incomplete function names in .bb files
- Fixed filename prefix detection
- Fixed problem with matching filename
- Fixed problem when LANG is set to non-english locale. Reported by
benoit_belbezet@yahoo.fr.
- Fixed short-name option ambiguities
genpng:
- Fixed runtime-warning
lcov:
- Added support for branch coverage measurements
- Added support for the linux-2.6.31 upstream gcov kernel support
- Added --from-package and --to-package options
- Added --derive-func-data option
- Added overall coverage result output for more operations
- Improved output of lcov --list
- Improved gcov-kernel handling
- Fixed minor problem with --diff
- Fixed double-counting of function data
- Fixed warning when $HOME is not set. Reported by acalando@free.fr.
- Fixed error when combining tracefiles without function data. Reported by
richard.corden@gmail.com. (Can't use an undefined value as a HASH reference
at lcov line 1341.)
- Fixed help text typo
- Fixed filename prefix detection
- Fixed lcov ignoring information about converted test data
README:
- Added note to mention required -lgcov switch during linking
Version 1.7:
============
gendesc:
- Updated error and warning messages
- Updated man page
genhtml:
- Added function coverage data display patch by tomzo@nefkom.net (default is on)
- Added --function-coverage to enable function coverage display
- Added --no-function-coverage to disable function coverage display
- Added sorting option in HTLM output (default is on)
- Added --sort to enable sorting
- Added --no-sort to disable sorting
- Added --html-gzip to create gzip-compressed HTML output (patch by
dnozay@vmware.com)
- Fixed problem when using --baseline-file on coverage data files that
contain data for files not found in the baseline file
- Updated error and warning messages
- Updated man page
geninfo:
- Added function coverage data collection patch by tomzo@nefkom.net
- Added more verbose output when a "ERROR: reading string" error occurs
(patch by scott.heavner@philips.com)
- Fixed geninfo not working with directory names containing spaces (reported
by jeffconnelly@users.sourceforge.net)
- Fixed "ERROR: reading string" problem with gcc 4.1
- Fixed problem with function names that contain non-alphanumerical characters
- Fixed problem with gcc versions before 3.3
- Updated error and warning messages
- Updated man page
genpng:
- Updated error and warning messages
- Updated man page
lcov:
- Added support for function coverage data for adding/diffing tracefiles
- Added --no-recursion option to disable recursion into sub-directories
while scanning for gcov data files
- Fixed lcov -z not working with directory names containing spaces (reported
by Jeff Connelly)
- Updated error and warning messages
- Updated man page
lcov.spec:
- Updated of description and title information
lcovrc:
- Added genhtml_function_hi_limit
- Added genhtml_function_med_limit
- Added genhtml_function_coverage
- Added genhtml_sort
- Updated man page
Makefile:
- Updated info text
Version 1.6:
============
geninfo:
- Added libtool compatibility patch by thomas@apestaart.org (default is on)
- Added --compat-libtool option to enable libtool compatibility mode
- Added --no-compat-libtool option to disable libtool compatibility mode
- Changed default for line checksumming to off
- Added --checksum option to enable line checksumming
- Added --gcov-tool option
- Added --ignore-errors option
- Added --initial option to generate zero coverage from graph files
- Removed automatic test name modification on s390
- Added --checksum option
- Updated man page
lcov:
- Added libtool compatibility patch by thomas@apestaart.org
- Added --compat-libtool option to enable libtool compatibility mode
- Added --no-compat-libtool option to disable libtool compatibility mode
- Added --checksum option to enable line checksumming
- Added --gcov-tool option
- Added --ignore-errors option
- Added --initial option to generate zero coverage from graph files
- Updated help text
- Updated man page
- Fixed lcov not working when -k is specified more than once
- Fixed lcov not deleting .gcda files when specifying -z and -d
lcovrc:
- Added geninfo_compat_libtool option
- Added geninfo_checksum option
- Removed geninfo_no_checksum option from example lcovrc
- Updated man page
README:
- Added description of lcovrc file
Version 1.5:
============
genhtml:
- Added check for invalid characters in test names
- Added --legend option
- Added --html-prolog option
- Added --html-epilog option
- Added --html-extension option
- Added warning when specifying --no-prefix and --prefix
- Reworked help text to make it more readable
geninfo:
- Renamed 'sles9' compatibility mode to 'hammer' compatibility mode
- Added support for mandrake gcc 3.3.2
- Fixed bbg file reading in hammer compatibility mode
- Added check for invalid characters in test names
- Added --base-directory option
lcov:
- Added check for invalid characters in test names
- Added --base-directory option
Version 1.4:
============
All:
- Added configuration file support
genhtml:
- Fixed help text message
- Fixed handling of special characters in file- and directory names
- Added description of --css-file option to man page
geninfo:
- Added support for GCOV file format as used by GCC 3.3.3 on SUSE SLES9
- Fixed error text message
- Added check to abort processing if no source code file is available
- Added workaround for a problem where geninfo could not find source code
files for a C++ project
- Fixed 'branch'-statement parsing for GCC>=3.3 .gcov files
- Fixed exec count-statement parsing for GCC>=3.3 .gcov files
- Fixed .gcno-file parser (some lines were not counted as being instrumented)
lcov:
- Modified path for temporary files from '.' to '/tmp'
- Fixed comments
- Removed unused function 'escape_shell'
lcovrc:
- Introduced sample configuration file
Makefile:
- Added rule to install configuration file
- Fixed installation path for man pages
Version 1.3:
============
All:
- Added compatibility for gcc-3.4
lcov:
- Modified --diff function to better cope with ambiguous entries in patch files
- Modified --capture option to use modprobe before insmod (needed for 2.6)
- Added --path option required for --diff function
Version 1.2:
============
All:
- Added compatibility for gcc-3.3
- Adjusted LCOV-URL (http://ltp.sourceforge.net/coverage/lcov.php)
- Minor changes to whitespaces/line breaks/spelling
- Modified call mechanism so that parameters for external commands are not
parsed by the shell mechanism anymore (no more problems with special
characters in paths/filenames)
- Added checksumming mechanism: each tracefile now contains a checksum for
each instrumented line to detect incompatible data
Makefile:
- Added rule to build source RPM
- Changed install path for executables (/usr/local/bin -> /usr/bin)
lcov.spec:
- Modified to support building source rpms
updateversion.pl:
- Modified to include update of release number in spec file
genhtml:
- Fixed bug which would not correctly associate data sets with an empty
test name (only necessary when using --show-details in genhtml)
- Implemented new command line option '--nochecksum' to suppress generation
of checksums
- Implemented new command line option '--highlight' which highlights lines of
code which were only covered in converted tracefiles (see '--diff' option of
lcov)
geninfo:
- Added workaround for a bug in gcov shipped with gcc-3.2 which aborts when
encountering empty .da files
- Fixed geninfo so that it does not abort after encountering empty .bb files
- Added function to collect branch coverage data
- Added check for gcov tool
- Added check for the '--preserve-paths' option of gcov; if available, this
will prevent losing .gcov files in some special cases (include files with
same name in different subdirectories)
- Implemented new command line option '--follow' to control whether or not
links should be followed while searching for .da files.
- Implemented new command line option '--nochecksum' to suppress generation
of checksums
lcov:
- Fixed bug which would not correctly associate data sets with an empty
test name (only necessary when using --show-details in genhtml)
- Cleaned up internal command line option check
- Files are now processed in alphabetical order
- Added message when reading tracefiles
- Implemented new command line option '--nochecksum' to suppress generation
of checksums
- Implemented new command line option '--diff' which allows converting
coverage data from an older source code version by using a diff file
to map line numbers
- Implemented new command line option '--follow' to control whether or not
links should be followed while searching for .da files.
genpng:
- Added support for the highlighting option of genhtml
- Corrected tab to spaces conversion
- Modified genpng to take number of spaces to use in place of tab as input
instead of replacement string
Version 1.1:
============
- Added CHANGES file
- Added Makefile implementing the following targets:
* install : install LCOV scripts and man pages
* uninstall : revert previous installation
* dist : create lcov.tar.gz file and lcov.rpm file
* clean : clean up example directory, remove .tar and .rpm files
- Added man pages for all scripts
- Added example program to demonstrate the use of LCOV with a userspace
application
- Implemented RPM build process
- New directory structure:
* bin : contains all executables
* example : contains a userspace example for LCOV
* man : contains man pages
* rpm : contains files required for the RPM build process
- LCOV-scripts are now in bin/
- Removed .pl-extension from LCOV-script files
- Renamed readme.txt to README
README:
- Adjusted mailing list address to ltp-coverage@lists.sourceforge.net
- Fixed incorrect parameter '--output-filename' in example LCOV call
- Removed tool descriptions and turned them into man pages
- Installation instructions now refer to RPM and tarball
descriptions.tests:
- Fixed some spelling errors
genhtml:
- Fixed bug which resulted in an error when trying to combine .info files
containing data without a test name
- Fixed bug which would not correctly handle data files in directories
with names containing some special characters ('+', etc.)
- Added check for empty tracefiles to prevent division-by-zeros
- Implemented new command line option --num-spaces / the number of spaces
which replace a tab in source code view is now user defined
- Fixed tab expansion so that in source code view, a tab doesn't produce a
fixed number of spaces, but as many spaces as are needed to advance to the
next tab position
- Output directory is now created if it doesn't exist
- Renamed "overview page" to "directory view page"
- HTML output pages are now titled "LCOV" instead of "GCOV"
- Information messages are now printed to STDERR instead of STDOUT
geninfo:
- Fixed bug which would not allow .info files to be generated in directories
with names containing some special characters
- Information messages are now printed to STDERR instead of STDOUT
lcov:
- Fixed bug which would cause lcov to fail when the tool is installed in
a path with a name containing some special characters
- Implemented new command line option '--add-tracefile' which allows the
combination of data from several tracefiles
- Implemented new command line option '--list' which lists the contents
of a tracefile
- Implemented new command line option '--extract' which allows extracting
data for a particular set of files from a tracefile
- Implemented new command line option '--remove' which allows removing
data for a particular set of files from a tracefile
- Renamed '--reset' to '--zerocounters' to avoid a naming ambiguity with
'--remove'
- Changed name of gcov kernel directory from /proc/gcov to a global constant
so that it may be changed easily when required in future versions
- Information messages are now printed to STDERR instead of STDOUT
Version 1.0 (2002-09-05):
=========================
- Initial version

View File

@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@ -1,99 +0,0 @@
#
# Makefile for LCOV
#
# Make targets:
# - install: install LCOV tools and man pages on the system
# - uninstall: remove tools and man pages from the system
# - dist: create files required for distribution, i.e. the lcov.tar.gz
# and the lcov.rpm file. Just make sure to adjust the VERSION
# and RELEASE variables below - both version and date strings
# will be updated in all necessary files.
# - clean: remove all generated files
#
VERSION := 1.10
RELEASE := 1
CFG_DIR := $(PREFIX)/etc
BIN_DIR := $(PREFIX)/usr/bin
MAN_DIR := $(PREFIX)/usr/share/man
TMP_DIR := /tmp/lcov-tmp.$(shell echo $$$$)
FILES := $(wildcard bin/*) $(wildcard man/*) README CHANGES Makefile \
$(wildcard rpm/*) lcovrc
.PHONY: all info clean install uninstall rpms
all: info
info:
@echo "Available make targets:"
@echo " install : install binaries and man pages in PREFIX (default /)"
@echo " uninstall : delete binaries and man pages from PREFIX (default /)"
@echo " dist : create packages (RPM, tarball) ready for distribution"
clean:
rm -f lcov-*.tar.gz
rm -f lcov-*.rpm
make -C example clean
install:
bin/install.sh bin/lcov $(BIN_DIR)/lcov -m 755
bin/install.sh bin/genhtml $(BIN_DIR)/genhtml -m 755
bin/install.sh bin/geninfo $(BIN_DIR)/geninfo -m 755
bin/install.sh bin/genpng $(BIN_DIR)/genpng -m 755
bin/install.sh bin/gendesc $(BIN_DIR)/gendesc -m 755
bin/install.sh man/lcov.1 $(MAN_DIR)/man1/lcov.1 -m 644
bin/install.sh man/genhtml.1 $(MAN_DIR)/man1/genhtml.1 -m 644
bin/install.sh man/geninfo.1 $(MAN_DIR)/man1/geninfo.1 -m 644
bin/install.sh man/genpng.1 $(MAN_DIR)/man1/genpng.1 -m 644
bin/install.sh man/gendesc.1 $(MAN_DIR)/man1/gendesc.1 -m 644
bin/install.sh man/lcovrc.5 $(MAN_DIR)/man5/lcovrc.5 -m 644
bin/install.sh lcovrc $(CFG_DIR)/lcovrc -m 644
uninstall:
bin/install.sh --uninstall bin/lcov $(BIN_DIR)/lcov
bin/install.sh --uninstall bin/genhtml $(BIN_DIR)/genhtml
bin/install.sh --uninstall bin/geninfo $(BIN_DIR)/geninfo
bin/install.sh --uninstall bin/genpng $(BIN_DIR)/genpng
bin/install.sh --uninstall bin/gendesc $(BIN_DIR)/gendesc
bin/install.sh --uninstall man/lcov.1 $(MAN_DIR)/man1/lcov.1
bin/install.sh --uninstall man/genhtml.1 $(MAN_DIR)/man1/genhtml.1
bin/install.sh --uninstall man/geninfo.1 $(MAN_DIR)/man1/geninfo.1
bin/install.sh --uninstall man/genpng.1 $(MAN_DIR)/man1/genpng.1
bin/install.sh --uninstall man/gendesc.1 $(MAN_DIR)/man1/gendesc.1
bin/install.sh --uninstall man/lcovrc.5 $(MAN_DIR)/man5/lcovrc.5
bin/install.sh --uninstall lcovrc $(CFG_DIR)/lcovrc
dist: lcov-$(VERSION).tar.gz lcov-$(VERSION)-$(RELEASE).noarch.rpm \
lcov-$(VERSION)-$(RELEASE).src.rpm
lcov-$(VERSION).tar.gz: $(FILES)
mkdir $(TMP_DIR)
mkdir $(TMP_DIR)/lcov-$(VERSION)
cp -r * $(TMP_DIR)/lcov-$(VERSION)
find $(TMP_DIR)/lcov-$(VERSION) -name CVS -type d | xargs rm -rf
make -C $(TMP_DIR)/lcov-$(VERSION) clean
bin/updateversion.pl $(TMP_DIR)/lcov-$(VERSION) $(VERSION) $(RELEASE)
cd $(TMP_DIR) ; \
tar cfz $(TMP_DIR)/lcov-$(VERSION).tar.gz lcov-$(VERSION)
mv $(TMP_DIR)/lcov-$(VERSION).tar.gz .
rm -rf $(TMP_DIR)
lcov-$(VERSION)-$(RELEASE).noarch.rpm: rpms
lcov-$(VERSION)-$(RELEASE).src.rpm: rpms
rpms: lcov-$(VERSION).tar.gz
mkdir $(TMP_DIR)
mkdir $(TMP_DIR)/BUILD
mkdir $(TMP_DIR)/RPMS
mkdir $(TMP_DIR)/SOURCES
mkdir $(TMP_DIR)/SRPMS
cp lcov-$(VERSION).tar.gz $(TMP_DIR)/SOURCES
cd $(TMP_DIR)/BUILD ; \
tar xfz $(TMP_DIR)/SOURCES/lcov-$(VERSION).tar.gz \
lcov-$(VERSION)/rpm/lcov.spec
rpmbuild --define '_topdir $(TMP_DIR)' \
-ba $(TMP_DIR)/BUILD/lcov-$(VERSION)/rpm/lcov.spec
mv $(TMP_DIR)/RPMS/noarch/lcov-$(VERSION)-$(RELEASE).noarch.rpm .
mv $(TMP_DIR)/SRPMS/lcov-$(VERSION)-$(RELEASE).src.rpm .
rm -rf $(TMP_DIR)

View File

@ -1,137 +0,0 @@
-------------------------------------------------
- README file for the LTP GCOV extension (LCOV) -
- Last changes: 2012-10-10 -
-------------------------------------------------
Description
-----------
LCOV is an extension of GCOV, a GNU tool which provides information about
what parts of a program are actually executed (i.e. "covered") while running
a particular test case. The extension consists of a set of Perl scripts
which build on the textual GCOV output to implement the following enhanced
functionality:
* HTML based output: coverage rates are additionally indicated using bar
graphs and specific colors.
* Support for large projects: overview pages allow quick browsing of
coverage data by providing three levels of detail: directory view,
file view and source code view.
LCOV was initially designed to support Linux kernel coverage measurements,
but works as well for coverage measurements on standard user space
applications.
Further README contents
-----------------------
1. Included files
2. Installing LCOV
3. An example of how to access kernel coverage data
4. An example of how to access coverage data for a user space program
5. Questions and Comments
1. Important files
------------------
README - This README file
CHANGES - List of changes between releases
bin/lcov - Tool for capturing LCOV coverage data
bin/genhtml - Tool for creating HTML output from LCOV data
bin/gendesc - Tool for creating description files as used by genhtml
bin/geninfo - Internal tool (creates LCOV data files)
bin/genpng - Internal tool (creates png overviews of source files)
bin/install.sh - Internal tool (takes care of un-/installing)
descriptions.tests - Test descriptions for the LTP suite, use with gendesc
man - Directory containing man pages for included tools
example - Directory containing an example to demonstrate LCOV
lcovrc - LCOV configuration file
Makefile - Makefile providing 'install' and 'uninstall' targets
2. Installing LCOV
------------------
The LCOV package is available as either RPM or tarball from:
http://ltp.sourceforge.net/coverage/lcov.php
To install the tarball, unpack it to a directory and run:
make install
Use anonymous CVS for the most recent (but possibly unstable) version:
cvs -d:pserver:anonymous@ltp.cvs.sourceforge.net:/cvsroot/ltp login
(simply press the ENTER key when asked for a password)
cvs -z3 -d:pserver:anonymous@ltp.cvs.sourceforge.net:/cvsroot/ltp export -D now utils
Change to the utils/analysis/lcov directory and type:
make install
3. An example of how to access kernel coverage data
---------------------------------------------------
Requirements: get and install the gcov-kernel package from
http://sourceforge.net/projects/ltp
Copy the resulting gcov kernel module file to either the system wide modules
directory or the same directory as the Perl scripts. As root, do the following:
a) Resetting counters
lcov --zerocounters
b) Capturing the current coverage state to a file
lcov --capture --output-file kernel.info
c) Getting HTML output
genhtml kernel.info
Point the web browser of your choice to the resulting index.html file.
4. An example of how to access coverage data for a user space program
---------------------------------------------------------------------
Requirements: compile the program in question using GCC with the options
-fprofile-arcs and -ftest-coverage. During linking, make sure to specify
-lgcov or -coverage.
Assuming the compile directory is called "appdir", do the following:
a) Resetting counters
lcov --directory appdir --zerocounters
b) Capturing the current coverage state to a file (works only after the
application has been started and stopped at least once)
lcov --directory appdir --capture --output-file app.info
c) Getting HTML output
genhtml app.info
Point the web browser of your choice to the resulting index.html file.
Please note that independently of where the application is installed or
from which directory it is run, the --directory statement needs to
point to the directory in which the application was compiled.
For further information on the gcc profiling mechanism, please also
consult the gcov man page.
5. Questions and comments
-------------------------
See the included man pages for more information on how to use the LCOV tools.
Please email further questions or comments regarding this tool to the
LTP Mailing list at ltp-coverage@lists.sourceforge.net

View File

@ -1,226 +0,0 @@
#!/usr/bin/perl -w
#
# Copyright (c) International Business Machines Corp., 2002
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#
# gendesc
#
# This script creates a description file as understood by genhtml.
# Input file format:
#
# For each test case:
# <test name><optional whitespace>
# <at least one whitespace character (blank/tab)><test description>
#
# Actual description may consist of several lines. By default, output is
# written to stdout. Test names consist of alphanumeric characters
# including _ and -.
#
#
# History:
# 2002-09-02: created by Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>
#
use strict;
use File::Basename;
use Getopt::Long;
# Constants
our $lcov_version = 'LCOV version 1.10';
our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
our $tool_name = basename($0);
# Prototypes
sub print_usage(*);
sub gen_desc();
sub warn_handler($);
sub die_handler($);
# Global variables
our $help;
our $version;
our $output_filename;
our $input_filename;
#
# Code entry point
#
$SIG{__WARN__} = \&warn_handler;
$SIG{__DIE__} = \&die_handler;
# Prettify version string
$lcov_version =~ s/\$\s*Revision\s*:?\s*(\S+)\s*\$/$1/;
# Parse command line options
if (!GetOptions("output-filename=s" => \$output_filename,
"version" =>\$version,
"help|?" => \$help
))
{
print(STDERR "Use $tool_name --help to get usage information\n");
exit(1);
}
$input_filename = $ARGV[0];
# Check for help option
if ($help)
{
print_usage(*STDOUT);
exit(0);
}
# Check for version option
if ($version)
{
print("$tool_name: $lcov_version\n");
exit(0);
}
# Check for input filename
if (!$input_filename)
{
die("No input filename specified\n".
"Use $tool_name --help to get usage information\n");
}
# Do something
gen_desc();
#
# print_usage(handle)
#
# Write out command line usage information to given filehandle.
#
sub print_usage(*)
{
local *HANDLE = $_[0];
print(HANDLE <<END_OF_USAGE)
Usage: $tool_name [OPTIONS] INPUTFILE
Convert a test case description file into a format as understood by genhtml.
-h, --help Print this help, then exit
-v, --version Print version number, then exit
-o, --output-filename FILENAME Write description to FILENAME
For more information see: $lcov_url
END_OF_USAGE
;
}
#
# gen_desc()
#
# Read text file INPUT_FILENAME and convert the contained description to a
# format as understood by genhtml, i.e.
#
# TN:<test name>
# TD:<test description>
#
# If defined, write output to OUTPUT_FILENAME, otherwise to stdout.
#
# Die on error.
#
sub gen_desc()
{
local *INPUT_HANDLE;
local *OUTPUT_HANDLE;
my $empty_line = "ignore";
open(INPUT_HANDLE, "<", $input_filename)
or die("ERROR: cannot open $input_filename!\n");
# Open output file for writing
if ($output_filename)
{
open(OUTPUT_HANDLE, ">", $output_filename)
or die("ERROR: cannot create $output_filename!\n");
}
else
{
*OUTPUT_HANDLE = *STDOUT;
}
# Process all lines in input file
while (<INPUT_HANDLE>)
{
chomp($_);
if (/^(\w[\w-]*)(\s*)$/)
{
# Matched test name
# Name starts with alphanum or _, continues with
# alphanum, _ or -
print(OUTPUT_HANDLE "TN: $1\n");
$empty_line = "ignore";
}
elsif (/^(\s+)(\S.*?)\s*$/)
{
# Matched test description
if ($empty_line eq "insert")
{
# Write preserved empty line
print(OUTPUT_HANDLE "TD: \n");
}
print(OUTPUT_HANDLE "TD: $2\n");
$empty_line = "observe";
}
elsif (/^\s*$/)
{
# Matched empty line to preserve paragraph separation
# inside description text
if ($empty_line eq "observe")
{
$empty_line = "insert";
}
}
}
# Close output file if defined
if ($output_filename)
{
close(OUTPUT_HANDLE);
}
close(INPUT_HANDLE);
}
sub warn_handler($)
{
my ($msg) = @_;
warn("$tool_name: $msg");
}
sub die_handler($)
{
my ($msg) = @_;
die("$tool_name: $msg");
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,389 +0,0 @@
#!/usr/bin/perl -w
#
# Copyright (c) International Business Machines Corp., 2002
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#
# genpng
#
# This script creates an overview PNG image of a source code file by
# representing each source code character by a single pixel.
#
# Note that the Perl module GD.pm is required for this script to work.
# It may be obtained from http://www.cpan.org
#
# History:
# 2002-08-26: created by Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>
#
use strict;
use File::Basename;
use Getopt::Long;
# Constants
our $lcov_version = 'LCOV version 1.10';
our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
our $tool_name = basename($0);
# Prototypes
sub gen_png($$$@);
sub check_and_load_module($);
sub genpng_print_usage(*);
sub genpng_process_file($$$$);
sub genpng_warn_handler($);
sub genpng_die_handler($);
#
# Code entry point
#
# Prettify version string
$lcov_version =~ s/\$\s*Revision\s*:?\s*(\S+)\s*\$/$1/;
# Check whether required module GD.pm is installed
if (check_and_load_module("GD"))
{
# Note: cannot use die() to print this message because inserting this
# code into another script via do() would not fail as required!
print(STDERR <<END_OF_TEXT)
ERROR: required module GD.pm not found on this system (see www.cpan.org).
END_OF_TEXT
;
exit(2);
}
# Check whether we're called from the command line or from another script
if (!caller)
{
my $filename;
my $tab_size = 4;
my $width = 80;
my $out_filename;
my $help;
my $version;
$SIG{__WARN__} = \&genpng_warn_handler;
$SIG{__DIE__} = \&genpng_die_handler;
# Parse command line options
if (!GetOptions("tab-size=i" => \$tab_size,
"width=i" => \$width,
"output-filename=s" => \$out_filename,
"help" => \$help,
"version" => \$version))
{
print(STDERR "Use $tool_name --help to get usage ".
"information\n");
exit(1);
}
$filename = $ARGV[0];
# Check for help flag
if ($help)
{
genpng_print_usage(*STDOUT);
exit(0);
}
# Check for version flag
if ($version)
{
print("$tool_name: $lcov_version\n");
exit(0);
}
# Check options
if (!$filename)
{
die("No filename specified\n");
}
# Check for output filename
if (!$out_filename)
{
$out_filename = "$filename.png";
}
genpng_process_file($filename, $out_filename, $width, $tab_size);
exit(0);
}
#
# genpng_print_usage(handle)
#
# Write out command line usage information to given filehandle.
#
sub genpng_print_usage(*)
{
local *HANDLE = $_[0];
print(HANDLE <<END_OF_USAGE)
Usage: $tool_name [OPTIONS] SOURCEFILE
Create an overview image for a given source code file of either plain text
or .gcov file format.
-h, --help Print this help, then exit
-v, --version Print version number, then exit
-t, --tab-size TABSIZE Use TABSIZE spaces in place of tab
-w, --width WIDTH Set width of output image to WIDTH pixel
-o, --output-filename FILENAME Write image to FILENAME
For more information see: $lcov_url
END_OF_USAGE
;
}
#
# check_and_load_module(module_name)
#
# Check whether a module by the given name is installed on this system
# and make it known to the interpreter if available. Return undefined if it
# is installed, an error message otherwise.
#
sub check_and_load_module($)
{
eval("use $_[0];");
return $@;
}
#
# genpng_process_file(filename, out_filename, width, tab_size)
#
sub genpng_process_file($$$$)
{
my $filename = $_[0];
my $out_filename = $_[1];
my $width = $_[2];
my $tab_size = $_[3];
local *HANDLE;
my @source;
open(HANDLE, "<", $filename)
or die("ERROR: cannot open $filename!\n");
# Check for .gcov filename extension
if ($filename =~ /^(.*).gcov$/)
{
# Assume gcov text format
while (<HANDLE>)
{
if (/^\t\t(.*)$/)
{
# Uninstrumented line
push(@source, ":$1");
}
elsif (/^ ###### (.*)$/)
{
# Line with zero execution count
push(@source, "0:$1");
}
elsif (/^( *)(\d*) (.*)$/)
{
# Line with positive execution count
push(@source, "$2:$3");
}
}
}
else
{
# Plain text file
while (<HANDLE>) { push(@source, ":$_"); }
}
close(HANDLE);
gen_png($out_filename, $width, $tab_size, @source);
}
#
# gen_png(filename, width, tab_size, source)
#
# Write an overview PNG file to FILENAME. Source code is defined by SOURCE
# which is a list of lines <count>:<source code> per source code line.
# The output image will be made up of one pixel per character of source,
# coloring will be done according to execution counts. WIDTH defines the
# image width. TAB_SIZE specifies the number of spaces to use as replacement
# string for tabulator signs in source code text.
#
# Die on error.
#
sub gen_png($$$@)
{
my $filename = shift(@_); # Filename for PNG file
my $overview_width = shift(@_); # Imagewidth for image
my $tab_size = shift(@_); # Replacement string for tab signs
my @source = @_; # Source code as passed via argument 2
my $height; # Height as define by source size
my $overview; # Source code overview image data
my $col_plain_back; # Color for overview background
my $col_plain_text; # Color for uninstrumented text
my $col_cov_back; # Color for background of covered lines
my $col_cov_text; # Color for text of covered lines
my $col_nocov_back; # Color for background of lines which
# were not covered (count == 0)
my $col_nocov_text; # Color for test of lines which were not
# covered (count == 0)
my $col_hi_back; # Color for background of highlighted lines
my $col_hi_text; # Color for text of highlighted lines
my $line; # Current line during iteration
my $row = 0; # Current row number during iteration
my $column; # Current column number during iteration
my $color_text; # Current text color during iteration
my $color_back; # Current background color during iteration
my $last_count; # Count of last processed line
my $count; # Count of current line
my $source; # Source code of current line
my $replacement; # Replacement string for tabulator chars
local *PNG_HANDLE; # Handle for output PNG file
# Handle empty source files
if (!@source) {
@source = ( "" );
}
$height = scalar(@source);
# Create image
$overview = new GD::Image($overview_width, $height)
or die("ERROR: cannot allocate overview image!\n");
# Define colors
$col_plain_back = $overview->colorAllocate(0xff, 0xff, 0xff);
$col_plain_text = $overview->colorAllocate(0xaa, 0xaa, 0xaa);
$col_cov_back = $overview->colorAllocate(0xaa, 0xa7, 0xef);
$col_cov_text = $overview->colorAllocate(0x5d, 0x5d, 0xea);
$col_nocov_back = $overview->colorAllocate(0xff, 0x00, 0x00);
$col_nocov_text = $overview->colorAllocate(0xaa, 0x00, 0x00);
$col_hi_back = $overview->colorAllocate(0x00, 0xff, 0x00);
$col_hi_text = $overview->colorAllocate(0x00, 0xaa, 0x00);
# Visualize each line
foreach $line (@source)
{
# Replace tabs with spaces to keep consistent with source
# code view
while ($line =~ /^([^\t]*)(\t)/)
{
$replacement = " "x($tab_size - ((length($1) - 1) %
$tab_size));
$line =~ s/^([^\t]*)(\t)/$1$replacement/;
}
# Skip lines which do not follow the <count>:<line>
# specification, otherwise $1 = count, $2 = source code
if (!($line =~ /(\*?)(\d*):(.*)$/)) { next; }
$count = $2;
$source = $3;
# Decide which color pair to use
# If this line was not instrumented but the one before was,
# take the color of that line to widen color areas in
# resulting image
if (($count eq "") && defined($last_count) &&
($last_count ne ""))
{
$count = $last_count;
}
if ($count eq "")
{
# Line was not instrumented
$color_text = $col_plain_text;
$color_back = $col_plain_back;
}
elsif ($count == 0)
{
# Line was instrumented but not executed
$color_text = $col_nocov_text;
$color_back = $col_nocov_back;
}
elsif ($1 eq "*")
{
# Line was highlighted
$color_text = $col_hi_text;
$color_back = $col_hi_back;
}
else
{
# Line was instrumented and executed
$color_text = $col_cov_text;
$color_back = $col_cov_back;
}
# Write one pixel for each source character
$column = 0;
foreach (split("", $source))
{
# Check for width
if ($column >= $overview_width) { last; }
if ($_ eq " ")
{
# Space
$overview->setPixel($column++, $row,
$color_back);
}
else
{
# Text
$overview->setPixel($column++, $row,
$color_text);
}
}
# Fill rest of line
while ($column < $overview_width)
{
$overview->setPixel($column++, $row, $color_back);
}
$last_count = $2;
$row++;
}
# Write PNG file
open (PNG_HANDLE, ">", $filename)
or die("ERROR: cannot write png file $filename!\n");
binmode(*PNG_HANDLE);
print(PNG_HANDLE $overview->png());
close(PNG_HANDLE);
}
sub genpng_warn_handler($)
{
my ($msg) = @_;
warn("$tool_name: $msg");
}
sub genpng_die_handler($)
{
my ($msg) = @_;
die("$tool_name: $msg");
}

View File

@ -1,71 +0,0 @@
#!/bin/bash
#
# install.sh [--uninstall] sourcefile targetfile [install options]
#
# Check for uninstall option
if test "x$1" == "x--uninstall" ; then
UNINSTALL=true
SOURCE=$2
TARGET=$3
shift 3
else
UNINSTALL=false
SOURCE=$1
TARGET=$2
shift 2
fi
# Check usage
if test -z "$SOURCE" || test -z "$TARGET" ; then
echo Usage: install.sh [--uninstall] source target [install options] >&2
exit 1
fi
#
# do_install(SOURCE_FILE, TARGET_FILE)
#
do_install()
{
local SOURCE=$1
local TARGET=$2
local PARAMS=$3
install -p -D $PARAMS $SOURCE $TARGET
}
#
# do_uninstall(SOURCE_FILE, TARGET_FILE)
#
do_uninstall()
{
local SOURCE=$1
local TARGET=$2
# Does target exist?
if test -r $TARGET ; then
# Is target of the same version as this package?
if diff $SOURCE $TARGET >/dev/null; then
rm -f $TARGET
else
echo WARNING: Skipping uninstall for $TARGET - versions differ! >&2
fi
else
echo WARNING: Skipping uninstall for $TARGET - not installed! >&2
fi
}
# Call sub routine
if $UNINSTALL ; then
do_uninstall $SOURCE $TARGET
else
do_install $SOURCE $TARGET "$*"
fi
exit 0

File diff suppressed because it is too large Load Diff

View File

@ -1,146 +0,0 @@
#!/usr/bin/perl -w
use strict;
sub update_man_page($);
sub update_bin_tool($);
sub update_txt_file($);
sub update_spec_file($);
sub get_file_info($);
our $directory = $ARGV[0];
our $version = $ARGV[1];
our $release = $ARGV[2];
our @man_pages = ("man/gendesc.1", "man/genhtml.1", "man/geninfo.1",
"man/genpng.1", "man/lcov.1", "man/lcovrc.5");
our @bin_tools = ("bin/gendesc", "bin/genhtml", "bin/geninfo",
"bin/genpng", "bin/lcov");
our @txt_files = ("README");
our @spec_files = ("rpm/lcov.spec");
if (!defined($directory) || !defined($version) || !defined($release)) {
die("Usage: $0 <directory> <version string> <release string>\n");
}
foreach (@man_pages) {
print("Updating man page $_\n");
update_man_page($directory."/".$_);
}
foreach (@bin_tools) {
print("Updating bin tool $_\n");
update_bin_tool($directory."/".$_);
}
foreach (@txt_files) {
print("Updating text file $_\n");
update_txt_file($directory."/".$_);
}
foreach (@spec_files) {
print("Updating spec file $_\n");
update_spec_file($directory."/".$_);
}
print("Done.\n");
sub get_file_info($)
{
my ($filename) = @_;
my ($sec, $min, $hour, $year, $month, $day);
my @stat;
@stat = stat($filename);
($sec, $min, $hour, $day, $month, $year) = localtime($stat[9]);
$year += 1900;
$month += 1;
return (sprintf("%04d-%02d-%02d", $year, $month, $day),
sprintf("%04d%02d%02d%02d%02d.%02d", $year, $month, $day,
$hour, $min, $sec),
sprintf("%o", $stat[2] & 07777));
}
sub update_man_page($)
{
my ($filename) = @_;
my @date = get_file_info($filename);
my $date_string = $date[0];
local *IN;
local *OUT;
$date_string =~ s/-/\\-/g;
open(IN, "<$filename") || die ("Error: cannot open $filename\n");
open(OUT, ">$filename.new") ||
die("Error: cannot create $filename.new\n");
while (<IN>) {
s/\"LCOV\s+\d+\.\d+\"/\"LCOV $version\"/g;
s/\d\d\d\d\\\-\d\d\\\-\d\d/$date_string/g;
print(OUT $_);
}
close(OUT);
close(IN);
chmod(oct($date[2]), "$filename.new");
system("mv", "-f", "$filename.new", "$filename");
system("touch", "$filename", "-t", $date[1]);
}
sub update_bin_tool($)
{
my ($filename) = @_;
my @date = get_file_info($filename);
local *IN;
local *OUT;
open(IN, "<$filename") || die ("Error: cannot open $filename\n");
open(OUT, ">$filename.new") ||
die("Error: cannot create $filename.new\n");
while (<IN>) {
s/(our\s+\$lcov_version\s*=\s*["']).*(["'].*)$/$1LCOV version $version$2/g;
print(OUT $_);
}
close(OUT);
close(IN);
chmod(oct($date[2]), "$filename.new");
system("mv", "-f", "$filename.new", "$filename");
system("touch", "$filename", "-t", $date[1]);
}
sub update_txt_file($)
{
my ($filename) = @_;
my @date = get_file_info($filename);
local *IN;
local *OUT;
open(IN, "<$filename") || die ("Error: cannot open $filename\n");
open(OUT, ">$filename.new") ||
die("Error: cannot create $filename.new\n");
while (<IN>) {
s/(Last\s+changes:\s+)\d\d\d\d-\d\d-\d\d/$1$date[0]/g;
print(OUT $_);
}
close(OUT);
close(IN);
chmod(oct($date[2]), "$filename.new");
system("mv", "-f", "$filename.new", "$filename");
system("touch", "$filename", "-t", $date[1]);
}
sub update_spec_file($)
{
my ($filename) = @_;
my @date = get_file_info($filename);
local *IN;
local *OUT;
open(IN, "<$filename") || die ("Error: cannot open $filename\n");
open(OUT, ">$filename.new") ||
die("Error: cannot create $filename.new\n");
while (<IN>) {
s/^(Version:\s*)\d+\.\d+.*$/$1$version/;
s/^(Release:\s*).*$/$1$release/;
print(OUT $_);
}
close(OUT);
close(IN);
system("mv", "-f", "$filename.new", "$filename");
system("touch", "$filename", "-t", $date[1]);
}

View File

@ -1 +0,0 @@
09-04-2003 Initial checkin

View File

@ -1,48 +0,0 @@
-------------------------------------------------
- README file for the LCOV galaxy mapping tool -
- Last changes: 2003-09-04 -
-------------------------------------------------
Description
-----------
Further README contents
-----------------------
1. Included files
2. Installing
3. Notes and Comments
1. Important files
------------------
README - This README file
CHANGES - List of changes between releases
conglomerate_functions.pl - Replacement file - Generates shading
genflat.pl - Generates info for shading from .info files
gen_makefile.sh - Replacement file - updates to postscript
posterize.pl - Replacement file - generates a final ps file
2. Installing
-------------
This install requires fcgp, which means the target kernel src must be on
the system creating the map.
Download and copy the new files into the fcgp directory, (Note: its always
a good idea to have backups).
Run genflat.pl against your kernel info files
./genflat.pl kernel.info kernel2.info > coverage.dat
Run the make command for the fcgp (Note: this can take a while)
make KERNEL_DIR=/usr/src/linux
Update posterize.pl as needed, normally page size, margins, titles.
Most of these settings will be broken out as command line options in the future.
Run posterize.pl this will generate the file poster.ps.
3. Notes and Comments
---------------------
This is a quick and dirty implementation suited for my needs. It does not
perform any of the tiling the original did.

View File

@ -1,195 +0,0 @@
#! /usr/bin/perl -w
# Takes a set of ps images (belonging to one file) and produces a
# conglomerate picture of that file: static functions in the middle,
# others around it. Each one gets a box about its area.
use strict;
my $SCRUNCH = $ARGV [0];
my $BOXSCRUNCH = $ARGV [1];
my $Tmp;
my $DEBUG = 1;
shift @ARGV; # skip SCRUNCH and BOXSCRUNCH
shift @ARGV;
DecorateFuncs (@ARGV);
#TMPFILE=`mktemp ${TMPDIR:-/tmp}/$$.XXXXXX`
# Arrange.
my $ArgList = "";
foreach $Tmp (@ARGV) {
$ArgList .= "'$Tmp' ";
}
my @Arranged = `../draw_arrangement $SCRUNCH 0 360 0 $ArgList`;
my $CFile = $ARGV [0];
$CFile =~ s/\.c\..*$/.c/;
if ($DEBUG) { print ("% Conglomeration of $CFile\n"); }
print "gsave angle rotate\n";
# Now output the file, except last line.
my $LastLine = pop (@Arranged);
my $Fill = Box_2 ($LastLine,$CFile);
print $Fill;
# Draw box with file name
my @Output = Box ('normal', 'Helvetica-Bold', 32, $CFile, $LastLine);
splice(@Output, $#Output, 0, "grestore\n");
#print @Output;
print (@Arranged);
#add a duplicate box to test if this works
print @Output;
sub ParseBound
{
my $BBoxLine = shift;
$BBoxLine =~ /(-?[\d.]+)\s+(-?[\d.]+)\s+(-?[\d.]+)\s+(-?[\d.]+)/;
# XMin, YMin, XMax, YMax
return ($1 * $BOXSCRUNCH, $2 * $BOXSCRUNCH,
$3 * $BOXSCRUNCH, $4 * $BOXSCRUNCH);
}
# Box (type, font, fontsize, Label, BBoxLine)
sub Box
{
my $Type = shift;
my $Font = shift;
my $Fontsize = shift;
my $Label = shift;
my $BBoxLine = shift;
my @Output = ();
# print (STDERR "Box ('$Type', '$Font', '$Fontsize', '$Label', '$BBoxLine')\n");
push (@Output, "% start of box\n");
push (@Output, "D5\n") if ($Type eq "dashed");
# print (STDERR "BBoxLine: '$BBoxLine'\n");
# print (STDERR "Parsed: '" . join ("' '", ParseBound ($BBoxLine)) . "\n");
my ($XMin, $YMin, $XMax, $YMax) = ParseBound ($BBoxLine);
my $LeftSpaced = $XMin + 6;
my $BottomSpaced = $YMin + 6;
# Put black box around it
push (@Output, (
"($Label) $LeftSpaced $BottomSpaced $Fontsize /$Font\n",
"$YMin $XMin $YMax $XMax U\n"
)
);
push (@Output, "D\n") if ($Type eq "dashed");
# fill bounding box
push (@Output, "% end of box\n");
# Output bounding box
push (@Output, "% bound $XMin $YMin $XMax $YMax\n");
return @Output;
}
sub Box_2
{
my $BBoxLine = shift;
my $CFile = shift;
my $CovFile = "./coverage.dat";
my ($XMin, $YMin, $XMax, $YMax) = ParseBound ($BBoxLine);
my @output = `fgrep $CFile $CovFile`;
chomp $output[0];
my ($junk, $Class, $per) = split /\t/, $output[0];
return "$XMin $YMin $XMax $YMax $Class\n";
}
# Decorate (rgb-vals(1 string) filename)
sub Decorate
{
my $RGB = shift;
my $Filename = shift;
my @Input = ReadPS ($Filename);
my $LastLine = pop (@Input);
my @Output = ();
# Color at the beginning.
push (@Output, "C$RGB\n");
# Now output the file, except last line.
push (@Output, @Input);
# Draw dashed box with function name
# FIXME Make bound cover the label as well!
my $FuncName = $Filename;
$FuncName =~ s/^[^.]+\.c\.(.+?)\..*$/$1/;
push (@Output, Box ('dashed', 'Helvetica', 24, $FuncName, $LastLine));
# Slap over the top.
WritePS ($Filename, @Output);
}
# Add colored boxes around functions
sub DecorateFuncs
{
my $FName = "";
my $FType = "";
foreach $FName (@ARGV)
{
$FName =~ /\+([A-Z]+)\+/;
$FType = $1;
if ($FType eq 'STATIC') {
Decorate ("2", $FName); # Light green.
}
elsif ($FType eq 'INDIRECT') {
Decorate ("3", $FName); # Green.
}
elsif ($FType eq 'EXPORTED') {
Decorate ("4", $FName); # Red.
}
elsif ($FType eq 'NORMAL') {
Decorate ("5", $FName); # Blue.
}
else {
die ("Unknown extension $FName");
}
}
}
sub ReadPS
{
my $Filename = shift;
my @Contents = ();
open (INFILE, "$Filename") or die ("Could not read $Filename: $!");
@Contents = <INFILE>;
close (INFILE);
return @Contents;
}
sub WritePS
{
my $Filename = shift;
open (OUTFILE, ">$Filename")
or die ("Could not write $Filename: $!");
print (OUTFILE @_);
close (OUTFILE);
}

View File

@ -1,129 +0,0 @@
#! /bin/sh
cd image
# Space-optimized version: strip comments, drop precision to 3
# figures, eliminate duplicates.
# update(creinig): precision reduction is now done in data2ps and comments
# (except for % bound) now are also ommitted from the start
echo 'image.ps: image-unop.ps'
#echo ' grep -v "^%" < $< | sed -e "s/\.\([0-9][0-9]\)[0-9]\+/.\1/g" -e "s/\(^\| \|-\)\([0-9][0-9][0-9]\)[0-9][0-9]\.[0-9][0-9]/\1\200/g" -e "s/\(^\| \|-\)\([0-9][0-9][0-9]\)[0-9]\.[0-9][0-9]/\1\20/g" -e "s/\(^\| \|-\)\([0-9][0-9][0-9]\)\.[0-9][0-9]/\1\2/g" -e "s/\(^\| \|-\)\([0-9][0-9]\)\.\([0-9]\)[0-9]/\1\2.\30/g" | awk "\$$0 ~ /lineto/ { if ( LASTLINE == \$$0 ) next; } { LASTLINE=\$$0; print; }" > $@'
echo ' grep -v "^% bound" < $< > $@'
# Need last comment (bounding box)
echo ' tail -1 $< >> $@'
echo ' ls -l image.ps image-unop.ps'
echo 'image-unop.ps: outline.ps ring1.ps ring2.ps ring3.ps ring4.ps'
echo ' cat ring[1234].ps > $@'
# Bounding box is at bottom now. Next two won't change it.
echo ' tail -1 $@ > bounding-box'
echo ' cat outline.ps >> $@'
echo ' cat ../tux.ps >> $@'
echo ' cat bounding-box >> $@ && rm bounding-box'
# Finished rings are precious!
echo .SECONDARY: ring1.ps ring2.ps ring3.ps ring4.ps
# Rings 1 and 4 are all thrown together.
echo RING1_DEPS:=`find $RING1 -name '*.c.*' | sed 's/\.c.*/-all.ps/' | sort | uniq`
echo RING4_DEPS:=`find $RING4 -name '*.c.*' | sed 's/\.c.*/-all.ps/' | sort | uniq`
# Other rings are divided into dirs.
echo RING2_DEPS:=`for d in $RING2; do echo $d-ring2.ps; done`
echo RING3_DEPS:=`for d in $RING3; do echo $d-ring3.ps; done`
echo
# First ring starts at inner radius.
echo 'ring1.ps: $(RING1_DEPS)'
echo " @echo Making Ring 1"
echo " @echo /angle 0 def > \$@"
echo " @../draw_arrangement $FILE_SCRUNCH 0 360 $INNER_RADIUS \$(RING1_DEPS) >> \$@"
echo " @echo Done Ring 1"
# Second ring starts at end of above ring (assume it's circular, so
# grab any bound).
echo 'ring2.ps: ring1.ps $(RING2_DEPS)'
echo " @echo Making Ring 2"
echo " @echo /angle 0 def > \$@"
echo " @../rotary_arrange.sh $DIR_SPACING" `for f in $RING2; do echo $f-ring2.ps $f-ring2.angle; done` '>> $@'
echo " @echo Done Ring 2"
# Third ring starts at end of second ring.
echo 'ring3.ps: ring2.ps $(RING3_DEPS)'
echo " @echo Making Ring 3"
echo " @echo /angle 0 def > \$@"
echo " @../rotary_arrange.sh $DIR_SPACING" `for f in $RING3; do echo $f-ring3.ps $f-ring3.angle; done` '>> $@'
echo " @echo Done Ring 3"
# Outer ring starts at end of fourth ring.
# And it's just a big ring of drivers.
echo 'ring4.ps: $(RING4_DEPS) ring3.radius'
echo " @echo Making Ring 4"
echo " @echo /angle 0 def > \$@"
echo " @../draw_arrangement $FILE_SCRUNCH 0 360 \`cat ring3.radius\` \$(RING4_DEPS) >> \$@"
echo " @echo Done Ring 4"
echo
# How to make directory picture: angle file contains start and end angle.
# Second ring starts at end of above ring (assume it's circular, so
# grab any bound).
echo "%-ring2.ps: %-ring2.angle ring1.radius"
echo " @echo Rendering \$@"
echo " @../draw_arrangement $FILE_SCRUNCH 0 \`cat \$<\` \`cat ring1.radius\` \`find \$* -name '*-all.ps'\` > \$@"
echo "%-ring3.ps: %-ring3.angle ring2.radius"
echo " @echo Rendering \$@"
echo " @../draw_arrangement $FILE_SCRUNCH 0 \`cat \$<\` \`cat ring2.radius\` \`find \$* -name '*-all.ps'\` > \$@"
# How to extract radii
echo "%.radius: %.ps"
echo ' @echo scale=2\; `tail -1 $< | sed "s/^.* //"` + '$RING_SPACING' | bc > $@'
echo
# How to make angle. Need total angle for that directory, and weight.
echo "%-ring2.angle: %-ring2.weight ring2.weight"
echo ' @echo "scale=2; ( 360 - ' `echo $RING2 | wc -w` ' * ' $DIR_SPACING ') * `cat $<` / `cat ring2.weight`" | bc > $@'
echo "%-ring3.angle: %-ring3.weight ring3.weight"
echo ' @echo "scale=2; ( 360 - ' `echo $RING3 | wc -w` ' * ' $DIR_SPACING ') * `cat $<` / `cat ring3.weight`" | bc > $@'
# How to make ring weights (sum directory totals).
echo "ring2.weight:" `for d in $RING2; do echo $d-ring2.weight; done`
echo ' @cat $^ | ../tally > $@'
echo "ring3.weight:" `for d in $RING3; do echo $d-ring3.weight; done`
echo ' @cat $^ | ../tally > $@'
# How to make a wieght.
echo "%-ring2.weight:" `find $RING2 -name '*.c.*' | sed 's/\.c.*/-all.ps/' | sort | uniq`
echo ' @../total_area.pl `find $* -name \*-all.ps` > $@'
echo "%-ring3.weight:" `find $RING3 -name '*.c.*' | sed 's/\.c.*/-all.ps/' | sort | uniq`
echo ' @../total_area.pl `find $* -name \*-all.ps` > $@'
echo
# Now rule to make the graphs of a function.
#echo %.ps::%
#echo ' @../function2ps `echo $< | sed '\''s/^.*\.\([^.]*\)\.\+.*$$/\1/'\''` > $@ $<'
## Need the space.
##echo ' @rm -f $<'
#echo
# Rule to make all from constituent parts.
echo %-all.ps:
echo " @echo Rendering \$*.c"
echo " @../conglomerate_functions.pl $FUNCTION_SCRUNCH $BOX_SCRUNCH \$^ > \$@"
# Need the space.
#echo ' @rm -f $^'
echo
# Generating outline, requires all the angles.
echo outline.ps: ../make-outline.sh ring1.ps ring2.ps ring3.ps ring4.ps `for f in $RING2; do echo $f-ring2.angle; done` `for f in $RING3; do echo $f-ring3.angle; done`
echo " ../make-outline.sh $INNER_RADIUS $DIR_SPACING $RING_SPACING \"$RING1\" > \$@"
echo
# Now all the rules to make each function.
for d in `find . -type d`; do
for f in `cd $d; ls *+.ps 2>/dev/null | sed 's/\.c\..*$//' | uniq`; do
echo $d/$f-all.ps: `cd $d; ls $f.c.* | sed -e "s?^?$d/?"`
done
done

File diff suppressed because it is too large Load Diff

View File

@ -1,312 +0,0 @@
#!/usr/bin/perl
#
# Copyright (c) International Business Machines Corp., 2002
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#
# posterize.pl
#
# This script generates a postscript file from output generated from the
# fcgp http://sourceforge.net/projects/fcgp/ for plotting
#
#
# History:
# 2003-09-04 wrote - James M Kenefick Jr. <jkenefic@us.ibm.com>
#
# a good deal of this could be turned in to cli
# arguments.
# Constants
my $Title = "Linux Kernel Coverage";
my $KernelVersion = "2.5.73";
my $TestDescription = "A Sample Print";
my $Image = "../lgp/image.ps";
# Variables
my $Bounds = "";
# Paper sizes in inches
my $PAPER_WIDTH = 34;
my $PAPER_HEIGHT = 42;
# points per inch
my $ppi = 72;
# Margins
my $TopMargin = 1;
my $BottomMargin = 1.5;
my $LeftMargin = 1;
my $RightMargin = 1;
$RightMargin = $PAPER_WIDTH - $RightMargin;
$TopMargin = $PAPER_HEIGHT - $TopMargin;
my $filename = "poster.ps";
# Sizes in ppi
my $PPI_WIDTH = ($PAPER_WIDTH * $ppi);
my $PPI_HEIGHT = ($PAPER_HEIGHT * $ppi);
# Date we create poster
my $date = `date`;
print STDERR "Creating Poster\n";
open POSTER, ">$filename";
print(POSTER <<END_OF_USAGE);
%!PS-Adobe-1.0
%%DocumentFonts: Helvetica Helvetica-Bold
%%Title: Linux 2.4.0 Kernel Poster
%%Creator: Rusty's scripts and postersize (GPL)
%%CreationDate: $date
%%Pages: 1
%%BoundingBox: 0 0 $PPI_WIDTH $PPI_HEIGHT
%%EndComments
%!
/PRorig_showpage_x178313 /showpage load def /showpage{
errordict /handleerror {} put
}def
/initgraphics{}def/setpagedevice{pop}def
statusdict begin /a4tray{}def /lettertray{}def end
/a4{}def/a3{}def/a0{}def/letter{}def/legal{}def
/a4small{}def /lettersmall{}def /a4tray{}def /lettertray{}def
/setscreen{pop pop pop}def
/ColorManagement {pop} def
/A {gsave newpath 0 360 arc stroke grestore} bind def
/M {moveto} bind def
/L {lineto} bind def
/D {[] 0 setdash} bind def
/D5 {[5] 0 setdash} bind def
/C0 {0 0 0 setrgbcolor} bind def
/C1 {.8 .4 .4 setrgbcolor} bind def
/C2 {.5 1 .5 setrgbcolor} bind def
/C3 {0 .7 0 setrgbcolor} bind def
/C4 {1 0 0 setrgbcolor} bind def
/C5 {0 0 1 setrgbcolor} bind def
/R {grestore} bind def
/S {0 0 M stroke} bind def
/T {gsave translate} bind def
/U {C0 newpath 4 copy 4 2 roll 8 7 roll M L L L closepath stroke
C1 findfont exch scalefont setfont M show} bind def
% Added James M Kenefick Jr.
/Hi_Color {0 0 1} def
/Med_Color {0 .60 1} def
/Lo_Color {0 1 1} def
/None_Color {.75 .75 .75} def
/Hi {newpath 4 copy 4 2 roll 8 7 roll M L L L Hi_Color setrgbcolor fill closepath} bind def
/Med {newpath 4 copy 4 2 roll 8 7 roll M L L L Med_Color setrgbcolor fill closepath} bind def
/Lo {newpath 4 copy 4 2 roll 8 7 roll M L L L Lo_Color setrgbcolor fill closepath} bind def
/None {newpath 4 copy 4 2 roll 8 7 roll M L L L None_Color setrgbcolor fill closepath} bind def
/inch
{
72 mul
}
def
/LeftMargin $LeftMargin inch def
/RightMargin $RightMargin inch def
/TopMargin $TopMargin inch def
/BottomMargin $BottomMargin inch def
/FontScale 25 def
/AuthorFontScale 70 def
/centerText
{
dup
stringwidth pop
2 div
RightMargin LeftMargin sub 2 div
exch sub
LeftMargin add
NextLine moveto
show
}
def
/upLine
{
/NextLine
NextLine LineSpace2 add
def
}
def
/advanceLine
{
/NextLine
NextLine LineSpace sub
def
}
def
/fontScale
{
TopMargin BottomMargin sub FontScale div
}
def
/authorfontScale
{
TopMargin BottomMargin sub AuthorFontScale div
}
def
/rightJustify
{
dup
stringwidth pop
RightMargin 1 inch sub
exch sub
NextLine moveto
show
}
def
/usableY
{
TopMargin LineSpace 3 mul sub BottomMargin sub
}
def
/usableX
{
RightMargin LeftMargin sub
}
def
gsave
/Times-Roman findfont fontScale scalefont setfont
/LineSpace fontScale def
/NextLine (B) stringwidth pop TopMargin exch sub def
%%EndProlog
%%Page 1
% title
($Title) centerText advanceLine
(Kernel: $KernelVersion) centerText advanceLine
($TestDescription) centerText
% Author Block
LeftMargin BottomMargin translate
/Times-Roman findfont authorfontScale scalefont setfont
/LineSpace2 authorfontScale def
/NextLine 0 def
(Based on work by Rusty Russell, Christian Reiniger) rightJustify
upLine
(By James M. Kenefick Jr.) rightJustify
grestore
LeftMargin BottomMargin translate
% Key Block
15 15 scale
% This is the key for the graph.
/box { newpath moveto 0 1 rlineto 2 0 rlineto 0 -1 rlineto closepath } def
/key { setrgbcolor 2 copy box gsave fill grestore 0 0 0 setrgbcolor strokepath fill moveto 2.4 0.25 rmoveto show } def
/Helvetica-Oblique findfont
1 scalefont setfont
0.1 setlinewidth
(static functions) 1 5 0.5 1 0.5 key % Light green.
(indirectly called functions) 1 7 0 0.7 0 key % green
(exported functions) 1 9 1 0 0 key % red
(other functions) 1 11 0 0 1 key % blue
(Low Coverage) 1 15 Lo_Color key % blue
(Medium Coverage) 1 17 Med_Color key % blue
(Hi Coverage) 1 19 Hi_Color key % blue
(No Coverage) 1 21 None_Color key % blue
1 3.25 moveto
0.8 0.4 0.4 setrgbcolor
/Helvetica findfont
1 scalefont setfont
(xxx) show
1 3 moveto
2.4 0.25 rmoveto
0 0 0 setrgbcolor
/Helvetica-Oblique findfont
1 scalefont setfont
(function name) show
1 1.25 moveto
0.8 0.4 0.4 setrgbcolor
/Helvetica-Bold findfont
1 scalefont setfont
(xxx) show
1 1 moveto
2.4 0.25 rmoveto
0 0 0 setrgbcolor
/Helvetica-Oblique findfont
1 scalefont setfont
(source filename) show
6 24 moveto
/Helvetica-Bold findfont
2 scalefont setfont
(Key) show
% Box around it
newpath
0.2 0.2 moveto
0.2 27 lineto
17 27 lineto
17 0.2 lineto
closepath
strokepath fill
1 15 div 1 15 div scale
% find and move to center
END_OF_USAGE
# Find the bounds for the image
$Bounds = `tail -1 $Image`;
($Junk, $Junk, $minX, $minY, $maxX, $maxY) = split / /, $Bounds;
my $xRange = $maxX - $minX;
my $yRange = $maxY - $minY;
if ($xRange < $yRange){
$Range = $xRange;
} else {
$Range = $yRange;
}
print POSTER " 0 usableY usableX sub 2 div translate\n";
print POSTER "usableX $Range div usableX $Range div scale\n";
print POSTER "$Range 2 div $Range 2 div translate\n";
print POSTER "gsave\n";
# Paste in actual image.
print POSTER `cat /home/lgp/image.ps`;
print POSTER "%%Trailer\n";
print POSTER "grestore\n";
print POSTER "showpage\n";
print POSTER "PRorig_showpage_x178313\n";
print POSTER "/showpage /PRorig_showpage_x178313 load def\n";

File diff suppressed because it is too large Load Diff

View File

@ -1,98 +0,0 @@
#
# Makefile for the LCOV example program.
#
# Make targets:
# - example: compile the example program
# - output: run test cases on example program and create HTML output
# - clean: clean up directory
#
CC := gcc
CFLAGS := -Wall -I. -fprofile-arcs -ftest-coverage
LCOV := ../bin/lcov
GENHTML := ../bin/genhtml
GENDESC := ../bin/gendesc
GENPNG := ../bin/genpng
# Depending on the presence of the GD.pm perl module, we can use the
# special option '--frames' for genhtml
USE_GENPNG := $(shell $(GENPNG) --help >/dev/null 2>/dev/null; echo $$?)
ifeq ($(USE_GENPNG),0)
FRAMES := --frames
else
FRAMES :=
endif
.PHONY: clean output test_noargs test_2_to_2000 test_overflow
all: output
example: example.o iterate.o gauss.o
$(CC) example.o iterate.o gauss.o -o example -lgcov
example.o: example.c iterate.h gauss.h
$(CC) $(CFLAGS) -c example.c -o example.o
iterate.o: methods/iterate.c iterate.h
$(CC) $(CFLAGS) -c methods/iterate.c -o iterate.o
gauss.o: methods/gauss.c gauss.h
$(CC) $(CFLAGS) -c methods/gauss.c -o gauss.o
output: example descriptions test_noargs test_2_to_2000 test_overflow
@echo
@echo '*'
@echo '* Generating HTML output'
@echo '*'
@echo
$(GENHTML) trace_noargs.info trace_args.info trace_overflow.info \
--output-directory output --title "Basic example" \
--show-details --description-file descriptions $(FRAMES) \
--legend
@echo
@echo '*'
@echo '* See '`pwd`/output/index.html
@echo '*'
@echo
descriptions: descriptions.txt
$(GENDESC) descriptions.txt -o descriptions
all_tests: example test_noargs test_2_to_2000 test_overflow
test_noargs:
@echo
@echo '*'
@echo '* Test case 1: running ./example without parameters'
@echo '*'
@echo
$(LCOV) --zerocounters --directory .
./example
$(LCOV) --capture --directory . --output-file trace_noargs.info --test-name test_noargs --no-external
test_2_to_2000:
@echo
@echo '*'
@echo '* Test case 2: running ./example 2 2000'
@echo '*'
@echo
$(LCOV) --zerocounters --directory .
./example 2 2000
$(LCOV) --capture --directory . --output-file trace_args.info --test-name test_2_to_2000 --no-external
test_overflow:
@echo
@echo '*'
@echo '* Test case 3: running ./example 0 100000 (causes an overflow)'
@echo '*'
@echo
$(LCOV) --zerocounters --directory .
./example 0 100000 || true
$(LCOV) --capture --directory . --output-file trace_overflow.info --test-name "test_overflow" --no-external
clean:
rm -rf *.o *.bb *.bbg *.da *.gcno *.gcda *.info output example \
descriptions

View File

@ -1,6 +0,0 @@
To get an example of how the LCOV generated HTML output looks like,
type 'make output' and point a web browser to the resulting file
output/index.html

View File

@ -1,10 +0,0 @@
test_noargs
Example program is called without arguments so that default range
[0..9] is used.
test_2_to_2000
Example program is called with "2" and "2000" as arguments.
test_overflow
Example program is called with "0" and "100000" as arguments. The
resulting sum is too large to be stored as an int variable.

View File

@ -1,60 +0,0 @@
/*
* example.c
*
* Calculate the sum of a given range of integer numbers. The range is
* specified by providing two integer numbers as command line argument.
* If no arguments are specified, assume the predefined range [0..9].
* Abort with an error message if the resulting number is too big to be
* stored as int variable.
*
* This program example is similar to the one found in the GCOV documentation.
* It is used to demonstrate the HTML output generated by LCOV.
*
* The program is split into 3 modules to better demonstrate the 'directory
* overview' function. There are also a lot of bloated comments inserted to
* artificially increase the source code size so that the 'source code
* overview' function makes at least a minimum of sense.
*
*/
#include <stdio.h>
#include <stdlib.h>
#include "iterate.h"
#include "gauss.h"
static int start = 0;
static int end = 9;
int main (int argc, char* argv[])
{
int total1, total2;
/* Accept a pair of numbers as command line arguments. */
if (argc == 3)
{
start = atoi(argv[1]);
end = atoi(argv[2]);
}
/* Use both methods to calculate the result. */
total1 = iterate_get_sum (start, end);
total2 = gauss_get_sum (start, end);
/* Make sure both results are the same. */
if (total1 != total2)
{
printf ("Failure (%d != %d)!\n", total1, total2);
}
else
{
printf ("Success, sum[%d..%d] = %d\n", start, end, total1);
}
return 0;
}

View File

@ -1,6 +0,0 @@
#ifndef GAUSS_H
#define GAUSS_H GAUSS_h
extern int gauss_get_sum (int min, int max);
#endif /* GAUSS_H */

View File

@ -1,6 +0,0 @@
#ifndef ITERATE_H
#define ITERATE_H ITERATE_H
extern int iterate_get_sum (int min, int max);
#endif /* ITERATE_H */

View File

@ -1,48 +0,0 @@
/*
* methods/gauss.c
*
* Calculate the sum of a given range of integer numbers.
*
* Somewhat of a more subtle way of calculation - and it even has a story
* behind it:
*
* Supposedly during math classes in elementary school, the teacher of
* young mathematician Gauss gave the class an assignment to calculate the
* sum of all natural numbers between 1 and 100, hoping that this task would
* keep the kids occupied for some time. The story goes that Gauss had the
* result ready after only a few minutes. What he had written on his black
* board was something like this:
*
* 1 + 100 = 101
* 2 + 99 = 101
* 3 + 98 = 101
* .
* .
* 100 + 1 = 101
*
* s = (1/2) * 100 * 101 = 5050
*
* A more general form of this formula would be
*
* s = (1/2) * (max + min) * (max - min + 1)
*
* which is used in the piece of code below to implement the requested
* function in constant time, i.e. without dependencies on the size of the
* input parameters.
*
*/
#include "gauss.h"
int gauss_get_sum (int min, int max)
{
/* This algorithm doesn't work well with invalid range specifications
so we're intercepting them here. */
if (max < min)
{
return 0;
}
return (int) ((max + min) * (double) (max - min + 1) / 2);
}

View File

@ -1,45 +0,0 @@
/*
* methods/iterate.c
*
* Calculate the sum of a given range of integer numbers.
*
* This particular method of implementation works by way of brute force,
* i.e. it iterates over the entire range while adding the numbers to finally
* get the total sum. As a positive side effect, we're able to easily detect
* overflows, i.e. situations in which the sum would exceed the capacity
* of an integer variable.
*
*/
#include <stdio.h>
#include <stdlib.h>
#include "iterate.h"
int iterate_get_sum (int min, int max)
{
int i, total;
total = 0;
/* This is where we loop over each number in the range, including
both the minimum and the maximum number. */
for (i = min; i <= max; i++)
{
/* We can detect an overflow by checking whether the new
sum would become negative. */
if (total + i < total)
{
printf ("Error: sum too large!\n");
exit (1);
}
/* Everything seems to fit into an int, so continue adding. */
total += i;
}
return total;
}

View File

@ -1,157 +0,0 @@
#
# /etc/lcovrc - system-wide defaults for LCOV
#
# To change settings for a single user, place a customized copy of this file
# at location ~/.lcovrc
#
# Specify an external style sheet file (same as --css-file option of genhtml)
#genhtml_css_file = gcov.css
# Specify coverage rate limits (in %) for classifying file entries
# HI: hi_limit <= rate <= 100 graph color: green
# MED: med_limit <= rate < hi_limit graph color: orange
# LO: 0 <= rate < med_limit graph color: red
genhtml_hi_limit = 90
genhtml_med_limit = 75
# Width of line coverage field in source code view
genhtml_line_field_width = 12
# Width of branch coverage field in source code view
genhtml_branch_field_width = 16
# Width of overview image (used by --frames option of genhtml)
genhtml_overview_width = 80
# Resolution of overview navigation: this number specifies the maximum
# difference in lines between the position a user selected from the overview
# and the position the source code window is scrolled to (used by --frames
# option of genhtml)
genhtml_nav_resolution = 4
# Clicking a line in the overview image should show the source code view at
# a position a bit further up so that the requested line is not the first
# line in the window. This number specifies that offset in lines (used by
# --frames option of genhtml)
genhtml_nav_offset = 10
# Do not remove unused test descriptions if non-zero (same as
# --keep-descriptions option of genhtml)
genhtml_keep_descriptions = 0
# Do not remove prefix from directory names if non-zero (same as --no-prefix
# option of genhtml)
genhtml_no_prefix = 0
# Do not create source code view if non-zero (same as --no-source option of
# genhtml)
genhtml_no_source = 0
# Replace tabs with number of spaces in source view (same as --num-spaces
# option of genhtml)
genhtml_num_spaces = 8
# Highlight lines with converted-only data if non-zero (same as --highlight
# option of genhtml)
genhtml_highlight = 0
# Include color legend in HTML output if non-zero (same as --legend option of
# genhtml)
genhtml_legend = 0
# Use FILE as HTML prolog for generated pages (same as --html-prolog option of
# genhtml)
#genhtml_html_prolog = FILE
# Use FILE as HTML epilog for generated pages (same as --html-epilog option of
# genhtml)
#genhtml_html_epilog = FILE
# Use custom filename extension for pages (same as --html-extension option of
# genhtml)
#genhtml_html_extension = html
# Compress all generated html files with gzip.
#genhtml_html_gzip = 1
# Include sorted overview pages (can be disabled by the --no-sort option of
# genhtml)
genhtml_sort = 1
# Include function coverage data display (can be disabled by the
# --no-func-coverage option of genhtml)
#genhtml_function_coverage = 1
# Include branch coverage data display (can be disabled by the
# --no-branch-coverage option of genhtml)
#genhtml_branch_coverage = 1
# Specify the character set of all generated HTML pages
genhtml_charset=UTF-8
# Location of the gcov tool (same as --gcov-info option of geninfo)
#geninfo_gcov_tool = gcov
# Adjust test names to include operating system information if non-zero
#geninfo_adjust_testname = 0
# Calculate checksum for each source code line if non-zero (same as --checksum
# option of geninfo if non-zero, same as --no-checksum if zero)
#geninfo_checksum = 1
# Specify whether to capture coverage data for external source files (can
# be overridden by the --external and --no-external options of geninfo/lcov)
#geninfo_external = 1
# Enable libtool compatibility mode if non-zero (same as --compat-libtool option
# of geninfo if non-zero, same as --no-compat-libtool if zero)
#geninfo_compat_libtool = 0
# Use gcov's --all-blocks option if non-zero
#geninfo_gcov_all_blocks = 1
# Specify compatiblity modes (same as --compat option of geninfo).
#geninfo_compat = libtool=on, hammer=auto, split_crc=auto
# Adjust path to source files by removing or changing path components that
# match the specified pattern (Perl regular expression format)
#geninfo_adjust_src_path = /tmp/build => /usr/src
# Specify if geninfo should try to automatically determine the base-directory
# when collecting coverage data.
geninfo_auto_base = 1
# Directory containing gcov kernel files
# lcov_gcov_dir = /proc/gcov
# Location of the insmod tool
lcov_insmod_tool = /sbin/insmod
# Location of the modprobe tool
lcov_modprobe_tool = /sbin/modprobe
# Location of the rmmod tool
lcov_rmmod_tool = /sbin/rmmod
# Location for temporary directories
lcov_tmp_dir = /tmp
# Show full paths during list operation if non-zero (same as --list-full-path
# option of lcov)
lcov_list_full_path = 0
# Specify the maximum width for list output. This value is ignored when
# lcov_list_full_path is non-zero.
lcov_list_width = 80
# Specify the maximum percentage of file names which may be truncated when
# choosing a directory prefix in list output. This value is ignored when
# lcov_list_full_path is non-zero.
lcov_list_truncate_max = 20
# Specify if function coverage data should be collected and processed.
lcov_function_coverage = 1
# Specify if branch coverage data should be collected and processed.
lcov_branch_coverage = 0

View File

@ -1,78 +0,0 @@
.TH gendesc 1 "LCOV 1.10" 2012\-10\-10 "User Manuals"
.SH NAME
gendesc \- Generate a test case description file
.SH SYNOPSIS
.B gendesc
.RB [ \-h | \-\-help ]
.RB [ \-v | \-\-version ]
.RS 8
.br
.RB [ \-o | \-\-output\-filename
.IR filename ]
.br
.I inputfile
.SH DESCRIPTION
Convert plain text test case descriptions into a format as understood by
.BR genhtml .
.I inputfile
needs to observe the following format:
For each test case:
.IP " \-"
one line containing the test case name beginning at the start of the line
.RE
.IP " \-"
one or more lines containing the test case description indented with at
least one whitespace character (tab or space)
.RE
.B Example input file:
test01
.RS
An example test case description.
.br
Description continued
.RE
test42
.RS
Supposedly the answer to most of your questions
.RE
Note: valid test names can consist of letters, decimal digits and the
underscore character ('_').
.SH OPTIONS
.B \-h
.br
.B \-\-help
.RS
Print a short help text, then exit.
.RE
.B \-v
.br
.B \-\-version
.RS
Print version number, then exit.
.RE
.BI "\-o " filename
.br
.BI "\-\-output\-filename " filename
.RS
Write description data to
.IR filename .
By default, output is written to STDOUT.
.RE
.SH AUTHOR
Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>
.SH SEE ALSO
.BR lcov (1),
.BR genhtml (1),
.BR geninfo (1),
.BR genpng (1),
.BR gcov (1)

View File

@ -1,569 +0,0 @@
.TH genhtml 1 "LCOV 1.10" 2012\-10\-10 "User Manuals"
.SH NAME
genhtml \- Generate HTML view from LCOV coverage data files
.SH SYNOPSIS
.B genhtml
.RB [ \-h | \-\-help ]
.RB [ \-v | \-\-version ]
.RS 8
.br
.RB [ \-q | \-\-quiet ]
.RB [ \-s | \-\-show\-details ]
.RB [ \-f | \-\-frames ]
.br
.RB [ \-b | \-\-baseline\-file ]
.IR baseline\-file
.br
.RB [ \-o | \-\-output\-directory
.IR output\-directory ]
.br
.RB [ \-t | \-\-title
.IR title ]
.br
.RB [ \-d | \-\-description\-file
.IR description\-file ]
.br
.RB [ \-k | \-\-keep\-descriptions ]
.RB [ \-c | \-\-css\-file
.IR css\-file ]
.br
.RB [ \-p | \-\-prefix
.IR prefix ]
.RB [ \-\-no\-prefix ]
.br
.RB [ \-\-no\-source ]
.RB [ \-\-num\-spaces
.IR num ]
.RB [ \-\-highlight ]
.br
.RB [ \-\-legend ]
.RB [ \-\-html\-prolog
.IR prolog\-file ]
.br
.RB [ \-\-html\-epilog
.IR epilog\-file ]
.RB [ \-\-html\-extension
.IR extension ]
.br
.RB [ \-\-html\-gzip ]
.RB [ \-\-sort ]
.RB [ \-\-no\-sort ]
.br
.RB [ \-\-function\-coverage ]
.RB [ \-\-no\-function\-coverage ]
.br
.RB [ \-\-branch\-coverage ]
.RB [ \-\-no\-branch\-coverage ]
.br
.RB [ \-\-demangle\-cpp ]
.RB [ \-\-ignore\-errors
.IR errors ]
.br
.RB [ \-\-config\-file
.IR config\-file ]
.RB [ \-\-rc
.IR keyword = value ]
.br
.IR tracefile(s)
.RE
.SH DESCRIPTION
Create an HTML view of coverage data found in
.IR tracefile .
Note that
.I tracefile
may also be a list of filenames.
HTML output files are created in the current working directory unless the
\-\-output\-directory option is used. If
.I tracefile
ends with ".gz", it is assumed to be GZIP\-compressed and the gunzip tool
will be used to decompress it transparently.
Note that all source code files have to be present and readable at the
exact file system location they were compiled.
Use option
.I \--css\-file
to modify layout and colors of the generated HTML output. Files are
marked in different colors depending on the associated coverage rate. By
default, the coverage limits for low, medium and high coverage are set to
0\-75%, 75\-90% and 90\-100% percent respectively. To change these
values, use configuration file options
.IR genhtml_hi_limit " and " genhtml_med_limit .
Also note that when displaying percentages, 0% and 100% are only printed when
the values are exactly 0% and 100% respectively. Other values which would
conventionally be rounded to 0% or 100% are instead printed as nearest
non-boundary value. This behavior is in accordance with that of the
.BR gcov (1)
tool.
.SH OPTIONS
.B \-h
.br
.B \-\-help
.RS
Print a short help text, then exit.
.RE
.B \-v
.br
.B \-\-version
.RS
Print version number, then exit.
.RE
.B \-q
.br
.B \-\-quiet
.RS
Do not print progress messages.
Suppresses all informational progress output. When this switch is enabled,
only error or warning messages are printed.
.RE
.B \-f
.br
.B \-\-frames
.RS
Use HTML frames for source code view.
If enabled, a frameset is created for each source code file, providing
an overview of the source code as a "clickable" image. Note that this
option will slow down output creation noticeably because each source
code character has to be inspected once. Note also that the GD.pm Perl
module has to be installed for this option to work (it may be obtained
from http://www.cpan.org).
.RE
.B \-s
.br
.B \-\-show\-details
.RS
Generate detailed directory view.
When this option is enabled,
.B genhtml
generates two versions of each
file view. One containing the standard information plus a link to a
"detailed" version. The latter additionally contains information about
which test case covered how many lines of each source file.
.RE
.BI "\-b " baseline\-file
.br
.BI "\-\-baseline\-file " baseline\-file
.RS
Use data in
.I baseline\-file
as coverage baseline.
The tracefile specified by
.I baseline\-file
is read and all counts found in the original
.I tracefile
are decremented by the corresponding counts in
.I baseline\-file
before creating any output.
Note that when a count for a particular line in
.I baseline\-file
is greater than the count in the
.IR tracefile ,
the result is zero.
.RE
.BI "\-o " output\-directory
.br
.BI "\-\-output\-directory " output\-directory
.RS
Create files in
.I output\-directory.
Use this option to tell
.B genhtml
to write the resulting files to a directory other than
the current one. If
.I output\-directory
does not exist, it will be created.
It is advisable to use this option since depending on the
project size, a lot of files and subdirectories may be created.
.RE
.BI "\-t " title
.br
.BI "\-\-title " title
.RS
Display
.I title
in header of all pages.
.I title
is written to the header portion of each generated HTML page to
identify the context in which a particular output
was created. By default this is the name of the tracefile.
.RE
.BI "\-d " description\-file
.br
.BI "\-\-description\-file " description\-file
.RS
Read test case descriptions from
.IR description\-file .
All test case descriptions found in
.I description\-file
and referenced in the input data file are read and written to an extra page
which is then incorporated into the HTML output.
The file format of
.IR "description\-file " is:
for each test case:
.RS
TN:<testname>
.br
TD:<test description>
.RE
Valid test case names can consist of letters, numbers and the underscore
character ('_').
.RE
.B \-k
.br
.B \-\-keep\-descriptions
.RS
Do not remove unused test descriptions.
Keep descriptions found in the description file even if the coverage data
indicates that the associated test case did not cover any lines of code.
This option can also be configured permanently using the configuration file
option
.IR genhtml_keep_descriptions .
.RE
.BI "\-c " css\-file
.br
.BI "\-\-css\-file " css\-file
.RS
Use external style sheet file
.IR css\-file .
Using this option, an extra .css file may be specified which will replace
the default one. This may be helpful if the default colors make your eyes want
to jump out of their sockets :)
This option can also be configured permanently using the configuration file
option
.IR genhtml_css_file .
.RE
.BI "\-p " prefix
.br
.BI "\-\-prefix " prefix
.RS
Remove
.I prefix
from all directory names.
Because lists containing long filenames are difficult to read, there is a
mechanism implemented that will automatically try to shorten all directory
names on the overview page beginning with a common prefix. By default,
this is done using an algorithm that tries to find the prefix which, when
applied, will minimize the resulting sum of characters of all directory
names.
Use this option to specify the prefix to be removed by yourself.
.RE
.B \-\-no\-prefix
.RS
Do not remove prefix from directory names.
This switch will completely disable the prefix mechanism described in the
previous section.
This option can also be configured permanently using the configuration file
option
.IR genhtml_no_prefix .
.RE
.B \-\-no\-source
.RS
Do not create source code view.
Use this switch if you don't want to get a source code view for each file.
This option can also be configured permanently using the configuration file
option
.IR genhtml_no_source .
.RE
.BI "\-\-num\-spaces " spaces
.RS
Replace tabs in source view with
.I num
spaces.
Default value is 8.
This option can also be configured permanently using the configuration file
option
.IR genhtml_num_spaces .
.RE
.B \-\-highlight
.RS
Highlight lines with converted\-only coverage data.
Use this option in conjunction with the \-\-diff option of
.B lcov
to highlight those lines which were only covered in data sets which were
converted from previous source code versions.
This option can also be configured permanently using the configuration file
option
.IR genhtml_highlight .
.RE
.B \-\-legend
.RS
Include color legend in HTML output.
Use this option to include a legend explaining the meaning of color coding
in the resulting HTML output.
This option can also be configured permanently using the configuration file
option
.IR genhtml_legend .
.RE
.BI "\-\-html\-prolog " prolog\-file
.RS
Read customized HTML prolog from
.IR prolog\-file .
Use this option to replace the default HTML prolog (the initial part of the
HTML source code leading up to and including the <body> tag) with the contents
of
.IR prolog\-file .
Within the prolog text, the following words will be replaced when a page is generated:
.B "@pagetitle@"
.br
The title of the page.
.B "@basedir@"
.br
A relative path leading to the base directory (e.g. for locating css\-files).
This option can also be configured permanently using the configuration file
option
.IR genhtml_html_prolog .
.RE
.BI "\-\-html\-epilog " epilog\-file
.RS
Read customized HTML epilog from
.IR epilog\-file .
Use this option to replace the default HTML epilog (the final part of the HTML
source including </body>) with the contents of
.IR epilog\-file .
Within the epilog text, the following words will be replaced when a page is generated:
.B "@basedir@"
.br
A relative path leading to the base directory (e.g. for locating css\-files).
This option can also be configured permanently using the configuration file
option
.IR genhtml_html_epilog .
.RE
.BI "\-\-html\-extension " extension
.RS
Use customized filename extension for generated HTML pages.
This option is useful in situations where different filename extensions
are required to render the resulting pages correctly (e.g. php). Note that
a '.' will be inserted between the filename and the extension specified by
this option.
This option can also be configured permanently using the configuration file
option
.IR genhtml_html_extension .
.RE
.B \-\-html\-gzip
.RS
Compress all generated html files with gzip and add a .htaccess file specifying
gzip\-encoding in the root output directory.
Use this option if you want to save space on your webserver. Requires a
webserver with .htaccess support and a browser with support for gzip
compressed html.
This option can also be configured permanently using the configuration file
option
.IR genhtml_html_gzip .
.RE
.B \-\-sort
.br
.B \-\-no\-sort
.RS
Specify whether to include sorted views of file and directory overviews.
Use \-\-sort to include sorted views or \-\-no\-sort to not include them.
Sorted views are
.B enabled
by default.
When sorted views are enabled, each overview page will contain links to
views of that page sorted by coverage rate.
This option can also be configured permanently using the configuration file
option
.IR genhtml_sort .
.RE
.B \-\-function\-coverage
.br
.B \-\-no\-function\-coverage
.RS
Specify whether to display function coverage summaries in HTML output.
Use \-\-function\-coverage to enable function coverage summaries or
\-\-no\-function\-coverage to disable it. Function coverage summaries are
.B enabled
by default
When function coverage summaries are enabled, each overview page will contain
the number of functions found and hit per file or directory, together with
the resulting coverage rate. In addition, each source code view will contain
a link to a page which lists all functions found in that file plus the
respective call count for those functions.
This option can also be configured permanently using the configuration file
option
.IR genhtml_function_coverage .
.RE
.B \-\-branch\-coverage
.br
.B \-\-no\-branch\-coverage
.RS
Specify whether to display branch coverage data in HTML output.
Use \-\-branch\-coverage to enable branch coverage display or
\-\-no\-branch\-coverage to disable it. Branch coverage data display is
.B enabled
by default
When branch coverage display is enabled, each overview page will contain
the number of branches found and hit per file or directory, together with
the resulting coverage rate. In addition, each source code view will contain
an extra column which lists all branches of a line with indications of
whether the branch was taken or not. Branches are shown in the following format:
' + ': Branch was taken at least once
.br
' - ': Branch was not taken
.br
' # ': The basic block containing the branch was never executed
.br
Note that it might not always be possible to relate branches to the
corresponding source code statements: during compilation, GCC might shuffle
branches around or eliminate some of them to generate better code.
This option can also be configured permanently using the configuration file
option
.IR genhtml_branch_coverage .
.RE
.B \-\-demangle\-cpp
.RS
Specify whether to demangle C++ function names.
Use this option if you want to convert C++ internal function names to
human readable format for display on the HTML function overview page.
This option requires that the c++filt tool is installed (see
.BR c++filt (1)).
.RE
.B \-\-ignore\-errors
.I errors
.br
.RS
Specify a list of errors after which to continue processing.
Use this option to specify a list of one or more classes of errors after which
geninfo should continue processing instead of aborting.
.I errors
can be a comma\-separated list of the following keywords:
.B source:
the source code file for a data set could not be found.
.RE
.B \-\-config\-file
.I config\-file
.br
.RS
Specify a configuration file to use.
When this option is specified, neither the system\-wide configuration file
/etc/lcovrc, nor the per\-user configuration file ~/.lcovrc is read.
This option may be useful when there is a need to run several
instances of
.B genhtml
with different configuration file options in parallel.
.RE
.B \-\-rc
.IR keyword = value
.br
.RS
Override a configuration directive.
Use this option to specify a
.IR keyword = value
statement which overrides the corresponding configuration statement in
the lcovrc configuration file. You can specify this option more than once
to override multiple configuration statements.
See
.BR lcovrc (5)
for a list of available keywords and their meaning.
.RE
.SH FILES
.I /etc/lcovrc
.RS
The system\-wide configuration file.
.RE
.I ~/.lcovrc
.RS
The per\-user configuration file.
.RE
.SH AUTHOR
Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>
.SH SEE ALSO
.BR lcov (1),
.BR lcovrc (5),
.BR geninfo (1),
.BR genpng (1),
.BR gendesc (1),
.BR gcov (1)

View File

@ -1,512 +0,0 @@
.TH geninfo 1 "LCOV 1.10" 2012\-10\-10 "User Manuals"
.SH NAME
geninfo \- Generate tracefiles from .da files
.SH SYNOPSIS
.B geninfo
.RB [ \-h | \-\-help ]
.RB [ \-v | \-\-version ]
.RB [ \-q | \-\-quiet ]
.br
.RS 8
.RB [ \-i | \-\-initial ]
.RB [ \-t | \-\-test\-name
.IR test\-name ]
.br
.RB [ \-o | \-\-output\-filename
.IR filename ]
.RB [ \-f | \-\-follow ]
.br
.RB [ \-b | \-\-base\-directory
.IR directory ]
.br
.RB [ \-\-checksum ]
.RB [ \-\-no\-checksum ]
.br
.RB [ \-\-compat\-libtool ]
.RB [ \-\-no\-compat\-libtool ]
.br
.RB [ \-\-gcov\-tool
.IR tool ]
.RB [ \-\-ignore\-errors
.IR errors ]
.br
.RB [ \-\-no\-recursion ]
.I directory
.RB [ \-\-external ]
.RB [ \-\-no\-external ]
.br
.RB [ \-\-config\-file
.IR config\-file ]
.RB [ \-\-no\-markers ]
.br
.RB [ \-\-derive\-func\-data ]
.RB [ \-\-compat
.IR mode =on|off|auto]
.br
.RB [ \-\-rc
.IR keyword = value ]
.RE
.SH DESCRIPTION
.B geninfo
converts all GCOV coverage data files found in
.I directory
into tracefiles, which the
.B genhtml
tool can convert to HTML output.
Unless the \-\-output\-filename option is specified,
.B geninfo
writes its
output to one file per .da file, the name of which is generated by simply
appending ".info" to the respective .da file name.
Note that the current user needs write access to both
.I directory
as well as to the original source code location. This is necessary because
some temporary files have to be created there during the conversion process.
Note also that
.B geninfo
is called from within
.BR lcov ,
so that there is usually no need to call it directly.
.B Exclusion markers
To exclude specific lines of code from a tracefile, you can add exclusion
markers to the source code. Exclusion markers are keywords which can for
example be added in the form of a comment.
The following markers are recognized by geninfo:
LCOV_EXCL_LINE
.RS
Lines containing this marker will be excluded.
.br
.RE
LCOV_EXCL_START
.RS
Marks the beginning of an excluded section. The current line is part of this
section.
.br
.RE
LCOV_EXCL_STOP
.RS
Marks the end of an excluded section. The current line not part of this
section.
.RE
.br
.SH OPTIONS
.B \-b
.I directory
.br
.B \-\-base\-directory
.I directory
.br
.RS
.RI "Use " directory
as base directory for relative paths.
Use this option to specify the base directory of a build\-environment
when geninfo produces error messages like:
.RS
ERROR: could not read source file /home/user/project/subdir1/subdir2/subdir1/subdir2/file.c
.RE
In this example, use /home/user/project as base directory.
This option is required when using geninfo on projects built with libtool or
similar build environments that work with a base directory, i.e. environments,
where the current working directory when invoking the compiler is not the same
directory in which the source code file is located.
Note that this option will not work in environments where multiple base
directories are used. In that case use configuration file setting
.B geninfo_auto_base=1
(see
.BR lcovrc (5)).
.RE
.B \-\-checksum
.br
.B \-\-no\-checksum
.br
.RS
Specify whether to generate checksum data when writing tracefiles.
Use \-\-checksum to enable checksum generation or \-\-no\-checksum to
disable it. Checksum generation is
.B disabled
by default.
When checksum generation is enabled, a checksum will be generated for each
source code line and stored along with the coverage data. This checksum will
be used to prevent attempts to combine coverage data from different source
code versions.
If you don't work with different source code versions, disable this option
to speed up coverage data processing and to reduce the size of tracefiles.
.RE
.B \-\-compat
.IR mode = value [, mode = value ,...]
.br
.RS
Set compatibility mode.
Use \-\-compat to specify that geninfo should enable one or more compatibility
modes when capturing coverage data. You can provide a comma-separated list
of mode=value pairs to specify the values for multiple modes.
Valid
.I values
are:
.B on
.RS
Enable compatibility mode.
.RE
.B off
.RS
Disable compatibility mode.
.RE
.B auto
.RS
Apply auto-detection to determine if compatibility mode is required. Note that
auto-detection is not available for all compatibility modes.
.RE
If no value is specified, 'on' is assumed as default value.
Valid
.I modes
are:
.B libtool
.RS
Enable this mode if you are capturing coverage data for a project that
was built using the libtool mechanism. See also
\-\-compat\-libtool.
The default value for this setting is 'on'.
.RE
.B hammer
.RS
Enable this mode if you are capturing coverage data for a project that
was built using a version of GCC 3.3 that contains a modification
(hammer patch) of later GCC versions. You can identify a modified GCC 3.3
by checking the build directory of your project for files ending in the
extension '.bbg'. Unmodified versions of GCC 3.3 name these files '.bb'.
The default value for this setting is 'auto'.
.RE
.B split_crc
.RS
Enable this mode if you are capturing coverage data for a project that
was built using a version of GCC 4.6 that contains a modification
(split function checksums) of later GCC versions. Typical error messages
when running geninfo on coverage data produced by such GCC versions are
\'out of memory' and 'reached unexpected end of file'.
The default value for this setting is 'auto'
.RE
.RE
.B \-\-compat\-libtool
.br
.B \-\-no\-compat\-libtool
.br
.RS
Specify whether to enable libtool compatibility mode.
Use \-\-compat\-libtool to enable libtool compatibility mode or \-\-no\-compat\-libtool
to disable it. The libtool compatibility mode is
.B enabled
by default.
When libtool compatibility mode is enabled, geninfo will assume that the source
code relating to a .da file located in a directory named ".libs" can be
found in its parent directory.
If you have directories named ".libs" in your build environment but don't use
libtool, disable this option to prevent problems when capturing coverage data.
.RE
.B \-\-config\-file
.I config\-file
.br
.RS
Specify a configuration file to use.
When this option is specified, neither the system\-wide configuration file
/etc/lcovrc, nor the per\-user configuration file ~/.lcovrc is read.
This option may be useful when there is a need to run several
instances of
.B geninfo
with different configuration file options in parallel.
.RE
.B \-\-derive\-func\-data
.br
.RS
Calculate function coverage data from line coverage data.
Use this option to collect function coverage data, even if the version of the
gcov tool installed on the test system does not provide this data. lcov will
instead derive function coverage data from line coverage data and
information about which lines belong to a function.
.RE
.B \-\-external
.br
.B \-\-no\-external
.br
.RS
Specify whether to capture coverage data for external source files.
External source files are files which are not located in one of the directories
specified by \-\-directory or \-\-base\-directory. Use \-\-external to include
external source files while capturing coverage data or \-\-no\-external to
ignore this data.
Data for external source files is
.B included
by default.
.RE
.B \-f
.br
.B \-\-follow
.RS
Follow links when searching .da files.
.RE
.B \-\-gcov\-tool
.I tool
.br
.RS
Specify the location of the gcov tool.
.RE
.B \-h
.br
.B \-\-help
.RS
Print a short help text, then exit.
.RE
.B \-\-ignore\-errors
.I errors
.br
.RS
Specify a list of errors after which to continue processing.
Use this option to specify a list of one or more classes of errors after which
geninfo should continue processing instead of aborting.
.I errors
can be a comma\-separated list of the following keywords:
.B gcov:
the gcov tool returned with a non\-zero return code.
.B source:
the source code file for a data set could not be found.
.RE
.B \-i
.br
.B \-\-initial
.RS
Capture initial zero coverage data.
Run geninfo with this option on the directories containing .bb, .bbg or .gcno
files before running any test case. The result is a "baseline" coverage data
file that contains zero coverage for every instrumented line and function.
Combine this data file (using lcov \-a) with coverage data files captured
after a test run to ensure that the percentage of total lines covered is
correct even when not all object code files were loaded during the test.
Note: currently, the \-\-initial option does not generate branch coverage
information.
.RE
.B \-\-no\-markers
.br
.RS
Use this option if you want to get coverage data without regard to exclusion
markers in the source code file.
.RE
.B \-\-no\-recursion
.br
.RS
Use this option if you want to get coverage data for the specified directory
only without processing subdirectories.
.RE
.BI "\-o " output\-filename
.br
.BI "\-\-output\-filename " output\-filename
.RS
Write all data to
.IR output\-filename .
If you want to have all data written to a single file (for easier
handling), use this option to specify the respective filename. By default,
one tracefile will be created for each processed .da file.
.RE
.B \-q
.br
.B \-\-quiet
.RS
Do not print progress messages.
Suppresses all informational progress output. When this switch is enabled,
only error or warning messages are printed.
.RE
.B \-\-rc
.IR keyword = value
.br
.RS
Override a configuration directive.
Use this option to specify a
.IR keyword = value
statement which overrides the corresponding configuration statement in
the lcovrc configuration file. You can specify this option more than once
to override multiple configuration statements.
See
.BR lcovrc (5)
for a list of available keywords and their meaning.
.RE
.BI "\-t " testname
.br
.BI "\-\-test\-name " testname
.RS
Use test case name
.I testname
for resulting data. Valid test case names can consist of letters, decimal
digits and the underscore character ('_').
This proves useful when data from several test cases is merged (i.e. by
simply concatenating the respective tracefiles) in which case a test
name can be used to differentiate between data from each test case.
.RE
.B \-v
.br
.B \-\-version
.RS
Print version number, then exit.
.RE
.SH FILES
.I /etc/lcovrc
.RS
The system\-wide configuration file.
.RE
.I ~/.lcovrc
.RS
The per\-user configuration file.
.RE
Following is a quick description of the tracefile format as used by
.BR genhtml ", " geninfo " and " lcov .
A tracefile is made up of several human\-readable lines of text,
divided into sections. If available, a tracefile begins with the
.I testname
which is stored in the following format:
TN:<test name>
For each source file referenced in the .da file, there is a section containing
filename and coverage data:
SF:<absolute path to the source file>
Following is a list of line numbers for each function name found in the
source file:
FN:<line number of function start>,<function name>
Next, there is a list of execution counts for each instrumented function:
FNDA:<execution count>,<function name>
This list is followed by two lines containing the number of functions found
and hit:
FNF:<number of functions found>
FNH:<number of function hit>
Branch coverage information is stored which one line per branch:
BRDA:<line number>,<block number>,<branch number>,<taken>
Block number and branch number are gcc internal IDs for the branch. Taken is
either '-' if the basic block containing the branch was never executed or
a number indicating how often that branch was taken.
Branch coverage summaries are stored in two lines:
BRF:<number of branches found>
BRH:<number of branches hit>
Then there is a list of execution counts for each instrumented line
(i.e. a line which resulted in executable code):
DA:<line number>,<execution count>[,<checksum>]
Note that there may be an optional checksum present for each instrumented
line. The current
.B geninfo
implementation uses an MD5 hash as checksumming algorithm.
At the end of a section, there is a summary about how many lines
were found and how many were actually instrumented:
LH:<number of lines with a non\-zero execution count>
LF:<number of instrumented lines>
Each sections ends with:
end_of_record
In addition to the main source code file there are sections for all
#included files which also contain executable code.
Note that the absolute path of a source file is generated by interpreting
the contents of the respective .bb file (see
.BR "gcov " (1)
for more information on this file type). Relative filenames are prefixed
with the directory in which the .bb file is found.
Note also that symbolic links to the .bb file will be resolved so that the
actual file path is used instead of the path to a link. This approach is
necessary for the mechanism to work with the /proc/gcov files.
.SH AUTHOR
Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>
.SH SEE ALSO
.BR lcov (1),
.BR lcovrc (5),
.BR genhtml (1),
.BR genpng (1),
.BR gendesc (1),
.BR gcov (1)

View File

@ -1,101 +0,0 @@
.TH genpng 1 "LCOV 1.10" 2012\-10\-10 "User Manuals"
.SH NAME
genpng \- Generate an overview image from a source file
.SH SYNOPSIS
.B genpng
.RB [ \-h | \-\-help ]
.RB [ \-v | \-\-version ]
.RS 7
.br
.RB [ \-t | \-\-tab\-size
.IR tabsize ]
.RB [ \-w | \-\-width
.IR width ]
.br
.RB [ \-o | \-\-output\-filename
.IR output\-filename ]
.br
.IR source\-file
.SH DESCRIPTION
.B genpng
creates an overview image for a given source code file of either
plain text or .gcov file format.
Note that the
.I GD.pm
Perl module has to be installed for this script to work
(it may be obtained from
.IR http://www.cpan.org ).
Note also that
.B genpng
is called from within
.B genhtml
so that there is usually no need to call it directly.
.SH OPTIONS
.B \-h
.br
.B \-\-help
.RS
Print a short help text, then exit.
.RE
.B \-v
.br
.B \-\-version
.RS
Print version number, then exit.
.RE
.BI "\-t " tab\-size
.br
.BI "\-\-tab\-size " tab\-size
.RS
Use
.I tab\-size
spaces in place of tab.
All occurrences of tabulator signs in the source code file will be replaced
by the number of spaces defined by
.I tab\-size
(default is 4).
.RE
.BI "\-w " width
.br
.BI "\-\-width " width
.RS
Set width of output image to
.I width
pixel.
The resulting image will be exactly
.I width
pixel wide (default is 80).
Note that source code lines which are longer than
.I width
will be truncated.
.RE
.BI "\-o " filename
.br
.BI "\-\-output\-filename " filename
.RS
Write image to
.IR filename .
Specify a name for the resulting image file (default is
.IR source\-file .png).
.RE
.SH AUTHOR
Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>
.SH SEE ALSO
.BR lcov (1),
.BR genhtml (1),
.BR geninfo (1),
.BR gendesc (1),
.BR gcov (1)

View File

@ -1,883 +0,0 @@
.TH lcov 1 "LCOV 1.10" 2012\-10\-10 "User Manuals"
.SH NAME
lcov \- a graphical GCOV front\-end
.SH SYNOPSIS
.B lcov
.BR \-c | \-\-capture
.RS 5
.br
.RB [ \-d | \-\-directory
.IR directory ]
.RB [ \-k | \-\-kernel\-directory
.IR directory ]
.br
.RB [ \-o | \-\-output\-file
.IR tracefile ]
.RB [ \-t | \-\-test\-name
.IR testname ]
.br
.RB [ \-b | \-\-base\-directory
.IR directory ]
.RB [ \-i | \-\-initial ]
.RB [ \-\-gcov\-tool
.IR tool ]
.br
.RB [ \-\-checksum ]
.RB [ \-\-no\-checksum ]
.RB [ \-\-no\-recursion ]
.RB [ \-f | \-\-follow ]
.br
.RB [ \-\-compat\-libtool ]
.RB [ \-\-no\-compat\-libtool ]
.RB [ \-\-ignore\-errors
.IR errors ]
.br
.RB [ \-\-to\-package
.IR package ]
.RB [ \-\-from\-package
.IR package ]
.RB [ \-q | \-\-quiet ]
.br
.RB [ \-\-no\-markers ]
.RB [ \-\-external ]
.RB [ \-\-no\-external ]
.br
.RB [ \-\-config\-file
.IR config\-file ]
.RB [ \-\-rc
.IR keyword = value ]
.br
.RB [ \-\-compat
.IR mode =on|off|auto]
.br
.RE
.B lcov
.BR \-z | \-\-zerocounters
.RS 5
.br
.RB [ \-d | \-\-directory
.IR directory ]
.RB [ \-\-no\-recursion ]
.RB [ \-f | \-\-follow ]
.br
.RB [ \-q | \-\-quiet ]
.br
.RE
.B lcov
.BR \-l | \-\-list
.I tracefile
.RS 5
.br
.RB [ \-q | \-\-quiet ]
.RB [ \-\-list\-full\-path ]
.RB [ \-\-no\-list\-full\-path ]
.br
.RB [ \-\-config\-file
.IR config\-file ]
.RB [ \-\-rc
.IR keyword = value ]
.br
.RE
.B lcov
.BR \-a | \-\-add\-tracefile
.I tracefile
.RS 5
.br
.RB [ \-o | \-\-output\-file
.IR tracefile ]
.RB [ \-\-checksum ]
.RB [ \-\-no\-checksum ]
.br
.RB [ \-q | \-\-quiet ]
.RB [ \-\-config\-file
.IR config\-file ]
.RB [ \-\-rc
.IR keyword = value ]
.br
.RE
.B lcov
.BR \-e | \-\-extract
.I tracefile pattern
.RS 5
.br
.RB [ \-o | \-\-output\-file
.IR tracefile ]
.RB [ \-\-checksum ]
.RB [ \-\-no\-checksum ]
.br
.RB [ \-q | \-\-quiet ]
.RB [ \-\-config\-file
.IR config\-file ]
.RB [ \-\-rc
.IR keyword = value ]
.br
.RE
.B lcov
.BR \-r | \-\-remove
.I tracefile pattern
.RS 5
.br
.RB [ \-o | \-\-output\-file
.IR tracefile ]
.RB [ \-\-checksum ]
.RB [ \-\-no\-checksum ]
.br
.RB [ \-q | \-\-quiet ]
.RB [ \-\-config\-file
.IR config\-file ]
.RB [ \-\-rc
.IR keyword = value ]
.br
.RE
.B lcov
.BR \-\-diff
.IR "tracefile diff"
.RS 5
.br
.RB [ \-o | \-\-output\-file
.IR tracefile ]
.RB [ \-\-checksum ]
.RB [ \-\-no\-checksum ]
.br
.RB [ \-\-convert\-filenames ]
.RB [ \-\-strip
.IR depth ]
.RB [ \-\-path
.IR path ]
.RB [ \-q | \-\-quiet ]
.br
.RB [ \-\-config\-file
.IR config\-file ]
.RB [ \-\-rc
.IR keyword = value ]
.br
.RE
.B lcov
.BR \-\-summary
.I tracefile
.RS 5
.br
.RB [ \-q | \-\-quiet ]
.br
.RE
.B lcov
.RB [ \-h | \-\-help ]
.RB [ \-v | \-\-version ]
.RS 5
.br
.RE
.SH DESCRIPTION
.B lcov
is a graphical front\-end for GCC's coverage testing tool gcov. It collects
line, function and branch coverage data for multiple source files and creates
HTML pages containing the source code annotated with coverage information.
It also adds overview pages for easy navigation within the file structure.
Use
.B lcov
to collect coverage data and
.B genhtml
to create HTML pages. Coverage data can either be collected from the
currently running Linux kernel or from a user space application. To do this,
you have to complete the following preparation steps:
For Linux kernel coverage:
.RS
Follow the setup instructions for the gcov\-kernel infrastructure:
.I http://ltp.sourceforge.net/coverage/gcov.php
.br
.RE
For user space application coverage:
.RS
Compile the application with GCC using the options
"\-fprofile\-arcs" and "\-ftest\-coverage".
.RE
Please note that this man page refers to the output format of
.B lcov
as ".info file" or "tracefile" and that the output of GCOV
is called ".da file".
Also note that when printing percentages, 0% and 100% are only printed when
the values are exactly 0% and 100% respectively. Other values which would
conventionally be rounded to 0% or 100% are instead printed as nearest
non-boundary value. This behavior is in accordance with that of the
.BR gcov (1)
tool.
.SH OPTIONS
.B \-a
.I tracefile
.br
.B \-\-add\-tracefile
.I tracefile
.br
.RS
Add contents of
.IR tracefile .
Specify several tracefiles using the \-a switch to combine the coverage data
contained in these files by adding up execution counts for matching test and
filename combinations.
The result of the add operation will be written to stdout or the tracefile
specified with \-o.
Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE
.B \-b
.I directory
.br
.B \-\-base\-directory
.I directory
.br
.RS
.RI "Use " directory
as base directory for relative paths.
Use this option to specify the base directory of a build\-environment
when lcov produces error messages like:
.RS
ERROR: could not read source file /home/user/project/subdir1/subdir2/subdir1/subdir2/file.c
.RE
In this example, use /home/user/project as base directory.
This option is required when using lcov on projects built with libtool or
similar build environments that work with a base directory, i.e. environments,
where the current working directory when invoking the compiler is not the same
directory in which the source code file is located.
Note that this option will not work in environments where multiple base
directories are used. In that case use configuration file setting
.B geninfo_auto_base=1
(see
.BR lcovrc (5)).
.RE
.B \-c
.br
.B \-\-capture
.br
.RS
Capture coverage data.
By default captures the current kernel execution counts and writes the
resulting coverage data to the standard output. Use the \-\-directory
option to capture counts for a user space program.
The result of the capture operation will be written to stdout or the tracefile
specified with \-o.
Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE
.B \-\-checksum
.br
.B \-\-no\-checksum
.br
.RS
Specify whether to generate checksum data when writing tracefiles.
Use \-\-checksum to enable checksum generation or \-\-no\-checksum to
disable it. Checksum generation is
.B disabled
by default.
When checksum generation is enabled, a checksum will be generated for each
source code line and stored along with the coverage data. This checksum will
be used to prevent attempts to combine coverage data from different source
code versions.
If you don't work with different source code versions, disable this option
to speed up coverage data processing and to reduce the size of tracefiles.
.RE
.B \-\-compat
.IR mode = value [, mode = value ,...]
.br
.RS
Set compatibility mode.
Use \-\-compat to specify that lcov should enable one or more compatibility
modes when capturing coverage data. You can provide a comma-separated list
of mode=value pairs to specify the values for multiple modes.
Valid
.I values
are:
.B on
.RS
Enable compatibility mode.
.RE
.B off
.RS
Disable compatibility mode.
.RE
.B auto
.RS
Apply auto-detection to determine if compatibility mode is required. Note that
auto-detection is not available for all compatibility modes.
.RE
If no value is specified, 'on' is assumed as default value.
Valid
.I modes
are:
.B libtool
.RS
Enable this mode if you are capturing coverage data for a project that
was built using the libtool mechanism. See also
\-\-compat\-libtool.
The default value for this setting is 'on'.
.RE
.B hammer
.RS
Enable this mode if you are capturing coverage data for a project that
was built using a version of GCC 3.3 that contains a modification
(hammer patch) of later GCC versions. You can identify a modified GCC 3.3
by checking the build directory of your project for files ending in the
extension '.bbg'. Unmodified versions of GCC 3.3 name these files '.bb'.
The default value for this setting is 'auto'.
.RE
.B split_crc
.RS
Enable this mode if you are capturing coverage data for a project that
was built using a version of GCC 4.6 that contains a modification
(split function checksums) of later GCC versions. Typical error messages
when running lcov on coverage data produced by such GCC versions are
\'out of memory' and 'reached unexpected end of file'.
The default value for this setting is 'auto'
.RE
.RE
.B \-\-compat\-libtool
.br
.B \-\-no\-compat\-libtool
.br
.RS
Specify whether to enable libtool compatibility mode.
Use \-\-compat\-libtool to enable libtool compatibility mode or \-\-no\-compat\-libtool
to disable it. The libtool compatibility mode is
.B enabled
by default.
When libtool compatibility mode is enabled, lcov will assume that the source
code relating to a .da file located in a directory named ".libs" can be
found in its parent directory.
If you have directories named ".libs" in your build environment but don't use
libtool, disable this option to prevent problems when capturing coverage data.
.RE
.B \-\-config\-file
.I config\-file
.br
.RS
Specify a configuration file to use.
When this option is specified, neither the system\-wide configuration file
/etc/lcovrc, nor the per\-user configuration file ~/.lcovrc is read.
This option may be useful when there is a need to run several
instances of
.B lcov
with different configuration file options in parallel.
.RE
.B \-\-convert\-filenames
.br
.RS
Convert filenames when applying diff.
Use this option together with \-\-diff to rename the file names of processed
data sets according to the data provided by the diff.
.RE
.B \-\-diff
.I tracefile
.I difffile
.br
.RS
Convert coverage data in
.I tracefile
using source code diff file
.IR difffile .
Use this option if you want to merge coverage data from different source code
levels of a program, e.g. when you have data taken from an older version
and want to combine it with data from a more current version.
.B lcov
will try to map source code lines between those versions and adjust the coverage
data respectively.
.I difffile
needs to be in unified format, i.e. it has to be created using the "\-u" option
of the
.B diff
tool.
Note that lines which are not present in the old version will not be counted
as instrumented, therefore tracefiles resulting from this operation should
not be interpreted individually but together with other tracefiles taken
from the newer version. Also keep in mind that converted coverage data should
only be used for overview purposes as the process itself introduces a loss
of accuracy.
The result of the diff operation will be written to stdout or the tracefile
specified with \-o.
Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE
.B \-d
.I directory
.br
.B \-\-directory
.I directory
.br
.RS
Use .da files in
.I directory
instead of kernel.
If you want to work on coverage data for a user space program, use this
option to specify the location where the program was compiled (that's
where the counter files ending with .da will be stored).
Note that you may specify this option more than once.
.RE
.B \-\-external
.br
.B \-\-no\-external
.br
.RS
Specify whether to capture coverage data for external source files.
External source files are files which are not located in one of the directories
specified by \-\-directory or \-\-base\-directory. Use \-\-external to include
external source files while capturing coverage data or \-\-no\-external to
ignore this data.
Data for external source files is
.B included
by default.
.RE
.B \-e
.I tracefile
.I pattern
.br
.B \-\-extract
.I tracefile
.I pattern
.br
.RS
Extract data from
.IR tracefile .
Use this switch if you want to extract coverage data for only a particular
set of files from a tracefile. Additional command line parameters will be
interpreted as shell wildcard patterns (note that they may need to be
escaped accordingly to prevent the shell from expanding them first).
Every file entry in
.I tracefile
which matches at least one of those patterns will be extracted.
The result of the extract operation will be written to stdout or the tracefile
specified with \-o.
Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE
.B \-f
.br
.B \-\-follow
.br
.RS
Follow links when searching for .da files.
.RE
.B \-\-from\-package
.I package
.br
.RS
Use .da files in
.I package
instead of kernel or directory.
Use this option if you have separate machines for build and test and
want to perform the .info file creation on the build machine. See
\-\-to\-package for more information.
.RE
.B \-\-gcov\-tool
.I tool
.br
.RS
Specify the location of the gcov tool.
.RE
.B \-h
.br
.B \-\-help
.br
.RS
Print a short help text, then exit.
.RE
.B \-\-ignore\-errors
.I errors
.br
.RS
Specify a list of errors after which to continue processing.
Use this option to specify a list of one or more classes of errors after which
lcov should continue processing instead of aborting.
.I errors
can be a comma\-separated list of the following keywords:
.B gcov:
the gcov tool returned with a non\-zero return code.
.B source:
the source code file for a data set could not be found.
.RE
.B \-i
.br
.B \-\-initial
.RS
Capture initial zero coverage data.
Run lcov with \-c and this option on the directories containing .bb, .bbg
or .gcno files before running any test case. The result is a "baseline"
coverage data file that contains zero coverage for every instrumented line.
Combine this data file (using lcov \-a) with coverage data files captured
after a test run to ensure that the percentage of total lines covered is
correct even when not all source code files were loaded during the test.
Recommended procedure when capturing data for a test case:
1. create baseline coverage data file
.RS
# lcov \-c \-i \-d appdir \-o app_base.info
.br
.RE
2. perform test
.RS
# appdir/test
.br
.RE
3. create test coverage data file
.RS
# lcov \-c \-d appdir \-o app_test.info
.br
.RE
4. combine baseline and test coverage data
.RS
# lcov \-a app_base.info \-a app_test.info \-o app_total.info
.br
.RE
.RE
.B \-k
.I subdirectory
.br
.B \-\-kernel\-directory
.I subdirectory
.br
.RS
Capture kernel coverage data only from
.IR subdirectory .
Use this option if you don't want to get coverage data for all of the
kernel, but only for specific subdirectories. This option may be specified
more than once.
Note that you may need to specify the full path to the kernel subdirectory
depending on the version of the kernel gcov support.
.RE
.B \-l
.I tracefile
.br
.B \-\-list
.I tracefile
.br
.RS
List the contents of the
.IR tracefile .
Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE
.B \-\-list\-full\-path
.br
.B \-\-no\-list\-full\-path
.br
.RS
Specify whether to show full paths during list operation.
Use \-\-list\-full\-path to show full paths during list operation
or \-\-no\-list\-full\-path to show shortened paths. Paths are
.B shortened
by default.
.RE
.B \-\-no\-markers
.br
.RS
Use this option if you want to get coverage data without regard to exclusion
markers in the source code file. See
.BR "geninfo " (1)
for details on exclusion markers.
.RE
.B \-\-no\-recursion
.br
.RS
Use this option if you want to get coverage data for the specified directory
only without processing subdirectories.
.RE
.B \-o
.I tracefile
.br
.B \-\-output\-file
.I tracefile
.br
.RS
Write data to
.I tracefile
instead of stdout.
Specify "\-" as a filename to use the standard output.
By convention, lcov\-generated coverage data files are called "tracefiles" and
should have the filename extension ".info".
.RE
.B \-\-path
.I path
.br
.RS
Strip path from filenames when applying diff.
Use this option together with \-\-diff to tell lcov to disregard the specified
initial path component when matching between tracefile and diff filenames.
.RE
.B \-q
.br
.B \-\-quiet
.br
.RS
Do not print progress messages.
This option is implied when no output filename is specified to prevent
progress messages to mess with coverage data which is also printed to
the standard output.
.RE
.B \-\-rc
.IR keyword = value
.br
.RS
Override a configuration directive.
Use this option to specify a
.IR keyword = value
statement which overrides the corresponding configuration statement in
the lcovrc configuration file. You can specify this option more than once
to override multiple configuration statements.
See
.BR lcovrc (5)
for a list of available keywords and their meaning.
.RE
.B \-r
.I tracefile
.I pattern
.br
.B \-\-remove
.I tracefile
.I pattern
.br
.RS
Remove data from
.IR tracefile .
Use this switch if you want to remove coverage data for a particular
set of files from a tracefile. Additional command line parameters will be
interpreted as shell wildcard patterns (note that they may need to be
escaped accordingly to prevent the shell from expanding them first).
Every file entry in
.I tracefile
which matches at least one of those patterns will be removed.
The result of the remove operation will be written to stdout or the tracefile
specified with \-o.
Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE
.B \-\-strip
.I depth
.br
.RS
Strip path components when applying diff.
Use this option together with \-\-diff to tell lcov to disregard the specified
number of initial directories when matching tracefile and diff filenames.
.RE
.B \-\-summary
.I tracefile
.br
.RS
Show summary coverage information for the specified tracefile.
Note that you may specify this option more than once.
Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE
.B \-t
.I testname
.br
.B \-\-test\-name
.I testname
.br
.RS
Specify test name to be stored in the tracefile.
This name identifies a coverage data set when more than one data set is merged
into a combined tracefile (see option \-a).
Valid test names can consist of letters, decimal digits and the underscore
character ("_").
.RE
.B \-\-to\-package
.I package
.br
.RS
Store .da files for later processing.
Use this option if you have separate machines for build and test and
want to perform the .info file creation on the build machine. To do this,
follow these steps:
On the test machine:
.RS
.br
\- run the test
.br
\- run lcov \-c [\-d directory] \-\-to-package
.I file
.br
\- copy
.I file
to the build machine
.RE
.br
On the build machine:
.RS
.br
\- run lcov \-c \-\-from-package
.I file
[\-o and other options]
.RE
.br
This works for both kernel and user space coverage data. Note that you might
have to specify the path to the build directory using \-b with
either \-\-to\-package or \-\-from-package. Note also that the package data
must be converted to a .info file before recompiling the program or it will
become invalid.
.RE
.B \-v
.br
.B \-\-version
.br
.RS
Print version number, then exit.
.RE
.B \-z
.br
.B \-\-zerocounters
.br
.RS
Reset all execution counts to zero.
By default tries to reset kernel execution counts. Use the \-\-directory
option to reset all counters of a user space program.
Only one of \-z, \-c, \-a, \-e, \-r, \-l, \-\-diff or \-\-summary may be
specified at a time.
.RE
.SH FILES
.I /etc/lcovrc
.RS
The system\-wide configuration file.
.RE
.I ~/.lcovrc
.RS
The per\-user configuration file.
.RE
.SH AUTHOR
Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>
.SH SEE ALSO
.BR lcovrc (5),
.BR genhtml (1),
.BR geninfo (1),
.BR genpng (1),
.BR gendesc (1),
.BR gcov (1)

View File

@ -1,821 +0,0 @@
.TH lcovrc 5 "LCOV 1.10" 2012\-10\-10 "User Manuals"
.SH NAME
lcovrc \- lcov configuration file
.SH DESCRIPTION
The
.I lcovrc
file contains configuration information for the
.B lcov
code coverage tool (see
.BR lcov (1)).
.br
The system\-wide configuration file is located at
.IR /etc/lcovrc .
To change settings for a single user, place a customized copy of this file at
location
.IR ~/.lcovrc .
Where available, command\-line options override configuration file settings.
Lines in a configuration file can either be:
.IP " *"
empty lines or lines consisting only of white space characters. These lines are
ignored.
.IP " *"
comment lines which start with a hash sign ('#'). These are treated like empty
lines and will be ignored.
.IP " *"
statements in the form
.RI ' key " = " value '.
A list of valid statements and their description can be found in
section 'OPTIONS' below.
.PP
.B Example configuration:
.IP
#
.br
# Example LCOV configuration file
.br
#
.br
# External style sheet file
.br
#genhtml_css_file = gcov.css
.br
# Coverage rate limits
.br
genhtml_hi_limit = 90
.br
genhtml_med_limit = 75
.br
# Width of line coverage field in source code view
.br
genhtml_line_field_width = 12
.br
# Width of branch coverage field in source code view
.br
genhtml_branch_field_width = 16
.br
# Width of overview image
.br
genhtml_overview_width = 80
.br
# Resolution of overview navigation
.br
genhtml_nav_resolution = 4
.br
# Offset for source code navigation
.br
genhtml_nav_offset = 10
.br
# Do not remove unused test descriptions if non\-zero
.br
genhtml_keep_descriptions = 0
.br
# Do not remove prefix from directory names if non\-zero
.br
genhtml_no_prefix = 0
.br
# Do not create source code view if non\-zero
.br
genhtml_no_source = 0
.br
# Specify size of tabs
.br
genhtml_num_spaces = 8
.br
# Highlight lines with converted\-only data if non\-zero
.br
genhtml_highlight = 0
.br
# Include color legend in HTML output if non\-zero
.br
genhtml_legend = 0
.br
# Include HTML file at start of HTML output
.br
#genhtml_html_prolog = prolog.html
.br
# Include HTML file at end of HTML output
.br
#genhtml_html_epilog = epilog.html
.br
# Use custom HTML file extension
.br
#genhtml_html_extension = html
.br
# Compress all generated html files with gzip.
.br
#genhtml_html_gzip = 1
.br
# Include sorted overview pages
.br
genhtml_sort = 1
.br
# Include function coverage data display
.br
#genhtml_function_coverage = 1
.br
# Include branch coverage data display
.br
#genhtml_branch_coverage = 1
.br
# Specify the character set of all generated HTML pages
.br
genhtml_charset=UTF\-8
.br
# Location of the gcov tool
.br
#geninfo_gcov_tool = gcov
.br
# Adjust test names if non\-zero
.br
#geninfo_adjust_testname = 0
.br
# Calculate a checksum for each line if non\-zero
.br
geninfo_checksum = 0
.br
# Enable libtool compatibility mode if non\-zero
.br
geninfo_compat_libtool = 0
.br
# Specify whether to capture coverage data for external source
.br
# files
.br
#geninfo_external = 1
.br
# Use gcov's --all-blocks option if non-zero
.br
#geninfo_gcov_all_blocks = 1
.br
# Specify compatiblity modes (same as \-\-compat option
.br
# of geninfo)
.br
#geninfo_compat = libtool=on, hammer=auto, split_crc=auto
.br
# Adjust path to source files by removing or changing path
.br
# components that match the specified pattern (Perl regular
.br
# expression format)
.br
#geninfo_adjust_src_path = /tmp/build => /usr/src
# Specify if geninfo should try to automatically determine
.br
# the base-directory when collecting coverage data.
.br
geninfo_auto_base = 1
.br
# Directory containing gcov kernel files
.br
lcov_gcov_dir = /proc/gcov
.br
# Location for temporary directories
.br
lcov_tmp_dir = /tmp
.br
# Show full paths during list operation if non\-zero
.br
lcov_list_full_path = 0
.br
# Specify the maximum width for list output. This value is
.br
# ignored when lcov_list_full_path is non\-zero.
.br
lcov_list_width = 80
.br
# Specify the maximum percentage of file names which may be
.br
# truncated when choosing a directory prefix in list output.
.br
# This value is ignored when lcov_list_full_path is non\-zero.
.br
lcov_list_truncate_max = 20
# Specify if function coverage data should be collected and
.br
# processed.
.br
lcov_function_coverage = 1
.br
# Specify if branch coverage data should be collected and
.br
# processed.
.br
lcov_branch_coverage = 0
.br
.PP
.SH OPTIONS
.BR genhtml_css_file " ="
.I filename
.IP
Specify an external style sheet file. Use this option to modify the appearance of the HTML output as generated by
.BR genhtml .
During output generation, a copy of this file will be placed in the output
directory.
.br
This option corresponds to the \-\-css\-file command line option of
.BR genhtml .
.br
By default, a standard CSS file is generated.
.PP
.BR genhtml_hi_limit " ="
.I hi_limit
.br
.BR genhtml_med_limit " ="
.I med_limit
.br
.IP
Specify coverage rate limits for classifying file entries. Use this option to
modify the coverage rates (in percent) for line, function and branch coverage at
which a result is classified as high, medium or low coverage. This
classification affects the color of the corresponding entries on the overview
pages of the HTML output:
.br
High: hi_limit <= rate <= 100 default color: green
.br
Medium: med_limit <= rate < hi_limit default color: orange
.br
Low: 0 <= rate < med_limit default color: red
.br
Defaults are 90 and 75 percent.
.PP
.BR genhtml_line_field_width " ="
.I number_of_characters
.IP
Specify the width (in characters) of the source code view column containing
line coverage information.
.br
Default is 12.
.PP
.BR genhtml_branch_field_width " ="
.I number_of_characters
.IP
Specify the width (in characters) of the source code view column containing
branch coverage information.
.br
Default is 16.
.PP
.BR genhtml_overview_width " ="
.I pixel_size
.IP
Specify the width (in pixel) of the overview image created when generating HTML
output using the \-\-frames option of
.BR genhtml .
.br
Default is 80.
.PP
.BR genhtml_nav_resolution " ="
.I lines
.IP
Specify the resolution of overview navigation when generating HTML output using
the \-\-frames option of
.BR genhtml .
This number specifies the maximum difference in lines between the position a
user selected from the overview and the position the source code window is
scrolled to.
.br
Default is 4.
.PP
.BR genhtml_nav_offset " ="
.I lines
.IP
Specify the overview navigation line offset as applied when generating HTML
output using the \-\-frames option of
.BR genhtml.
.br
Clicking a line in the overview image should show the source code view at
a position a bit further up, so that the requested line is not the first
line in the window. This number specifies that offset.
.br
Default is 10.
.PP
.BR genhtml_keep_descriptions " ="
.IR 0 | 1
.IP
If non\-zero, keep unused test descriptions when generating HTML output using
.BR genhtml .
.br
This option corresponds to the \-\-keep\-descriptions option of
.BR genhtml .
.br
Default is 0.
.PP
.BR genhtml_no_prefix " ="
.IR 0 | 1
.IP
If non\-zero, do not try to find and remove a common prefix from directory names.
.br
This option corresponds to the \-\-no\-prefix option of
.BR genhtml .
.br
Default is 0.
.PP
.BR genhtml_no_source " ="
.IR 0 | 1
.IP
If non\-zero, do not create a source code view when generating HTML output using
.BR genhtml .
.br
This option corresponds to the \-\-no\-source option of
.BR genhtml .
.br
Default is 0.
.PP
.BR genhtml_num_spaces " ="
.I num
.IP
Specify the number of spaces to use as replacement for tab characters in the
HTML source code view as generated by
.BR genhtml .
.br
This option corresponds to the \-\-num\-spaces option of
.BR genthml .
.br
Default is 8.
.PP
.BR genhtml_highlight " ="
.IR 0 | 1
.IP
If non\-zero, highlight lines with converted\-only data in
HTML output as generated by
.BR genhtml .
.br
This option corresponds to the \-\-highlight option of
.BR genhtml .
.br
Default is 0.
.PP
.BR genhtml_legend " ="
.IR 0 | 1
.IP
If non\-zero, include a legend explaining the meaning of color coding in the HTML
output as generated by
.BR genhtml .
.br
This option corresponds to the \-\-legend option of
.BR genhtml .
.br
Default is 0.
.PP
.BR genhtml_html_prolog " ="
.I filename
.IP
If set, include the contents of the specified file at the beginning of HTML
output.
This option corresponds to the \-\-html\-prolog option of
.BR genhtml .
.br
Default is to use no extra prolog.
.PP
.BR genhtml_html_epilog " ="
.I filename
.IP
If set, include the contents of the specified file at the end of HTML output.
This option corresponds to the \-\-html\-epilog option of
.BR genhtml .
.br
Default is to use no extra epilog.
.PP
.BR genhtml_html_extension " ="
.I extension
.IP
If set, use the specified string as filename extension for generated HTML files.
This option corresponds to the \-\-html\-extension option of
.BR genhtml .
.br
Default extension is "html".
.PP
.BR genhtml_html_gzip " ="
.IR 0 | 1
.IP
If set, compress all html files using gzip.
This option corresponds to the \-\-html\-gzip option of
.BR genhtml .
.br
Default extension is 0.
.PP
.BR genhtml_sort " ="
.IR 0 | 1
.IP
If non\-zero, create overview pages sorted by coverage rates when generating
HTML output using
.BR genhtml .
.br
This option can be set to 0 by using the \-\-no\-sort option of
.BR genhtml .
.br
Default is 1.
.PP
.BR genhtml_function_coverage " ="
.IR 0 | 1
.IP
If non\-zero, include function coverage data when generating HTML output using
.BR genhtml .
.br
This option can be set to 0 by using the \-\-no\-function\-coverage option of
.BR genhtml .
.br
Default is 1.
.PP
.BR genhtml_branch_coverage " ="
.IR 0 | 1
.IP
If non\-zero, include branch coverage data when generating HTML output using
.BR genhtml .
.br
This option can be set to 0 by using the \-\-no\-branch\-coverage option of
.BR genhtml .
.br
Default is 1.
.PP
.BR genhtml_charset " ="
.I charset
.IP
Specify the character set of all generated HTML pages.
.br
Use this option if the source code contains characters which are not
part of the default character set. Note that this option is ignored
when a custom HTML prolog is specified (see also
.BR genhtml_html_prolog ).
.br
Default is UTF-8.
.PP
.BR geninfo_gcov_tool " ="
.I path_to_gcov
.IP
Specify the location of the gcov tool (see
.BR gcov (1))
which is used to generate coverage information from data files.
.br
Default is 'gcov'.
.PP
.BR geninfo_adjust_testname " ="
.IR 0 | 1
.IP
If non\-zero, adjust test names to include operating system information
when capturing coverage data.
.br
Default is 0.
.PP
.BR geninfo_checksum " ="
.IR 0 | 1
.IP
If non\-zero, generate source code checksums when capturing coverage data.
Checksums are useful to prevent merging coverage data from incompatible
source code versions but checksum generation increases the size of coverage
files and the time used to generate those files.
.br
This option corresponds to the \-\-checksum and \-\-no\-checksum command line
option of
.BR geninfo .
.br
Default is 0.
.PP
.BR geninfo_compat_libtool " ="
.IR 0 | 1
.IP
If non\-zero, enable libtool compatibility mode. When libtool compatibility
mode is enabled, lcov will assume that the source code relating to a .da file
located in a directory named ".libs" can be found in its parent directory.
.br
This option corresponds to the \-\-compat\-libtool and \-\-no\-compat\-libtool
command line option of
.BR geninfo .
.br
Default is 1.
.PP
.BR geninfo_external " ="
.IR 0 | 1
.IP
If non\-zero, capture coverage data for external source files.
External source files are files which are not located in one of the directories
(including sub-directories)
specified by the \-\-directory or \-\-base\-directory options of
.BR lcov / geninfo .
Default is 1.
.PP
.BR geninfo_gcov_all_blocks " ="
.IR 0 | 1
.IP
If non\-zero, call the gcov tool with option --all-blocks.
Using --all-blocks will produce more detailed branch coverage information for
each line. Set this option to zero if you do not need detailed branch coverage
information to speed up the process of capturing code coverage or to work
around a bug in some versions of gcov which will cause it to endlessly loop
when analysing some files.
Default is 1.
.PP
.BR geninfo_compat " ="
.IR mode = value [, mode = value ,...]
.IP
Specify that geninfo should enable one or more compatibility modes
when capturing coverage data.
This option corresponds to the \-\-compat command line option of
.BR geninfo .
Default is 'libtool=on, hammer=auto, split_crc=auto'.
.PP
.BR geninfo_adjust_src_path " ="
.IR pattern " => " replacement
.br
.BR geninfo_adjust_src_path " ="
.I pattern
.IP
Adjust source paths when capturing coverage data.
Use this option in situations where geninfo cannot find the correct
path to source code files of a project. By providing a
.I pattern
in Perl regular expression format (see
.BR perlre (1))
and an optional replacement string, you can instruct geninfo to
remove or change parts of the incorrect source path.
.B Example:
.br
1. When geninfo reports that it cannot find source file
.br
/path/to/src/.libs/file.c
.br
while the file is actually located in
.br
/path/to/src/file.c
.br
use the following parameter:
.br
geninfo_adjust_src_path = /.libs
This will remove all "/.libs" strings from the path.
2. When geninfo reports that it cannot find source file
.br
/tmp/build/file.c
.br
while the file is actually located in
.br
/usr/src/file.c
.br
use the following parameter:
.br
geninfo_adjust_src_path = /tmp/build => /usr/src
.br
This will change all "/tmp/build" strings in the path to "/usr/src".
.PP
.BR geninfo_auto_base " ="
.IR 0 | 1
.IP
If non\-zero, apply a heuristic to determine the base directory when
collecting coverage data.
.br
Use this option when using geninfo on projects built with libtool or
similar build environments that work with multiple base directories,
i.e. environments, where the current working directory when invoking the
compiler ist not the same directory in which the source code file is
located, and in addition, is different between files of the same project.
.br
Default is 1.
.PP
.BR lcov_gcov_dir " ="
.I path_to_kernel_coverage_data
.IP
Specify the path to the directory where kernel coverage data can be found
or leave undefined for auto-detection.
.br
Default is auto-detection.
.PP
.BR lcov_tmp_dir " ="
.I temp
.IP
Specify the location of a directory used for temporary files.
.br
Default is '/tmp'.
.PP
.BR lcov_list_full_path " ="
.IR 0 | 1
.IP
If non-zero, print the full path to source code files during a list operation.
.br
This option corresponds to the \-\-list\-full\-path option of
.BR lcov .
.br
Default is 0.
.PP
.BR lcov_list_max_width " ="
.IR width
.IP
Specify the maximum width for list output. This value is ignored when
lcov_list_full_path is non\-zero.
.br
Default is 80.
.PP
.BR lcov_list_truncate_max
.B " ="
.IR percentage
.IP
Specify the maximum percentage of file names which may be truncated when
choosing a directory prefix in list output. This value is ignored when
lcov_list_full_path is non\-zero.
.br
Default is 20.
.PP
.BR lcov_function_coverage " ="
.IR 0 | 1
.IP
Specify whether lcov should handle function coverage data.
.br
Setting this option to 0 can reduce memory and CPU time consumption
when lcov is collecting and processing coverage data, as well as
reduce the size of the resulting data files. Note that setting
.B genhtml_function_coverage
will override this option for HTML generation.
.br
Default is 1.
.PP
.BR lcov_branch_coverage " ="
.IR 0 | 1
.IP
Specify whether lcov should handle branch coverage data.
.br
Setting this option to 0 can reduce memory and CPU time consumption
when lcov is collecting and processing coverage data, as well as
reduce the size of the resulting data files. Note that setting
.B genhtml_branch_coverage
will override this option for HTML generation.
.br
Default is 0.
.PP
.SH FILES
.TP
.I /etc/lcovrc
The system\-wide
.B lcov
configuration file.
.TP
.I ~/.lcovrc
The individual per\-user configuration file.
.PP
.SH SEE ALSO
.BR lcov (1),
.BR genhtml (1),
.BR geninfo (1),
.BR gcov (1)

View File

@ -1,51 +0,0 @@
Summary: A graphical GCOV front-end
Name: lcov
Version: 1.10
Release: 1
License: GPL
Group: Development/Tools
URL: http://ltp.sourceforge.net/coverage/lcov.php
Source0: http://downloads.sourceforge.net/ltp/lcov-%{version}.tar.gz
BuildRoot: /var/tmp/%{name}-%{version}-root
BuildArch: noarch
Requires: perl >= 5.8.8
%description
LCOV is a graphical front-end for GCC's coverage testing tool gcov. It collects
gcov data for multiple source files and creates HTML pages containing the
source code annotated with coverage information. It also adds overview pages
for easy navigation within the file structure.
%prep
%setup -q -n lcov-%{version}
%build
exit 0
%install
rm -rf $RPM_BUILD_ROOT
make install PREFIX=$RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
/usr/bin
/usr/share
/etc
%changelog
* Mon May 07 2012 Peter Oberparleiter (Peter.Oberparleiter@de.ibm.com)
- added dependency on perl 5.8.8 for >>& open mode support
* Wed Aug 13 2008 Peter Oberparleiter (Peter.Oberparleiter@de.ibm.com)
- changed description + summary text
* Mon Aug 20 2007 Peter Oberparleiter (Peter.Oberparleiter@de.ibm.com)
- fixed "Copyright" tag
* Mon Jul 14 2003 Peter Oberparleiter (Peter.Oberparleiter@de.ibm.com)
- removed variables for version/release to support source rpm building
- added initial rm command in install section
* Mon Apr 7 2003 Peter Oberparleiter (Peter.Oberparleiter@de.ibm.com)
- implemented variables for version/release
* Fri Oct 8 2002 Peter Oberparleiter (Peter.Oberparleiter@de.ibm.com)
- created initial spec file