diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..49baf65 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,29 @@ +# +# Copyright (c) 2024 Sebastian Pipping +# +# 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, see +# . +# +version: 2 +updates: + + - package-ecosystem: "github-actions" + commit-message: + include: "scope" + prefix: "Actions" + directory: "/" + labels: + - "enhancement" + schedule: + interval: "weekly" diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000..30ac78c --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,45 @@ +# +# Copyright (c) 2024 Sebastian Pipping +# +# 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, see +# . +# +name: Enforce codespell-clean spelling + +on: + pull_request: + push: + schedule: + - cron: '0 14 * * 5' # Every Friday 2pm + workflow_dispatch: + +# Drop permissions to minimum for security +permissions: + contents: read + +jobs: + codespell: + name: Enforce codespell-clean spelling + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + + - uses: codespell-project/actions-codespell@v2 + with: + # "bu" is man page markup (file man/genhtml.1 and man/lcov.1) + # "MIS" is an abbreviation code of "Missed" (file bin/genhtml) + # "nd" is variable $nd (file bin/genhtml) + # "numbrs" is a variable name related to "branches" (file tests/bin/mkinfo) + # Words need to be (1) separated by a comma and (2) all lowercase! + ignore_words_list: bu,mis,nd,numbrs diff --git a/.github/workflows/run_test_suite.yml b/.github/workflows/run_test_suite.yml new file mode 100644 index 0000000..6ebe235 --- /dev/null +++ b/.github/workflows/run_test_suite.yml @@ -0,0 +1,98 @@ +# +# Copyright (c) 2024 Sebastian Pipping +# +# 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, see +# . +# +name: Run the test suite + +on: + pull_request: + push: + schedule: + - cron: '0 14 * * 5' # Every Friday 2pm + workflow_dispatch: + +# Drop permissions to minimum for security +permissions: + contents: read + +jobs: + test_suite: + name: Run the test suite + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: |- + ubuntu_packages=( + # Perl runtime dependencies as documented in README + libcapture-tiny-perl # CPAN Capture::Tiny + libdatetime-perl # CPAN DateTime + libdevel-cover-perl # CPAN Devel::Cover + libdigest-md5-file-perl # CPAN Digest::MD5 + libfile-spec-native-perl # CPAN File::Spec + libjson-xs-perl # CPAN JSON::XS + # CPAN Memory::Process, see below + # CPAN Module::Load::Conditional + libscalar-list-utils-perl # CPAN Scalar::Util + # CPAN Time::HiRes + + # Non-Perl runtime dependencies as documented in README + llvm # for command "llvm-profdata" + python3-coverage # PyPI coverage + python3-xlsxwriter # PyPI xlsxwriter + + # Additional dependencies for "make check" + libgd-perl # CPAN GD + ) + set -x + + sudo apt-get update + sudo apt-get install --no-install-recommends --yes -V "${ubuntu_packages[@]}" + + sudo perl -MCPAN -e 'install(Memory::Process)' # no package in Ubuntu + + sudo ln -s python3-coverage /usr/bin/coverage # until issue #347 is fixed + + - name: make install + run: |- + set -x -o pipefail + make install PREFIX=/usr CFG_DIR=/etc DESTDIR="${PWD}/ROOT" + find ROOT/ | sort | xargs -r ls -ld + + - name: make uninstall + run: |- + set -x -o pipefail + make uninstall PREFIX=/usr CFG_DIR=/etc DESTDIR="${PWD}/ROOT" + find ROOT/ | sort | xargs -r ls -ld + diff -u0 <(echo 'total 0') <(ls -l ROOT/) # i.e. fail CI if leftovers + + - name: make check + run: |- + set -x -o pipefail + # NOTE: There are two things going on in this hackery: + # - So far "make check" exits with code 0 despite failures — + # see issue #348 — so we need a more manual approach to detect + # failing tests + # - We compare the number of failing tests to the known status + # quo — see issue #343 — so that + # - we have a chance for a green CI while also + # - we will notice when more of the existing tests start + # to fail. + make check |& tee /dev/stderr \ + | grep -F ' failed, ' | tee /dev/stderr \ + | grep -F -q ', 3 failed, ' \ + || { echo 'Number of tests expected to fail^^ does not match -- did you break an existing test?' >&2 ; false ; } diff --git a/README b/README index 6890957..c90ad47 100644 --- a/README +++ b/README @@ -450,7 +450,7 @@ LCOV features and capabilities fall into 7 major categories: to lcov format. See "llvm2lcov --help" for brief instruction on how to use the - translator. Note tha llvm2lcov uses a similar set of command line + translator. Note that llvm2lcov uses a similar set of command line and configuration file options as lcov, genhtml, and geninfo. - py2lcov: diff --git a/bin/genhtml b/bin/genhtml index e545aa3..fb52217 100755 --- a/bin/genhtml +++ b/bin/genhtml @@ -1909,7 +1909,7 @@ sub secondaryElementFileData } package CovTypeSummaryCallback; -# callback class to return total branches in each TLA categroy +# callback class to return total branches in each TLA category sub new { my ($class, $summary, $covType) = @_; @@ -6162,7 +6162,7 @@ sub compute_one !$main::show_tla) { $summary->[SummaryInfo::FILE_DETAILS] = undef; } elsif ($main::show_tla) { - # just store the location fo the first coverpoint in each display + # just store the location of the first coverpoint in each display # group - rather than returning the whole detail structure? $summary->[SummaryInfo::FILE_DETAILS]->simplify(); } diff --git a/example/Makefile b/example/Makefile index 770c5e8..3a5435e 100644 --- a/example/Makefile +++ b/example/Makefile @@ -212,7 +212,7 @@ test_differential: @echo "point your browser to `realpath $(REPO)`/differential/index.html" @echo "Step 7: Generate subset report for code review:" - @echo " (re-use revision control data cached in previous step)" + @echo " (reuse revision control data cached in previous step)" (cd $(REPO) ; \ $(GENHTML) -o review --baseline-file baseline.info \ --diff-file udiff.txt --show-owners \ diff --git a/lcovrc b/lcovrc index 32b6510..fcab010 100644 --- a/lcovrc +++ b/lcovrc @@ -435,7 +435,7 @@ mcdc_coverage = 0 # specify path to version identification script #version_script = path_to_my_executable -# tell the tool to genenerate missing file version information when +# tell the tool to generate missing file version information when # readind coverage DB file # compute_file_version = 0 | 1 @@ -458,7 +458,7 @@ lcov_json_module = auto # giving up # max_fork_fails = 5 -# Throtting control: the maximum number of files that genhtml will +# Throttling control: the maximum number of files that genhtml will # handle in a single (parallel) thread # max_tasks_per_core = 20 diff --git a/lib/lcovutil.pm b/lib/lcovutil.pm index e8907f2..7d96303 100644 --- a/lib/lcovutil.pm +++ b/lib/lcovutil.pm @@ -7946,7 +7946,7 @@ sub _processParallelChunk # collect pattern counts my @pcounts; foreach my $l (@{$save->[0]}) { - my @c = map({ $_->[-1] } @$l); # grap the counts + my @c = map({ $_->[-1] } @$l); # grab the counts push(@pcounts, \@c); } $save->[0] = \@pcounts; diff --git a/man/lcov.1 b/man/lcov.1 index 83db8f4..6af8457 100644 --- a/man/lcov.1 +++ b/man/lcov.1 @@ -791,7 +791,7 @@ Apply all substitution patterns in order - the result of the first pattern is us If a file corresponding to the resulting name exists: return it. .PP .IP 3. 3 -Apply the 'resolve' callback ot the final result of pattern substitutions. +Apply the 'resolve' callback to the final result of pattern substitutions. .br If a file corresponding to the resulting name exists: return it. .PP diff --git a/man/lcovrc.5 b/man/lcovrc.5 index 7132fbb..77248b9 100644 --- a/man/lcovrc.5 +++ b/man/lcovrc.5 @@ -2843,7 +2843,7 @@ the config file entry or .I \-\-source\=directory -command line option, used to searh for source files. +command line option, used to search for source files. .PP .RE @@ -2903,7 +2903,7 @@ The select script is called as: .B " select_script" [callback_args] -.I lineDataJson annotateDataJson filenName lineNumber +.I lineDataJson annotateDataJson fileName lineNumber or as: diff --git a/scripts/p4annotate.pm b/scripts/p4annotate.pm index 45df682..1ab0dd2 100644 --- a/scripts/p4annotate.pm +++ b/scripts/p4annotate.pm @@ -37,7 +37,7 @@ # of cached files - and may result in out-of-sync annotated file data. # # The '--verify' flag tells the tool to do some additional consistency -# checking whe merging local edits into the annotated file. +# checking when merging local edits into the annotated file. # # The '--log' flag specifies a file where the tool writes various annotation- # related log messages. diff --git a/tests/lcov/errs/errs.sh b/tests/lcov/errs/errs.sh index 97cabcd..7d1c57e 100755 --- a/tests/lcov/errs/errs.sh +++ b/tests/lcov/errs/errs.sh @@ -309,7 +309,7 @@ fi # data consistency errors: # - function marked 'hit' but no contained lines are hit # - function marked 'not hit' but some contained line is hit -# - line marked 'hit' but no contained braches have been evaluated +# - line marked 'hit' but no contained branches have been evaluated # - line marked 'not hit' but at least one contained branch has been evaluated for i in funcNoLine lineNoFunc branchNoLine lineNoBranch ; do diff --git a/tests/lcov/extract/testContext.sh b/tests/lcov/extract/testContext.sh index 191d286..9de72fc 100755 --- a/tests/lcov/extract/testContext.sh +++ b/tests/lcov/extract/testContext.sh @@ -1,7 +1,7 @@ #!/bin/sh if [ 'die' = "$1" ] ; then - echo "dieing" + echo "dying" exit 1 fi