Skip to content

Commit a0e944e

Browse files
feat: test runner engine rework to support dry running and step statistics (#69)
--------- Co-authored-by: Richard Peters <[email protected]> Co-authored-by: Richard Peters <[email protected]>
1 parent 04144b8 commit a0e944e

File tree

91 files changed

+2619
-1332
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+2619
-1332
lines changed

.clangd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ CompileFlags:
33
CompilationDatabase: .build/
44
Diagnostics:
55
UnusedIncludes: Strict
6+
MissingIncludes: Strict
67
ClangTidy:
78
Add: []
89
Remove: []

.devcontainer/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
FROM ghcr.io/philips-software/amp-devcontainer-cpp:5.1.3@sha256:a2a0ec9e240078be2302858721a3c0d904a1cce602847349245ee186cdd166ec
1+
FROM ghcr.io/philips-software/amp-devcontainer-cpp:5.2.0@sha256:c47fcc83b59fb08f3a3a6e591b18bad49b3862acc35770fca6cec9ad0adb9cb2
2+
3+
HEALTHCHECK NONE

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"vscode": {
1010
"extensions": [
1111
"alexkrechik.cucumberautocomplete",
12-
"akiramiyakoda.cppincludeguard"
12+
"akiramiyakoda.cppincludeguard",
13+
"github.vscode-github-actions"
1314
]
1415
}
1516
}

.github/workflows/ci.yml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
build-windows:
2525
name: Windows Host Build
2626
runs-on: [ubuntu-latest]
27-
container: ghcr.io/philips-software/amp-devcontainer-cpp:5.1.3@sha256:a2a0ec9e240078be2302858721a3c0d904a1cce602847349245ee186cdd166ec
27+
container: ghcr.io/philips-software/amp-devcontainer-cpp:5.2.0@sha256:c47fcc83b59fb08f3a3a6e591b18bad49b3862acc35770fca6cec9ad0adb9cb2 # v5.2.0
2828
steps:
2929
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3030
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
@@ -44,18 +44,36 @@ jobs:
4444
4545
build-linux:
4646
name: Linux Host Build
47+
runs-on: [ubuntu-24.04]
48+
steps:
49+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
50+
- uses: hendrikmuhs/ccache-action@ed74d11c0b343532753ecead8a951bb09bb34bc9 # v1.2.14
51+
with:
52+
key: ${{ github.job }}
53+
max-size: 2G
54+
- uses: seanmiddleditch/gha-setup-ninja@96bed6edff20d1dd61ecff9b75cc519d516e6401 # v5
55+
- uses: lukka/run-cmake@2ce8982be71b8e9a3c4d5e432135035afd1e76a7 # v10.7
56+
with:
57+
configurePreset: "Host"
58+
buildPreset: "Host-Release"
59+
testPreset: "Host-Release"
60+
61+
build-linux-devcontainer:
62+
name: Linux Host Build in Devcontainer
4763
runs-on: [ubuntu-latest]
48-
container: ghcr.io/philips-software/amp-devcontainer-cpp:5.1.3@sha256:a2a0ec9e240078be2302858721a3c0d904a1cce602847349245ee186cdd166ec
64+
container: ghcr.io/philips-software/amp-devcontainer-cpp:5.2.0@sha256:c47fcc83b59fb08f3a3a6e591b18bad49b3862acc35770fca6cec9ad0adb9cb2 # v5.2.0
4965
steps:
5066
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
5167
- uses: hendrikmuhs/ccache-action@ed74d11c0b343532753ecead8a951bb09bb34bc9 # v1.2.14
5268
with:
5369
key: ${{ github.job }}
5470
max-size: 2G
55-
- run: |
56-
cmake --preset=Host
57-
cmake --build --preset=Host-Release
58-
ctest --preset=Host-Release
71+
- uses: lukka/run-cmake@2ce8982be71b8e9a3c4d5e432135035afd1e76a7 # v10.7
72+
with:
73+
configurePreset: "Host"
74+
buildPreset: "Host-Release"
75+
testPreset: "Host-Release"
76+
5977
test-linux:
6078
name: Linux Host Test
6179
runs-on: [ubuntu-latest]
@@ -64,7 +82,7 @@ jobs:
6482
issues: read
6583
checks: write
6684
pull-requests: write
67-
container: ghcr.io/philips-software/amp-devcontainer-cpp:5.1.3@sha256:a2a0ec9e240078be2302858721a3c0d904a1cce602847349245ee186cdd166ec
85+
container: ghcr.io/philips-software/amp-devcontainer-cpp:5.2.0@sha256:c47fcc83b59fb08f3a3a6e591b18bad49b3862acc35770fca6cec9ad0adb9cb2 # v5.2.0
6886
steps:
6987
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
7088
- uses: hendrikmuhs/ccache-action@ed74d11c0b343532753ecead8a951bb09bb34bc9 # v1.2.14

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.build
22
.install
33
.xwin-cache
4+
.vs/

