提交 cb076b7c authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Update gyp and lcov deps

上级 22cc15a5
language: cpp
compiler:
- clang
matrix:
include:
- os: linux
compiler: clang
- os: osx
compiler: clang
- python: 2.7
language: python
before_install: pip install flake8
script: flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
- python: 3.7
language: python
before_install: pip install flake8
script: flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
dist: xenial # required for Python >= 3.7 (travis-ci/travis-ci#9069)
before_install: ./buildbot/travis-checkout.sh
script: ./buildbot/travis-test.sh
os:
- linux
- osx
branches:
only:
- master
......@@ -6,6 +6,7 @@
import os
import random
import sys
import gyp.common
......@@ -56,8 +57,11 @@ def MakeGuid(name, seed='msvs_new'):
determine the GUID to refer to explicitly. It also means that the GUID will
not change when the project for a target is rebuilt.
"""
to_hash = str(seed) + str(name)
to_hash = to_hash.encode('utf-8')
# Calculate a MD5 signature for the seed and name.
d = _new_md5(str(seed) + str(name)).hexdigest().upper()
d = _new_md5(to_hash).hexdigest().upper()
# Convert most of the signature to GUID form (discard the rest)
guid = ('{' + d[:8] + '-' + d[8:12] + '-' + d[12:16] + '-' + d[16:20]
+ '-' + d[20:32] + '}')
......@@ -71,6 +75,8 @@ class MSVSSolutionEntry(object):
# Sort by name then guid (so things are in order on vs2008).
return cmp((self.name, self.get_guid()), (other.name, other.get_guid()))
def __lt__(self, other):
return (self.name, self.get_guid()) < (other.name, other.get_guid())
class MSVSFolder(MSVSSolutionEntry):
"""Folder in a Visual Studio project or solution."""
......
......@@ -5,6 +5,7 @@
import re
import os
import locale
import sys
try:
# reduce moved to functools in python3.
......@@ -121,10 +122,12 @@ def WriteXmlIfChanged(content, path, encoding='utf-8', pretty=False,
xml_string = XmlToString(content, encoding, pretty)
if win32 and os.linesep != '\r\n':
xml_string = xml_string.replace('\n', '\r\n')
default_encoding = locale.getdefaultlocale()[1]
if default_encoding and default_encoding.upper() != encoding.upper():
xml_string = xml_string.decode(default_encoding).encode(encoding)
default_encoding = locale.getdefaultlocale()[1]
if default_encoding and default_encoding.upper() != encoding.upper():
try:
xml_string = xml_string.decode(default_encoding).encode(encoding)
except AttributeError:
pass
# Get the old content
try:
......
......@@ -2712,7 +2712,7 @@ def _GetMSBuildGlobalProperties(spec, version, guid, gyp_file_name):
platform_name = None
msvs_windows_sdk_version = None
for configuration in spec['configurations'].itervalues():
for configuration in spec['configurations'].values():
platform_name = platform_name or _ConfigPlatform(configuration)
msvs_windows_sdk_version = (msvs_windows_sdk_version or
_ConfigWindowsTargetPlatformVersion(configuration, version))
......
......@@ -621,7 +621,7 @@ class NinjaWriter(object):
args = action['action']
depfile = action.get('depfile', None)
if depfile:
depfile = self.ExpandSpecial(depfile, self.base_to_build)
depfile = self.ExpandSpecial(depfile)
pool = 'console' if int(action.get('ninja_use_console', 0)) else None
rule_name, _ = self.WriteNewNinjaRule(name, args, description,
is_cygwin, env, pool,
......
......@@ -16,8 +16,25 @@
'outputs': [
'output.txt',
],
'depfile': 'depfile.d',
'action': [ ]
'depfile': 'depfile_action.d',
'action': [
'python', 'touch.py', '<(PRODUCT_DIR)/<(_depfile)',
],
'msvs_cygwin_shell': 0,
},
{
'action_name': 'depfile_action_intermediate_dir',
'inputs': [
'input.txt',
],
'outputs': [
'output-intermediate.txt',
],
'depfile': '<(INTERMEDIATE_DIR)/depfile_action_intermediate_dir.d',
'action': [
'python', 'touch.py', '<(_depfile)',
],
'msvs_cygwin_shell': 0,
},
],
},
......
......@@ -7,6 +7,7 @@
"""Verifies that depfile fields are output in ninja rules."""
import TestGyp
import os
test = TestGyp.TestGyp()
......@@ -14,7 +15,16 @@ if test.format == 'ninja':
test.run_gyp('depfile.gyp')
contents = open(test.built_file_path('obj/depfile_target.ninja')).read()
expected = 'depfile = depfile.d'
if expected not in contents:
test.fail_test()
expected = [
'depfile = depfile_action.d',
'depfile = ' + os.path.join(
'obj', 'depfile_target.gen/depfile_action_intermediate_dir.d'),
]
test.must_contain_all_lines(contents, expected)
test.build('depfile.gyp')
test.built_file_must_exist('depfile_action.d')
test.built_file_must_exist(
'obj/depfile_target.gen/depfile_action_intermediate_dir.d')
test.pass_test()
#!/usr/bin/env python
#
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
"""Cross-platform touch."""
for fname in sys.argv[1:]:
if os.path.exists(fname):
os.utime(fname, None)
else:
if not os.path.exists(os.path.join('.', os.path.dirname(fname))):
os.makedirs(os.path.dirname(fname))
open(fname, 'w').close()
......@@ -63,8 +63,9 @@ list [1].
Contribution format
===================
To contribute a change, please create a patch using the diff utility with the
following command line options:
To contribute a change, please create a patch using 'git format-patch'.
Alternatively you can use the diff utility with the following command line
options:
diff -Naurp
......
......@@ -15,6 +15,10 @@ VERSION := $(shell bin/get_version.sh --version)
RELEASE := $(shell bin/get_version.sh --release)
FULL := $(shell bin/get_version.sh --full)
# Set this variable during 'make install' to specify the Perl interpreter used in
# installed scripts, or leave empty to keep the current interpreter.
export LCOV_PERL_PATH := /usr/bin/perl
PREFIX := /usr/local
CFG_DIR := $(PREFIX)/etc
......
-------------------------------------------------
- README file for the LTP GCOV extension (LCOV) -
- Last changes: 2015-10-05 -
- Last changes: 2016-12-19 -
-------------------------------------------------
Description
......
#!/bin/bash
#!/usr/bin/env bash
#
# Usage: copy_dates.sh SOURCE TARGET
#
......
#!/usr/bin/perl -w
#!/usr/bin/env perl
#
# Copyright (c) International Business Machines Corp., 2002
#
......@@ -36,6 +36,7 @@
#
use strict;
use warnings;
use File::Basename;
use Getopt::Long;
use Cwd qw/abs_path/;
......
#!/usr/bin/perl -w
#!/usr/bin/env perl
#
# Copyright (c) International Business Machines Corp., 2002,2012
#
......@@ -65,6 +65,7 @@
#
use strict;
use warnings;
use File::Basename;
use File::Temp qw(tempfile);
use Getopt::Long;
......@@ -154,6 +155,9 @@ our $BR_CLOSE = 5;
our $BR_SUB = 0;
our $BR_ADD = 1;
# Block value used for unnamed blocks
our $UNNAMED_BLOCK = vec(pack('b*', 1 x 32), 0, 32);
# Error classes which users may specify to ignore during processing
our $ERROR_SOURCE = 0;
our %ERROR_ID = (
......@@ -234,7 +238,7 @@ sub write_test_table_epilog(*);
sub write_source($$$$$$$);
sub write_source_prolog(*);
sub write_source_line(*$$$$$$);
sub write_source_line(*$$$$$);
sub write_source_epilog(*);
sub write_frameset(*$$$);
......@@ -287,6 +291,7 @@ our @opt_ignore_errors; # Ignore certain error classes during processing
our @ignore;
our $opt_config_file; # User-specified configuration file location
our %opt_rc;
our $opt_missed; # List/sort lines by missed counts
our $charset = "UTF-8"; # Default charset for HTML pages
our @fileview_sortlist;
our @fileview_sortname = ("", "-sort-l", "-sort-f", "-sort-b");
......@@ -374,6 +379,7 @@ if ($config || %opt_rc)
"genhtml_charset" => \$charset,
"genhtml_desc_html" => \$rc_desc_html,
"genhtml_demangle_cpp" => \$demangle_cpp,
"genhtml_missed" => \$opt_missed,
"lcov_function_coverage" => \$lcov_func_coverage,
"lcov_branch_coverage" => \$lcov_branch_coverage,
});
......@@ -420,6 +426,7 @@ if (!GetOptions("output-directory|o=s" => \$output_directory,
"config-file=s" => \$opt_config_file,
"rc=s%" => \%opt_rc,
"precision=i" => \$default_precision,
"missed" => \$opt_missed,
))
{
print(STDERR "Use $tool_name --help to get usage information\n");
......@@ -621,6 +628,7 @@ HTML output:
--(no-)sort Enable (disable) sorted coverage views
--demangle-cpp Demangle C++ function names
--precision NUM Set precision of coverage rate
--missed Show miss counts as negative numbers
For more information see: $lcov_url
END_OF_USAGE
......@@ -1620,6 +1628,7 @@ sub read_info_file($)
($1, $2, $3, $4);
last if (!$br_coverage);
$block = -1 if ($block == $UNNAMED_BLOCK);
$sumbrcount->{$line} .=
"$block,$branch,$taken:";
......@@ -2621,9 +2630,18 @@ sub get_date_string()
my $hour;
my $min;
my $sec;
my @timeresult;
if (defined $ENV{'SOURCE_DATE_EPOCH'})
{
@timeresult = gmtime($ENV{'SOURCE_DATE_EPOCH'});
}
else
{
@timeresult = localtime();
}
($year, $month, $day, $hour, $min, $sec) =
(localtime())[5, 4, 3, 2, 1, 0];
@timeresult[5, 4, 3, 2, 1, 0];
return sprintf("%d-%02d-%02d %02d:%02d:%02d", $year+1900, $month+1,
$day, $hour, $min, $sec);
......@@ -3732,6 +3750,10 @@ END_OF_HTML
$class = $rate_name[classify_rate($found, $hit,
$med, $hi)];
}
if ($opt_missed) {
# Show negative number of items without coverage
$hit = -($found - $hit);
}
write_html($handle, <<END_OF_HTML);
<td class="coverPer$class">$rate</td>
<td class="coverNum$class">$hit / $found</td>
......@@ -4137,16 +4159,15 @@ sub format_count($$)
#
# write_source_line(filehandle, line_num, source, hit_count, converted,
# brdata, add_anchor)
# brdata)
#
# Write formatted source code line. Return a line in a format as needed
# by gen_png()
#
sub write_source_line(*$$$$$$)
sub write_source_line(*$$$$$)
{
my ($handle, $line, $source, $count, $converted, $brdata,
$add_anchor) = @_;
my ($handle, $line, $source, $count, $converted, $brdata) = @_;
my $source_format;
my $count_format;
my $result;
......@@ -4183,11 +4204,8 @@ sub write_source_line(*$$$$$$)
# Write out a line number navigation anchor every $nav_resolution
# lines if necessary
if ($add_anchor)
{
$anchor_start = "<a name=\"$_[1]\">";
$anchor_end = "</a>";
}
$anchor_start = "<a name=\"$_[1]\">";
$anchor_end = "</a>";
# *************************************************************
......@@ -4632,10 +4650,57 @@ END_OF_HTML
write_header_epilog(*HTML_HANDLE, $base_dir);
}
sub get_sorted_by_rate($$)
{
my ($hash, $type) = @_;
if ($type == $SORT_LINE) {
# Sort by line coverage
return sort({$hash->{$a}[7] <=> $hash->{$b}[7]} keys(%{$hash}));
} elsif ($type == $SORT_FUNC) {
# Sort by function coverage;
return sort({$hash->{$a}[8] <=> $hash->{$b}[8]} keys(%{$hash}));
} elsif ($type == $SORT_BRANCH) {
# Sort by br coverage;
return sort({$hash->{$a}[9] <=> $hash->{$b}[9]} keys(%{$hash}));
}
}
sub get_sorted_by_missed($$)
{
my ($hash, $type) = @_;
if ($type == $SORT_LINE) {
# Sort by number of instrumented lines without coverage
return sort(
{
($hash->{$b}[0] - $hash->{$b}[1]) <=>
($hash->{$a}[0] - $hash->{$a}[1])
} keys(%{$hash}));
} elsif ($type == $SORT_FUNC) {
# Sort by number of instrumented functions without coverage
return sort(
{
($hash->{$b}[2] - $hash->{$b}[3]) <=>
($hash->{$a}[2] - $hash->{$a}[3])
} keys(%{$hash}));
} elsif ($type == $SORT_BRANCH) {
# Sort by number of instrumented branches without coverage
return sort(
{
($hash->{$b}[4] - $hash->{$b}[5]) <=>
($hash->{$a}[4] - $hash->{$a}[5])
} keys(%{$hash}));
}
}
#
# get_sorted_keys(hash_ref, sort_type)
#
# hash_ref: filename -> stats
# stats: [ lines_found, lines_hit, fn_found, fn_hit, br_found, br_hit,
# link_name, line_rate, fn_rate, br_rate ]
#
sub get_sorted_keys($$)
{
......@@ -4644,15 +4709,10 @@ sub get_sorted_keys($$)
if ($type == $SORT_FILE) {
# Sort by name
return sort(keys(%{$hash}));
} elsif ($type == $SORT_LINE) {
# Sort by line coverage
return sort({$hash->{$a}[7] <=> $hash->{$b}[7]} keys(%{$hash}));
} elsif ($type == $SORT_FUNC) {
# Sort by function coverage;
return sort({$hash->{$a}[8] <=> $hash->{$b}[8]} keys(%{$hash}));
} elsif ($type == $SORT_BRANCH) {
# Sort by br coverage;
return sort({$hash->{$a}[9] <=> $hash->{$b}[9]} keys(%{$hash}));
} elsif ($opt_missed) {
return get_sorted_by_missed($hash, $type);
} else {
return get_sorted_by_rate($hash, $type);
}
}
......@@ -5067,7 +5127,6 @@ sub write_source($$$$$$$)
my $funcdata = $_[5];
my $sumbrcount = $_[6];
my $datafunc = get_hash_reverse($funcdata);
my $add_anchor;
my @file;
if ($_[2])
......@@ -5118,25 +5177,11 @@ sub write_source($$$$$$$)
"$line_number\n");
}
$add_anchor = 0;
if ($frames) {
if (($line_number - 1) % $nav_resolution == 0) {
$add_anchor = 1;
}
}
if ($func_coverage) {
if ($line_number == 1) {
$add_anchor = 1;
} elsif (defined($datafunc->{$line_number +
$func_offset})) {
$add_anchor = 1;
}
}
push (@result,
write_source_line(HTML_HANDLE, $line_number,
$_, $count_data{$line_number},
$converted->{$line_number},
$sumbrcount->{$line_number}, $add_anchor));
$sumbrcount->{$line_number}));
}
close(SOURCE_HANDLE);
......
#!/usr/bin/perl -w
#!/usr/bin/env perl
#
# Copyright (c) International Business Machines Corp., 2002
#
......@@ -30,6 +30,7 @@
#
use strict;
use warnings;
use File::Basename;
use Getopt::Long;
use Cwd qw/abs_path/;
......
#!/bin/bash
#!/usr/bin/env bash
#
# Usage: get_changes.sh
#
# Print lcov change log information as provided by Git
TOOLDIR=$(cd $(dirname $0) ; pwd)
TOOLDIR=$(cd $(dirname $0) >/dev/null ; pwd)
cd $TOOLDIR
......
#!/bin/bash
#!/usr/bin/env bash
#
# Usage: get_version.sh --version|--release|--full
#
# Print lcov version or release information as provided by Git, .version
# or a fallback.
TOOLDIR=$(cd $(dirname $0) ; pwd)
TOOLDIR=$(cd $(dirname $0) >/dev/null ; pwd)
GITVER=$(cd $TOOLDIR ; git describe --tags 2>/dev/null)
if [ -z "$GITVER" ] ; then
......
#!/bin/bash
#!/usr/bin/env bash
#
# install.sh [--uninstall] sourcefile targetfile [install options]
#
......@@ -36,6 +36,10 @@ do_install()
install -d $(dirname $TARGET)
install -p $PARAMS $SOURCE $TARGET
if [ -n "$LCOV_PERL_PATH" ] ; then
# Replace Perl interpreter specification
sed -e "1 s%^#\!.*perl.*$%#\!$LCOV_PERL_PATH%" -i $TARGET
fi
}
......@@ -51,7 +55,7 @@ do_uninstall()
# Does target exist?
if test -r $TARGET ; then
# Is target of the same version as this package?
if diff -I '^our \$lcov_version' -I '^\.TH ' $SOURCE $TARGET >/dev/null; then
if diff -I '^our \$lcov_version' -I '^\.TH ' -I '^#!' $SOURCE $TARGET >/dev/null; then
rm -f $TARGET
else
echo WARNING: Skipping uninstall for $TARGET - versions differ! >&2
......
#!/usr/bin/perl -w
#!/usr/bin/env perl
#
# Copyright (c) International Business Machines Corp., 2002,2012
#
......@@ -60,6 +60,7 @@
#
use strict;
use warnings;
use File::Basename;
use File::Path;
use File::Find;
......@@ -2153,7 +2154,7 @@ sub brcount_to_db($)
{
my ($brcount) = @_;
my $line;
my $db;
my $db = {};
# Add branches to database
foreach $line (keys(%{$brcount})) {
......
#!/usr/bin/perl -w
#!/usr/bin/env perl
use strict;
use warnings;
use File::Basename;
......
......@@ -96,6 +96,9 @@ genhtml_desc_html=0
# Specify the precision for coverage rates
#genhtml_precision=1
# Show missed counts instead of hit counts
#genhtml_missed=1
# Demangle C++ symbols
#genhtml_demangle_cpp=1
......@@ -131,6 +134,9 @@ genhtml_desc_html=0
# when collecting coverage data.
geninfo_auto_base = 1
# Use gcov intermediate format? Valid values are 0, 1, auto
geninfo_intermediate = auto
# Directory containing gcov kernel files
# lcov_gcov_dir = /proc/gcov
......
.TH gendesc 1 "LCOV 1.13" 2015\-10\-05 "User Manuals"
.TH gendesc 1 "LCOV 1.14" 2016\-12\-19 "User Manuals"
.SH NAME
gendesc \- Generate a test case description file
.SH SYNOPSIS
......
.TH genhtml 1 "LCOV 1.13" 2015\-10\-05 "User Manuals"
.TH genhtml 1 "LCOV 1.14" 2018\-01\-30 "User Manuals"
.SH NAME
genhtml \- Generate HTML view from LCOV coverage data files
.SH SYNOPSIS
......@@ -66,6 +66,7 @@ genhtml \- Generate HTML view from LCOV coverage data files
.br
.RB [ \-\-precision
.IR num ]
.RB [ \-\-missed ]
.br
.IR tracefile(s)
.RE
......@@ -561,6 +562,21 @@ option
.IR genhtml_precision .
.RE
.B \-\-missed
.RS
Show counts of missed lines, functions, or branches
Use this option to change overview pages to show the count of lines, functions,
or branches that were not hit. These counts are represented by negative numbers.
When specified together with \-\-sort, file and directory views will be sorted
by missed counts.
This option can also be configured permanently using the configuration file
option
.IR genhtml_missed .
.RE
.SH FILES
.I /etc/lcovrc
......
.TH geninfo 1 "LCOV 1.13" 2015\-10\-05 "User Manuals"
.TH geninfo 1 "LCOV 1.14" 2017\-10\-10 "User Manuals"
.SH NAME
geninfo \- Generate tracefiles from .da files
.SH SYNOPSIS
......
.TH genpng 1 "LCOV 1.13" 2015\-10\-05 "User Manuals"
.TH genpng 1 "LCOV 1.14" 2016\-12\-19 "User Manuals"
.SH NAME
genpng \- Generate an overview image from a source file
.SH SYNOPSIS
......
.TH lcov 1 "LCOV 1.13" 2015\-10\-05 "User Manuals"
.TH lcov 1 "LCOV 1.14" 2017\-10\-10 "User Manuals"
.SH NAME
lcov \- a graphical GCOV front\-end
.SH SYNOPSIS
......
.TH lcovrc 5 "LCOV 1.13" 2015\-10\-05 "User Manuals"
.TH lcovrc 5 "LCOV 1.14" 2018\-01\-30 "User Manuals"
.SH NAME
lcovrc \- lcov configuration file
......@@ -159,6 +159,11 @@ genhtml_desc_html=0
#genhtml_precision=1
.br
# Show missed counts instead of hit counts
.br
#genhtml_missed=1
.br
# Demangle C++ symbols
.br
#genhtml_demangle_cpp=1
......@@ -218,6 +223,11 @@ geninfo_compat_libtool = 0
geninfo_auto_base = 1
.br
# Use gcov intermediate format? Valid values are 0, 1, auto
.br
geninfo_intermediate = auto
.br
# Directory containing gcov kernel files
.br
lcov_gcov_dir = /proc/gcov
......@@ -604,6 +614,16 @@ displaying coverage rates.
Default is 1.
.PP
.BR genhtml_missed " ="
.IR 0 | 1
.IP
If non-zero, the count of missed lines, functions, or branches is shown
as negative numbers in overview pages.
.br
Default is 0.
.PP
.
.BR geninfo_gcov_tool " ="
.I path_to_gcov
......@@ -774,6 +794,25 @@ located, and in addition, is different between files of the same project.
Default is 1.
.PP
.BR geninfo_intermediate " ="
.IR 0 | 1 | auto
.IP
Specify whether to use gcov intermediate format
.br
Use this option to control whether geninfo should use the gcov intermediate
format while collecting coverage data. The use of the gcov intermediate format
should increase processing speed. It also provides branch coverage data when
using the \-\-initial command line option.
.br
Valid values are 0 for off, 1 for on, and "auto" to let geninfo automatically
use immediate format when supported by gcov.
.br
Default is "auto".
.PP
.BR lcov_gcov_dir " ="
.I path_to_kernel_coverage_data
.IP
......
Summary: A graphical GCOV front-end
Name: lcov
Version: 1.13
Version: 1.14
Release: 1
License: GPLv2+
Group: Development/Tools
......
#!/usr/bin/perl
#!/usr/bin/env perl
#
# Copyright IBM Corp. 2017
#
......
#!/usr/bin/perl
#!/usr/bin/env perl
#
# Copyright IBM Corp. 2017
#
......
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright IBM Corp. 2017
#
......
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright IBM Corp. 2017
#
......
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright IBM Corp. 2017
#
......
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright IBM Corp. 2017
#
......
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright IBM Corp. 2017
#
......
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright IBM Corp. 2017
#
......
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright IBM Corp. 2017
#
......
#!/usr/bin/perl
#!/usr/bin/env perl
#
# Copyright IBM Corp. 2017
#
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论