Skip to content

Commit

Permalink
Merge branch 'main' into block-scalars
Browse files Browse the repository at this point in the history
  • Loading branch information
pcolby committed Feb 16, 2024
2 parents 962483d + 4cd6558 commit 41468aa
Show file tree
Hide file tree
Showing 17 changed files with 658 additions and 29 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/expected/default.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
| Test result | Passed | Failed | Skipped | Test name |
|:------------------------|-------:|-------:|--------:|:-------------------------|
| :heavy_check_mark: pass | 2618 | 0 | 182 | TestAbstractCommand |
| :heavy_check_mark: pass | 5 | 0 | 0 | bml.log |
| :heavy_check_mark: pass | 6 | 0 | 0 | bt_cmd.log |
| :x: fail | 320 | 5 | 0 | bt_core.log |
| :x: fail | 3 | 110 | 0 | bt_edit.log |
| :heavy_check_mark: pass | 95 | 0 | 0 | bt_gst.log |
| :heavy_check_mark: pass | 15 | 0 | 0 | bt_ic.log |
| :heavy_check_mark: pass | 2800 | 0 | 182 | TestAbstractCommand |
| :heavy_check_mark: pass | 1092 | 0 | 0 | TestAbstractPokitService |
| :heavy_check_mark: pass | 126 | 0 | 0 | TestCalibrateCommand |
| :heavy_check_mark: pass | 420 | 0 | 0 | TestCalibrationService |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/expected/path.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
| Test result | Passed | Failed | Skipped | Test name |
|:------------------------|-------:|-------:|--------:|:-------------------------|
| :heavy_check_mark: pass | 90 | 0 | 26 | TestAbstractCommand |
| :heavy_check_mark: pass | 116 | 0 | 26 | TestAbstractCommand |
| :heavy_check_mark: pass | 52 | 0 | 0 | TestAbstractPokitService |
| :heavy_check_mark: pass | 6 | 0 | 0 | TestCalibrateCommand |
| :heavy_check_mark: pass | 20 | 0 | 0 | TestCalibrationService |
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-FileCopyrightText: 2022-2024 Paul Colby <git@colby.id.au>
# SPDX-License-Identifier: MIT

name: Lint Checks

on: [push, pull_request]

jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: shellcheck --enable=all --norc test/test.sh
4 changes: 3 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2022 Paul Colby <git@colby.id.au>
# SPDX-FileCopyrightText: 2022-2024 Paul Colby <git@colby.id.au>
# SPDX-License-Identifier: MIT

name: Automatic Tests
Expand All @@ -22,6 +22,7 @@ jobs:
- macos-11
- macos-12
- macos-13
- macos-14
- ubuntu-20.04
- ubuntu-22.04
- windows-2019
Expand Down Expand Up @@ -106,6 +107,7 @@ jobs:
- macos-11
- macos-12
- macos-13
- macos-14
- ubuntu-20.04
- ubuntu-22.04
- windows-2019
Expand Down
2 changes: 1 addition & 1 deletion .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2022 Paul Colby <git@colby.id.au>
# SPDX-FileCopyrightText: 2022-2024 Paul Colby <git@colby.id.au>
# SPDX-License-Identifier: MIT

extends: default
Expand Down
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.1.0] (2024-02-11)

### Changed