.vscode/launch.json

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,27 @@
33
// Hover to view descriptions of existing attributes.
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
"version": "0.2.0",
6+
"inputs": [
7+
{
8+
"id": "tag",
9+
"description": "Enter the tag to run",
10+
"type": "pickString",
11+
"options": [
12+
"@rule1 or @smoke",
13+
"@keyword-asterisk",
14+
"@result:UNDEFINED"
15+
]
16+
},
17+
{
18+
"id": "features",
19+
"description": "Enter the tag to run",
20+
"type": "pickString",
21+
"options": [
22+
"cucumber-cpp-example/features",
23+
"test/features"
24+
]
25+
}
26+
],
627
"configurations": [
728
{
829
"name": "(gdb) Launch",
@@ -12,13 +33,14 @@
1233
"args": [
1334
"run",
1435
"--feature",
15-
"cucumber-cpp-example/features/1very_long.feature",
16-
"cucumber-cpp-example/features/2simple.feature",
36+
"${input:features}",
1737
"--report",
1838
"console",
1939
"--com",
2040
"COMx",
21-
"--nordic"
41+
"--nordic",
42+
"--tag",
43+
"${input:tag}"
2244
],
2345
"stopAtEntry": false,
2446
"cwd": "${workspaceFolder}",

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"cmake.useCMakePresets": "always",
33
"cucumberautocomplete.steps": [
4-
"cucumber-cpp-example/steps/*.cpp"
4+
"cucumber-cpp-example/steps/*.cpp",
5+
"test/steps/*.cpp"
56
],
67
"cucumberautocomplete.gherkinDefinitionPart": "(GIVEN|WHEN|THEN|STEP)\\(",
78
"cucumberautocomplete.customParameters": [

.vscode/tasks.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "bats",
8+
"type": "shell",
9+
"command": "bats --formatter junit test/test.bats | tee test-report.xml",
10+
"problemMatcher": []
11+
}
12+
]
13+
}

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ add_subdirectory(extern)
3535
add_subdirectory(cucumber-cpp)
3636
add_subdirectory(cucumber-cpp-runner)
3737
add_subdirectory(cucumber-cpp-example)
38+
add_subdirectory(test)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
@debug
2+
Feature: Simple feature file
3+
4+
Background: feature background
5+
Given a feature background 1
6+
Given a feature background 2
7+
8+
Scenario: feature scenario 1
9+
Given a step
10+
11+
Scenario: feature scenario 2
12+
Given a step
13+
14+
@rule1
15+
Rule: feature rule 1
16+
17+
Background: feature rule 1 background
18+
Given a feature rule 1 background 1
19+
Given a feature rule 1 background 2
20+
21+
@rule1scenario1
22+
Scenario: feature rule 1 scenario 1
23+
Given a step
24+
25+
@rule1scenario2
26+
Scenario: feature rule 1 scenario 2
27+
Given a step
28+
29+
@rule2
30+
Rule: feature rule 2
31+
32+
Background: feature rule 2 background
33+
Given a feature rule 2 background 1
34+
Given a feature rule 2 background 2
35+
36+
@rule2scenario1
37+
Scenario: feature rule 2 scenario 1
38+
Given a step
39+
40+
@rule2scenario2
41+
Scenario: feature rule 2 scenario 2
42+
Given a step

0 commit comments

Comments
 (0)