- Increased support for non-QtTest (but still valid) TAP files ([#2])

### Fixed

- Total 'pass' count was incorrectly deducting 'skip' count.

## [1.0.1] (2023-03-29)

### Changed
Expand All @@ -20,9 +30,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Support for summarising [Qt Test] [TAP] files.
- Automated tests on all supported GitHub-hosted runners (`macos-*`, `ubuntu-*` and `windows-*`).

[unreleased]: https://github.com/pcolby/tap-summary/compare/v1.0.1...HEAD
[unreleased]: https://github.com/pcolby/tap-summary/compare/v1.1.0...HEAD
[1.1.0]: https://github.com/pcolby/tap-summary/releases/tag/v1.1.0
[1.0.1]: https://github.com/pcolby/tap-summary/releases/tag/v1.0.1
[1.0.0]: https://github.com/pcolby/tap-summary/releases/tag/v1.0.0

[#2]: https://github.com/pcolby/tap-summary/issues/2
[TAP]: https://testanything.org/ "Test Anything Protocol"
[Qt Test]: https://doc.qt.io/qt-6/qtest-overview.html "Qt Test Overview"
4 changes: 2 additions & 2 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: 2022 Paul Colby <git@colby.id.au>
# SPDX-FileCopyrightText: 2022-2024 Paul Colby <git@colby.id.au>
# SPDX-License-Identifier: MIT

name: Summary Test Results
name: Summarize Test Results

author: Paul Colby

Expand Down
45 changes: 32 additions & 13 deletions summary.gawk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2022 Paul Colby <git@colby.id.au>
# SPDX-FileCopyrightText: 2022-2024 Paul Colby <git@colby.id.au>
# SPDX-License-Identifier: MIT
#
# Summarise a set of QTest TAP (Test Anything Protocol) output files as a
Expand All @@ -16,23 +16,43 @@ BEGIN {
maxNameLength = 0
}

FNR==2 {
testName = $2
# Reset the test name at the beginning of each TAP file.
BEGINFILE {
testName=""
}

# If we have test results, and no test name yet, default to the current TAP file name.
/^(not )?ok .*/ && !testName {
name=FILENAME
sub("^.*/", "", name)
sub(".tap$", "", name)
setTestName(name)
}

# QtTest sets the test name on the second line of the TAP file.
FNR==2 && NF==2 && $1=="#" {
setTestName($2)
}

function setTestName(name) {
testName=name
if (length(testName) > maxNameLength)
maxNameLength = length(testName)
if (!(testName in tests)) {
tests[testName]["skip"] = 0
tests[testName]["pass"] = 0
tests[testName]["fail"] = 0
}
}

/^ok .*[^\\]#\s*SKIP/{
# Handle skipped tests.
/^ok .*[^\\]#\s*SKIP/ {
tests[testName]["skip"]++
}

/^#\s*(pass|fail)\s+[0-9]+$/ {
tests[testName][$2] += $3
# Handle passed (but not skipped) tests.
/^ok / && !/^ok .*[^\\]#\s*SKIP/ {
tests[testName]["pass"]++
}

# Handle failed tests.
/^not ok / {
tests[testName]["fail"]++
}

END {
Expand All @@ -45,8 +65,7 @@ END {
printf "| %-18s %4s | %6u | %6u | %7u | %-*s |\n",
(tests[name]["fail"]) ? ":x:" : ":heavy_check_mark:",
(tests[name]["fail"]) ? "fail" : "pass",
tests[name]["pass"] - tests[name]["skip"],
tests[name]["fail"], tests[name]["skip"],
tests[name]["pass"], tests[name]["fail"], tests[name]["skip"],
maxNameLength, name
}
}
6 changes: 6 additions & 0 deletions test/buzztrax-7856445010/bml.log.tap
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ok 1 - tests/lib/bml/e-core.c:BmlCoreExamples:test_bml_setup: Passed
ok 2 - tests/lib/bml/e-core.c:BmlCoreExamples:test_bml_finalize: Passed
ok 3 - tests/lib/bml/e-core.c:BmlCoreExamples:test_bmln_master_info: Passed
ok 4 - tests/lib/bml/e-core.c:BmlCoreExamples:test_bmln_open: Passed
ok 5 - tests/lib/bml/e-class.c:BmlClassExamples:test_bmln_get_machine_info: Passed
1..5
7 changes: 7 additions & 0 deletions test/buzztrax-7856445010/bt_cmd.log.tap
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ok 1 - tests/ui/cmd/e-cmd-application.c:BtCmdApplicationExamples:test_bt_cmd_application_create: Passed
ok 2 - tests/ui/cmd/e-cmd-application.c:BtCmdApplicationExamples:test_bt_cmd_application_play: Passed
ok 3 - tests/ui/cmd/e-cmd-application.c:BtCmdApplicationExamples:test_bt_cmd_application_play_two_files: Passed
ok 4 - tests/ui/cmd/e-cmd-application.c:BtCmdApplicationExamples:test_bt_cmd_application_play_incomplete_file: Passed
ok 5 - tests/ui/cmd/e-cmd-application.c:BtCmdApplicationExamples:test_bt_cmd_application_info: Passed
ok 6 - tests/ui/cmd/e-cmd-application.c:BtCmdApplicationExamples:test_bt_cmd_application_info_for_incomplete_file: Passed
1..6
Loading

0 comments on commit 41468aa

Please sign in to comment.