diff --git a/.devcontainer/cpp/devcontainer-lock.json b/.devcontainer/cpp/devcontainer-lock.json new file mode 100644 index 00000000..456806ad --- /dev/null +++ b/.devcontainer/cpp/devcontainer-lock.json @@ -0,0 +1,82 @@ +{ + "features": { + "ghcr.io/devcontainer-community/devcontainer-features/apt-build-essential:latest": { + "version": "1.0.2", + "resolved": "ghcr.io/devcontainer-community/devcontainer-features/apt-build-essential@sha256:e396b09fdd04aef5ca8d35b9957547142761575575513d12fd8dc3c98c1728f8", + "integrity": "sha256:e396b09fdd04aef5ca8d35b9957547142761575575513d12fd8dc3c98c1728f8" + }, + "ghcr.io/devcontainer-community/devcontainer-features/ccache.dev:latest": { + "version": "1.0.2", + "resolved": "ghcr.io/devcontainer-community/devcontainer-features/ccache.dev@sha256:7288d603484d8c40c7d1c3b2c09ef7599fe50a9fcd8d5cf5f6118311e328f061", + "integrity": "sha256:7288d603484d8c40c7d1c3b2c09ef7599fe50a9fcd8d5cf5f6118311e328f061" + }, + "ghcr.io/devcontainer-community/devcontainer-features/clang-format:latest": { + "version": "1.0.2", + "resolved": "ghcr.io/devcontainer-community/devcontainer-features/clang-format@sha256:fd4a701f3d067e74caa5e8e229eaf13e45e85385dcac5ad81401c4e7678b735e", + "integrity": "sha256:fd4a701f3d067e74caa5e8e229eaf13e45e85385dcac5ad81401c4e7678b735e" + }, + "ghcr.io/devcontainer-community/devcontainer-features/clang-tidy:latest": { + "version": "1.0.2", + "resolved": "ghcr.io/devcontainer-community/devcontainer-features/clang-tidy@sha256:e120a41ca26d1638ffd5407a1c27cd75ee1b79c9bce1b7f17ede2fa20bc6d5b5", + "integrity": "sha256:e120a41ca26d1638ffd5407a1c27cd75ee1b79c9bce1b7f17ede2fa20bc6d5b5" + }, + "ghcr.io/devcontainer-community/devcontainer-features/cmake.org:latest": { + "version": "1.0.2", + "resolved": "ghcr.io/devcontainer-community/devcontainer-features/cmake.org@sha256:3f498a612eb69d006535cbe49bc7344108a7106e116cc85123d5e7bfcbe79a6e", + "integrity": "sha256:3f498a612eb69d006535cbe49bc7344108a7106e116cc85123d5e7bfcbe79a6e" + }, + "ghcr.io/devcontainer-community/devcontainer-features/collection-c-cpp:1": { + "version": "1.0.3", + "resolved": "ghcr.io/devcontainer-community/devcontainer-features/collection-c-cpp@sha256:f9c47d6a760dd17d54a96ba35958c40afea09d7b9b9975b2f44803469045c325", + "integrity": "sha256:f9c47d6a760dd17d54a96ba35958c40afea09d7b9b9975b2f44803469045c325", + "dependsOn": [ + "ghcr.io/devcontainer-community/devcontainer-features/cmake.org:latest", + "ghcr.io/devcontainer-community/devcontainer-features/ninja-build.org:latest", + "ghcr.io/devcontainer-community/devcontainer-features/sourceware.org-gdb:latest", + "ghcr.io/devcontainer-community/devcontainer-features/valgrind.org:latest", + "ghcr.io/devcontainer-community/devcontainer-features/ccache.dev:latest", + "ghcr.io/devcontainer-community/devcontainer-features/danmar-cppcheck:latest", + "ghcr.io/devcontainer-community/devcontainer-features/clang-format:latest", + "ghcr.io/devcontainer-community/devcontainer-features/clang-tidy:latest", + "ghcr.io/devcontainer-community/devcontainer-features/distcc.org:latest", + "ghcr.io/devcontainer-community/devcontainer-features/vcpkg.io:latest", + "ghcr.io/devcontainer-community/devcontainer-features/apt-build-essential:latest" + ] + }, + "ghcr.io/devcontainer-community/devcontainer-features/danmar-cppcheck:latest": { + "version": "1.0.2", + "resolved": "ghcr.io/devcontainer-community/devcontainer-features/danmar-cppcheck@sha256:7b1fa136d884d4f90b3696b20713753e5d5d2507c7b589a9adc37f784d2bdc56", + "integrity": "sha256:7b1fa136d884d4f90b3696b20713753e5d5d2507c7b589a9adc37f784d2bdc56" + }, + "ghcr.io/devcontainer-community/devcontainer-features/distcc.org:latest": { + "version": "1.0.2", + "resolved": "ghcr.io/devcontainer-community/devcontainer-features/distcc.org@sha256:7a1c3a4c76cd4200ae2773268eee9372c620f05806faa3c7b8bb487c57ffe391", + "integrity": "sha256:7a1c3a4c76cd4200ae2773268eee9372c620f05806faa3c7b8bb487c57ffe391" + }, + "ghcr.io/devcontainer-community/devcontainer-features/ninja-build.org:latest": { + "version": "1.0.2", + "resolved": "ghcr.io/devcontainer-community/devcontainer-features/ninja-build.org@sha256:9df3174efc44643c61204fb1b1c0579a091f433246b581d88c7419f6cd4de3ac", + "integrity": "sha256:9df3174efc44643c61204fb1b1c0579a091f433246b581d88c7419f6cd4de3ac" + }, + "ghcr.io/devcontainer-community/devcontainer-features/sourceware.org-gdb:latest": { + "version": "1.0.2", + "resolved": "ghcr.io/devcontainer-community/devcontainer-features/sourceware.org-gdb@sha256:c6db6642afafecd431b655dad060e3b3998a46884473cb2a21bf867d4bd30528", + "integrity": "sha256:c6db6642afafecd431b655dad060e3b3998a46884473cb2a21bf867d4bd30528" + }, + "ghcr.io/devcontainer-community/devcontainer-features/valgrind.org:latest": { + "version": "1.0.2", + "resolved": "ghcr.io/devcontainer-community/devcontainer-features/valgrind.org@sha256:0422a1ed5cdd2e1b997be8c5f67f729d94f9f1b51ad6144b3e9c0346a7347bba", + "integrity": "sha256:0422a1ed5cdd2e1b997be8c5f67f729d94f9f1b51ad6144b3e9c0346a7347bba" + }, + "ghcr.io/devcontainer-community/devcontainer-features/vcpkg.io:latest": { + "version": "1.0.2", + "resolved": "ghcr.io/devcontainer-community/devcontainer-features/vcpkg.io@sha256:aa1c839509ab397336da9c187c89b16e5cb85666f1c8756a2919f401ed3b44ae", + "integrity": "sha256:aa1c839509ab397336da9c187c89b16e5cb85666f1c8756a2919f401ed3b44ae" + }, + "ghcr.io/devcontainers-extra/features/gcovr:1": { + "version": "1.0.0", + "resolved": "ghcr.io/devcontainers-extra/features/gcovr@sha256:2aa70bfc2b1d5a62333ec52a58f3c087135b82f8ada3d420f9ba52d8620123f3", + "integrity": "sha256:2aa70bfc2b1d5a62333ec52a58f3c087135b82f8ada3d420f9ba52d8620123f3" + } + } +} diff --git a/.devcontainer/cpp/devcontainer.json b/.devcontainer/cpp/devcontainer.json new file mode 100644 index 00000000..900fcc80 --- /dev/null +++ b/.devcontainer/cpp/devcontainer.json @@ -0,0 +1,35 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu +{ + "name": "cpp", + "image": "mcr.microsoft.com/devcontainers/base:resolute", + "features": { + "ghcr.io/devcontainer-community/devcontainer-features/collection-c-cpp:1": {}, + "ghcr.io/devcontainers-extra/features/gcovr:1": {} + }, + "customizations": { + "vscode": { + "settings": { + "clangd.arguments": [ + "--compile-commands-dir=${userHome}/.cpp" + ], + "cmake.copyCompileCommands": "${userHome}/.cpp/compile_commands.json", + "cmake.sourceDirectory": "${workspaceFolder}/cpp", + "cmake.useCMakePresets": "auto", + "cmake.postRunCoverageTarget": "generate-lcov-report", + "cmake.coverageInfoFiles": [ + "${workspaceFolder}/cpp/build/coverage/lcov.info" + ] + }, + "extensions": [ + "llvm-vs-code-extensions.vscode-clangd", + "ms-vscode.cmake-tools", + "ms-vscode.cpptools" + ] + } + }, + "remoteEnv": { + "CPM_SOURCE_CACHE": "~/cache/.cpm", + "DEBUGINFOD_URLS": "" + } +} diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..2657505e --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,22 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/alpine +{ + "name": "Alpine", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/base:alpine-3.22" + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "uname -a", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.github/workflows/codeql-cpp.yaml b/.github/workflows/codeql-cpp.yaml new file mode 100644 index 00000000..98310da9 --- /dev/null +++ b/.github/workflows/codeql-cpp.yaml @@ -0,0 +1,82 @@ +name: codeql-cpp + +permissions: {} + +on: + push: + branches: + - main + paths: + - cpp/** + - testdata/** + - .github/** + pull_request: + branches: + - main + paths: + - cpp/** + - testdata/** + - .github/** + schedule: + - cron: '48 5 * * 0' + +concurrency: + # Cancels in-progress runs only for pull requests + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + analyze: + name: Analyze C++ + runs-on: ubuntu-latest + permissions: + security-events: write + env: + # Git ref (tag, branch, or SHA) of the cucumber_messages dependency to + # build against. Must match the version required in cpp/CMakeLists.txt and + # cpp/conanfile.py, or the messages branch under test. + MESSAGES_REF: 8cd6cacecd0a657095c93b069c850f51009e0499 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: ccache + uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 + with: + key: ${{ github.job }}-${{ github.ref }} + append-timestamp: false + save: ${{ github.ref == 'refs/heads/main' }} + + - name: Checkout cucumber/messages + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: cucumber/messages + ref: ${{ env.MESSAGES_REF }} + path: messages-src + persist-credentials: false + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y ccache nlohmann-json3-dev + + - name: Build and install cucumber_messages + working-directory: messages-src/cpp + run: | + cmake --workflow --preset host-system + sudo cmake --install build/host-system + + - uses: github/codeql-action/init@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 + with: + languages: c-cpp + build-mode: manual + tools: linked + + - name: Configure + working-directory: cpp + run: cmake --workflow --preset host-system + + - uses: github/codeql-action/analyze@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 + with: + category: "/language:cpp" diff --git a/.github/workflows/test-cpp.yaml b/.github/workflows/test-cpp.yaml new file mode 100644 index 00000000..8ef5ec41 --- /dev/null +++ b/.github/workflows/test-cpp.yaml @@ -0,0 +1,294 @@ +name: test-cpp + +permissions: {} + +on: + push: + branches: + - main + - renovate/** + paths: + - cpp/** + - testdata/** + - .github/** + pull_request: + paths: + - cpp/** + - testdata/** + - .github/** + +env: + # Git ref (tag, branch, or SHA) of the cucumber_messages dependency to build + # against. For releases use a tag matching the version required in + # cpp/CMakeLists.txt (find_package) and cpp/conanfile.py; for cross-repo + # feature work, set this to the messages branch under test. + MESSAGES_REF: 8cd6cacecd0a657095c93b069c850f51009e0499 + +jobs: + test-cpp-system-packages-linux: + runs-on: ${{ matrix.config.os }} + strategy: + fail-fast: false + matrix: + config: + - { os: ubuntu-24.04, cxx: g++, version: 12 } + - { os: ubuntu-24.04, cxx: g++, version: 13 } + - { os: ubuntu-24.04, cxx: clang++, version: 16 } + - { os: ubuntu-24.04, cxx: clang++, version: 17 } + - { os: ubuntu-26.04, cxx: g++, version: 14 } + - { os: ubuntu-26.04, cxx: g++, version: 15 } + - { os: ubuntu-26.04, cxx: clang++, version: 21 } + - { os: ubuntu-26.04, cxx: clang++, version: 22 } + env: + CXX: ${{ matrix.config.cxx }}-${{ matrix.config.version }} + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - name: Checkout cucumber/messages + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + repository: cucumber/messages + ref: ${{ env.MESSAGES_REF }} + path: messages-src + persist-credentials: false + + - name: ccache + uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 + with: + key: ${{ github.job }}-${{ matrix.config.os }}-${{ matrix.config.cxx }}-${{ matrix.config.version }}-${{ github.ref }} + append-timestamp: false + save: ${{ github.ref == 'refs/heads/main' }} + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y nlohmann-json3-dev libgtest-dev libgmock-dev + + - name: Build and install cucumber_messages + working-directory: messages-src/cpp + run: | + cmake --workflow --preset host-system + sudo cmake --install build/host-system + + - name: Build and unit test + working-directory: cpp + run: cmake --workflow --preset test-system + + - name: Check testdata coverage + working-directory: cpp + run: cmake --build build/test-system --target check-testdata-coverage + + test-cpp-system-packages-macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - name: Checkout cucumber/messages + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + repository: cucumber/messages + ref: ${{ env.MESSAGES_REF }} + path: messages-src + persist-credentials: false + + - name: ccache + uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 + with: + key: ${{ github.job }}-${{ github.ref }} + append-timestamp: false + save: ${{ github.ref == 'refs/heads/main' }} + + - name: Install dependencies + run: brew install nlohmann-json googletest + + - name: Build and install cucumber_messages + working-directory: messages-src/cpp + run: | + cmake --workflow --preset host-system + sudo cmake --install build/host-system + + - name: Build and unit test + working-directory: cpp + run: cmake --workflow --preset test-system + + - name: Check testdata coverage + working-directory: cpp + run: cmake --build build/test-system --target check-testdata-coverage + + test-cpp-system-packages-windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - name: Checkout cucumber/messages + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + repository: cucumber/messages + ref: ${{ env.MESSAGES_REF }} + path: messages-src + persist-credentials: false + + - name: Install build tools + uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 + + - name: Install dependencies + shell: pwsh + run: | + vcpkg install nlohmann-json gtest --triplet x64-windows + # Expose the vcpkg toolchain so find_package() locates the packages. + echo "CMAKE_TOOLCHAIN_FILE=$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" >> $env:GITHUB_ENV + + - name: Build and install cucumber_messages + working-directory: messages-src/cpp + run: | + cmake --workflow --preset host-system + cmake --install build/host-system + + - name: Build and unit test + working-directory: cpp + run: cmake --workflow --preset test-system + + - name: Check testdata coverage + working-directory: cpp + run: cmake --build build/test-system --target check-testdata-coverage + + test-cpp-conan: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-24.04, ubuntu-26.04, macos-latest, windows-latest] + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - name: Checkout cucumber/messages + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + repository: cucumber/messages + ref: ${{ env.MESSAGES_REF }} + path: messages-src + persist-credentials: false + + - name: Install build tools (windows) + if: startsWith(matrix.os, 'windows') + uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 + + - name: ccache + uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 + with: + key: ${{ github.job }}-${{ matrix.os }}-${{ github.ref }} + append-timestamp: false + save: ${{ github.ref == 'refs/heads/main' }} + + - name: Setup Python + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + with: + python-version: '3.x' + + - name: Install Conan + run: python -m pip install --upgrade "conan>=2,<3" + + - name: Detect Conan profile + run: conan profile detect --force + + - name: Create cucumber_messages Conan package + working-directory: messages-src/cpp + run: conan create . --build=missing -s compiler.cppstd=17 + + - name: Build and unit test (Conan dependencies) + working-directory: cpp + run: cmake --workflow --preset test-conan + + test-cpp-coverage: + runs-on: ubuntu-26.04 + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - name: Checkout cucumber/messages + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + repository: cucumber/messages + ref: ${{ env.MESSAGES_REF }} + path: messages-src + persist-credentials: false + + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y nlohmann-json3-dev libgtest-dev libgmock-dev + python -m pip install gcovr==8.6 + gcovr --version + + - name: ccache + uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 + with: + key: ${{ github.job }}-${{ github.ref }} + append-timestamp: false + save: ${{ github.ref == 'refs/heads/main' }} + + - name: Build and install cucumber_messages + working-directory: messages-src/cpp + run: | + cmake --workflow --preset host-system + sudo cmake --install build/host-system + + - name: Coverage + working-directory: cpp + run: cmake --workflow --preset coverage + + - name: Show coverage summary + working-directory: cpp + run: cat build/coverage/coverage-summary.md + + test-cpp-lint: + runs-on: ubuntu-26.04 + env: + CXX: clang++ + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - name: Checkout cucumber/messages + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + repository: cucumber/messages + ref: ${{ env.MESSAGES_REF }} + path: messages-src + persist-credentials: false + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y clang clang-tidy nlohmann-json3-dev libgtest-dev libgmock-dev + + - name: ccache + uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23 + with: + key: ${{ github.job }}-${{ github.ref }} + append-timestamp: false + save: ${{ github.ref == 'refs/heads/main' }} + + - name: Build and install cucumber_messages + working-directory: messages-src/cpp + run: | + cmake --workflow --preset host-system + sudo cmake --install build/host-system + + - name: Lint + working-directory: cpp + run: cmake --workflow --preset tidy diff --git a/CHANGELOG.md b/CHANGELOG.md index ca9b0802..edd186ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +### Added +- [CPP] Initial C++ implementation ([#201](https://github.com/cucumber/query/pull/201)) ## [16.1.1] - 2026-08-05 ### Fixed diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b2ee5e2d..fdbe7492 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,6 +12,7 @@ Currently, the list is: - JavaScript - C# (.NET) - Ruby +- c++ Java is the reference implementation in the sense that it is responsible for generating the fixtures that are used in the acceptance tests to verify all @@ -39,11 +40,11 @@ UPDATE_SAMPLES=true mvn test Choosing which type to use in another language based on what we did in Java is an inexact science. This table defines all the decisions we've made so far: -| Java | JavaScript | C# | Ruby | -|---------------|----------------------|--------------------|--------------| -| `Optional` | `T \| undefined`[^1] | `T?` | `T \| nil` | -| `List` | `ReadonlyArray` | `List` | `Array` | -| `Map` | `Map` | `Dictionary` | `Hash` | -| `Map` | `Record` | `Dictionary` | `Hash` | +| Java | JavaScript | C# | Ruby | Cpp | +| ------------- | -------------------- | ------------------ | ------------ | ----------------------- | +| `Optional` | `T \| undefined`[^1] | `T?` | `T \| nil` | std::optional | +| `List` | `ReadonlyArray` | `List` | `Array` | std::vector | +| `Map` | `Map` | `Dictionary` | `Hash` | std::unordered_map | +| `Map` | `Record` | `Dictionary` | `Hash` | std::unordered_map | [^1]: See diff --git a/cpp/.clang-format b/cpp/.clang-format new file mode 100644 index 00000000..bf24a8b1 --- /dev/null +++ b/cpp/.clang-format @@ -0,0 +1,164 @@ +--- +Language: Cpp +AccessModifierOffset: -4 +AlignAfterOpenBracket: DontAlign +AlignArrayOfStructures: None +AlignConsecutiveMacros: None +AlignConsecutiveAssignments: None +AlignConsecutiveBitFields: None +AlignConsecutiveDeclarations: None +AlignEscapedNewlines: Right +AlignOperands: Align +AlignTrailingComments: true +AllowAllArgumentsOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortEnumsOnASingleLine: false +AllowShortBlocksOnASingleLine: Never +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AllowShortLambdasOnASingleLine: Empty +AllowShortIfStatementsOnASingleLine: Never +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: Yes +BinPackArguments: true +BinPackParameters: true +BraceWrapping: + AfterCaseLabel: true + AfterClass: true + AfterControlStatement: Always + AfterEnum: true + AfterFunction: true + AfterNamespace: true + AfterObjCDeclaration: true + AfterStruct: true + AfterUnion: true + AfterExternBlock: true + BeforeCatch: true + BeforeElse: true + BeforeLambdaBody: true + BeforeWhile: false + IndentBraces: false + SplitEmptyFunction: false + SplitEmptyRecord: false + SplitEmptyNamespace: false +BreakBeforeBinaryOperators: None +BreakBeforeConceptDeclarations: true +BreakBeforeBraces: Custom +BreakBeforeInheritanceComma: false +BreakInheritanceList: BeforeComma +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: BeforeComma +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true +ColumnLimit: 200 +CommentPragmas: "^ IWYU pragma:|^NOSONAR" +QualifierAlignment: Leave +CompactNamespaces: false +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: false +DeriveLineEnding: true +DerivePointerAlignment: false +EmptyLineAfterAccessModifier: Never +EmptyLineBeforeAccessModifier: LogicalBlock +ExperimentalAutoDetectBinPacking: false +PackConstructorInitializers: Never +FixNamespaceComments: false +IncludeBlocks: Merge +IncludeCategories: + - Regex: ^(<|"(gtest|gmock)/) + Priority: 2 + - Regex: ^(:-fno-elide-constructors> + ) + + if (CMAKE_C_COMPILER_ID STREQUAL "GNU") + link_libraries(gcov) + else() + add_link_options(--coverage) + endif() +endif() + +if(CUCUMBER_QUERY_ENABLE_SANITIZERS) + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + add_compile_options(-fsanitize=address -fsanitize=undefined) + add_link_options(-fsanitize=address -fsanitize=undefined) + endif() +endif() + +# Targets +add_library(cucumber_query_lib) +add_library(cucumber::query ALIAS cucumber_query_lib) + +target_sources( + cucumber_query_lib + PRIVATE + include/cucumber/query/Lineage.hpp + include/cucumber/query/Query.hpp + src/query/Lineage.cpp + src/query/Query.cpp + include/cucumber/query/NamingStrategy.hpp + src/query/NamingStrategy.cpp +) + +target_include_directories( + cucumber_query_lib + PUBLIC + $ + $ + PRIVATE + ${CMAKE_CURRENT_LIST_DIR}/src/query +) + +target_link_libraries( + cucumber_query_lib + PUBLIC + nlohmann_json::nlohmann_json + cucumber::messages +) + +set_target_properties( + cucumber_query_lib + PROPERTIES + VERSION ${VERSION} + SOVERSION ${VER_MAJOR} + EXPORT_NAME query + OUTPUT_NAME cucumber_query +) + +# Installation support +include(CMakePackageConfigHelpers) + +configure_package_config_file( + "cmake/cucumber_query-config.cmake.in" + "${PROJECT_BINARY_DIR}/cucumber_query-config.cmake" + INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/cucumber_query" + PATH_VARS CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_LIBDIR +) + +write_basic_package_version_file( + "${PROJECT_BINARY_DIR}/cucumber_query-config-version.cmake" + COMPATIBILITY AnyNewerVersion +) + +install( + TARGETS cucumber_query_lib + EXPORT cucumber_query-targets + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) + +install( + EXPORT cucumber_query-targets + FILE cucumber_query-targets.cmake + NAMESPACE cucumber:: + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/cucumber_query" +) + +install( + FILES + "${PROJECT_BINARY_DIR}/cucumber_query-config.cmake" + "${PROJECT_BINARY_DIR}/cucumber_query-config-version.cmake" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/cucumber_query" +) + +install( + DIRECTORY "${PROJECT_SOURCE_DIR}/include/" + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) + +# Optional: tests +if(CUCUMBER_QUERY_BUILD_TESTS) + find_package(GTest REQUIRED) + include(CTest) + enable_testing() + add_subdirectory(test) +endif() diff --git a/cpp/CMakePresets.json b/cpp/CMakePresets.json new file mode 100644 index 00000000..273a7cbb --- /dev/null +++ b/cpp/CMakePresets.json @@ -0,0 +1,241 @@ +{ + "version": 6, + "cmakeMinimumRequired": { + "major": 3, + "minor": 21 + }, + "configurePresets": [ + { + "name": "base", + "hidden": true, + "binaryDir": "${sourceDir}/build/${presetName}", + "generator": "Ninja", + "cacheVariables": { + "CMAKE_EXPORT_COMPILE_COMMANDS": "On" + } + }, + { + "name": "host-system", + "displayName": "Host build (system dependencies)", + "description": "Build and install the library using C++ dependencies already installed on the system. Does not use Conan and does not build tests.", + "inherits": "base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "test-system", + "displayName": "Test build (system dependencies)", + "description": "Build with unit tests and sanitizers enabled using system dependencies. Used by CI to build and run the test suite.", + "inherits": "base", + "cacheVariables": { + "CUCUMBER_QUERY_BUILD_TESTS": "On", + "CUCUMBER_QUERY_ENABLE_SANITIZERS": "On", + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "host-conan", + "displayName": "Host build (Conan dependencies)", + "description": "Build and install the library using Conan-provided dependencies. Used by CI. Does not build tests.", + "inherits": "base", + "cacheVariables": { + "CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "${sourceDir}/cmake/conan_provider.cmake", + "CMAKE_BUILD_TYPE": "Debug", + "CONAN_INSTALL_ARGS": "--build=missing" + } + }, + { + "name": "test-conan", + "displayName": "Test build (automatic Conan)", + "description": "Build with unit tests enabled using Conan-provided dependencies. Used by CI.", + "inherits": "base", + "cacheVariables": { + "CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "${sourceDir}/cmake/conan_provider.cmake", + "CUCUMBER_QUERY_BUILD_TESTS": "On", + "CMAKE_BUILD_TYPE": "Debug", + "CONAN_INSTALL_ARGS": "--build=missing" + } + }, + { + "name": "tidy", + "displayName": "Lint build (clang-tidy, system dependencies)", + "description": "Build with unit tests and clang-tidy enabled using system dependencies.", + "inherits": "base", + "cacheVariables": { + "CUCUMBER_QUERY_BUILD_TESTS": "On", + "CUCUMBER_QUERY_ENABLE_CLANG_TIDY": "On", + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "coverage", + "displayName": "Coverage build (system dependencies)", + "description": "Build with unit tests and code coverage instrumentation using system dependencies.", + "inherits": "base", + "cacheVariables": { + "CUCUMBER_QUERY_BUILD_TESTS": "On", + "CUCUMBER_QUERY_ENABLE_COVERAGE": "On", + "CMAKE_BUILD_TYPE": "Debug" + } + } + ], + "buildPresets": [ + { + "name": "host-system", + "configurePreset": "host-system" + }, + { + "name": "test-system", + "configurePreset": "test-system" + }, + { + "name": "host-conan", + "configurePreset": "host-conan" + }, + { + "name": "test-conan", + "configurePreset": "test-conan" + }, + { + "name": "tidy", + "configurePreset": "tidy" + }, + { + "name": "coverage", + "configurePreset": "coverage" + }, + { + "name": "coverage-report", + "configurePreset": "coverage", + "targets": [ + "generate-lcov-report" + ] + } + ], + "testPresets": [ + { + "name": "test-system", + "configurePreset": "test-system", + "output": { + "outputOnFailure": true + }, + "execution": { + "noTestsAction": "error", + "jobs": 8 + } + }, + { + "name": "test-conan", + "configurePreset": "test-conan", + "output": { + "outputOnFailure": true + }, + "execution": { + "noTestsAction": "error", + "jobs": 8 + } + }, + { + "name": "coverage", + "configurePreset": "coverage", + "inherits": "test-system" + } + ], + "workflowPresets": [ + { + "name": "host-system", + "steps": [ + { + "name": "host-system", + "type": "configure" + }, + { + "name": "host-system", + "type": "build" + } + ] + }, + { + "name": "test-system", + "steps": [ + { + "name": "test-system", + "type": "configure" + }, + { + "name": "test-system", + "type": "build" + }, + { + "name": "test-system", + "type": "test" + } + ] + }, + { + "name": "host-conan", + "steps": [ + { + "name": "host-conan", + "type": "configure" + }, + { + "name": "host-conan", + "type": "build" + } + ] + }, + { + "name": "test-conan", + "steps": [ + { + "name": "test-conan", + "type": "configure" + }, + { + "name": "test-conan", + "type": "build" + }, + { + "name": "test-conan", + "type": "test" + } + ] + }, + { + "name": "tidy", + "steps": [ + { + "name": "tidy", + "type": "configure" + }, + { + "name": "tidy", + "type": "build" + } + ] + }, + { + "name": "coverage", + "steps": [ + { + "name": "coverage", + "type": "configure" + }, + { + "name": "coverage", + "type": "build" + }, + { + "name": "coverage", + "type": "test" + }, + { + "name": "coverage-report", + "type": "build" + } + ] + } + ] +} diff --git a/cpp/VERSION b/cpp/VERSION new file mode 100644 index 00000000..1afe54c7 --- /dev/null +++ b/cpp/VERSION @@ -0,0 +1 @@ +16.1.1 diff --git a/cpp/cmake/conan_provider.cmake b/cpp/cmake/conan_provider.cmake new file mode 100644 index 00000000..b2a6f0fa --- /dev/null +++ b/cpp/cmake/conan_provider.cmake @@ -0,0 +1,722 @@ +# The MIT License (MIT) +# +# Copyright (c) 2024 JFrog +# +# 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. + +set(CONAN_MINIMUM_VERSION 2.0.5) + +# Create a new policy scope and set the minimum required cmake version so the +# features behind a policy setting like if(... IN_LIST ...) behaves as expected +# even if the parent project does not specify a minimum cmake version or a minimum +# version less than this module requires (e.g. 3.0) before the first project() call. +# (see: https://cmake.org/cmake/help/latest/variable/CMAKE_PROJECT_TOP_LEVEL_INCLUDES.html) +# +# The policy-affecting calls like cmake_policy(SET...) or `cmake_minimum_required` only +# affects the current policy scope, i.e. between the PUSH and POP in this case. +# +# https://cmake.org/cmake/help/book/mastering-cmake/chapter/Policies.html#the-policy-stack +cmake_policy(PUSH) +cmake_minimum_required(VERSION 3.24) + + +function(detect_os os os_api_level os_sdk os_subsystem os_version) + # it could be cross compilation + message(STATUS "CMake-Conan: cmake_system_name=${CMAKE_SYSTEM_NAME}") + if(CMAKE_SYSTEM_NAME AND NOT CMAKE_SYSTEM_NAME STREQUAL "Generic") + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set(${os} Macos PARENT_SCOPE) + elseif(CMAKE_SYSTEM_NAME STREQUAL "QNX") + set(${os} Neutrino PARENT_SCOPE) + elseif(CMAKE_SYSTEM_NAME STREQUAL "CYGWIN") + set(${os} Windows PARENT_SCOPE) + set(${os_subsystem} cygwin PARENT_SCOPE) + elseif(CMAKE_SYSTEM_NAME MATCHES "^MSYS") + set(${os} Windows PARENT_SCOPE) + set(${os_subsystem} msys2 PARENT_SCOPE) + elseif(CMAKE_SYSTEM_NAME STREQUAL "Emscripten") + # https://github.com/emscripten-core/emscripten/blob/4.0.6/cmake/Modules/Platform/Emscripten.cmake#L17C1-L17C34 + set(${os} Emscripten PARENT_SCOPE) + else() + set(${os} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE) + endif() + if(CMAKE_SYSTEM_NAME STREQUAL "Android") + if(DEFINED ANDROID_PLATFORM) + string(REGEX MATCH "[0-9]+" _os_api_level ${ANDROID_PLATFORM}) + elseif(DEFINED CMAKE_SYSTEM_VERSION) + set(_os_api_level ${CMAKE_SYSTEM_VERSION}) + endif() + message(STATUS "CMake-Conan: android api level=${_os_api_level}") + set(${os_api_level} ${_os_api_level} PARENT_SCOPE) + endif() + if(CMAKE_SYSTEM_NAME MATCHES "Darwin|iOS|tvOS|watchOS") + # CMAKE_OSX_SYSROOT contains the full path to the SDK for MakeFile/Ninja + # generators, but just has the original input string for Xcode. + if(NOT IS_DIRECTORY ${CMAKE_OSX_SYSROOT}) + set(_os_sdk ${CMAKE_OSX_SYSROOT}) + else() + if(CMAKE_OSX_SYSROOT MATCHES Simulator) + set(apple_platform_suffix simulator) + else() + set(apple_platform_suffix os) + endif() + if(CMAKE_OSX_SYSROOT MATCHES AppleTV) + set(_os_sdk "appletv${apple_platform_suffix}") + elseif(CMAKE_OSX_SYSROOT MATCHES iPhone) + set(_os_sdk "iphone${apple_platform_suffix}") + elseif(CMAKE_OSX_SYSROOT MATCHES Watch) + set(_os_sdk "watch${apple_platform_suffix}") + endif() + endif() + if(DEFINED os_sdk) + message(STATUS "CMake-Conan: cmake_osx_sysroot=${CMAKE_OSX_SYSROOT}") + set(${os_sdk} ${_os_sdk} PARENT_SCOPE) + endif() + if(DEFINED CMAKE_OSX_DEPLOYMENT_TARGET) + message(STATUS "CMake-Conan: cmake_osx_deployment_target=${CMAKE_OSX_DEPLOYMENT_TARGET}") + set(${os_version} ${CMAKE_OSX_DEPLOYMENT_TARGET} PARENT_SCOPE) + endif() + endif() + endif() +endfunction() + + +function(detect_arch arch) + # CMAKE_OSX_ARCHITECTURES can contain multiple architectures, but Conan only supports one. + # Therefore this code only finds one. If the recipes support multiple architectures, the + # build will work. Otherwise, there will be a linker error for the missing architecture(s). + if(DEFINED CMAKE_OSX_ARCHITECTURES) + string(REPLACE " " ";" apple_arch_list "${CMAKE_OSX_ARCHITECTURES}") + list(LENGTH apple_arch_list apple_arch_count) + if(apple_arch_count GREATER 1) + message(WARNING "CMake-Conan: Multiple architectures detected, this will only work if Conan recipe(s) produce fat binaries.") + endif() + endif() + if(CMAKE_SYSTEM_NAME MATCHES "Darwin|iOS|tvOS|watchOS" AND NOT CMAKE_OSX_ARCHITECTURES STREQUAL "") + set(host_arch ${CMAKE_OSX_ARCHITECTURES}) + elseif(MSVC) + set(host_arch ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}) + else() + set(host_arch ${CMAKE_SYSTEM_PROCESSOR}) + endif() + if(host_arch MATCHES "aarch64|arm64|ARM64") + set(_arch armv8) + elseif(host_arch MATCHES "armv7|armv7-a|armv7l|ARMV7") + set(_arch armv7) + elseif(host_arch MATCHES armv7s) + set(_arch armv7s) + elseif(host_arch MATCHES "i686|i386|X86") + set(_arch x86) + elseif(host_arch MATCHES "AMD64|amd64|x86_64|x64") + set(_arch x86_64) + endif() + if(EMSCRIPTEN) + # https://github.com/emscripten-core/emscripten/blob/4.0.6/cmake/Modules/Platform/Emscripten.cmake#L294C1-L294C80 + set(_arch wasm) + endif() + message(STATUS "CMake-Conan: cmake_system_processor=${_arch}") + set(${arch} ${_arch} PARENT_SCOPE) +endfunction() + + +function(detect_cxx_standard compiler cxx_standard) + set(${cxx_standard} ${CMAKE_CXX_STANDARD} PARENT_SCOPE) + if(CMAKE_CXX_EXTENSIONS) + if(compiler STREQUAL "msvc") + set(${cxx_standard} "${CMAKE_CXX_STANDARD}" PARENT_SCOPE) + else() + set(${cxx_standard} "gnu${CMAKE_CXX_STANDARD}" PARENT_SCOPE) + endif() + endif() +endfunction() + + +macro(detect_gnu_libstdcxx) + # _conan_is_gnu_libstdcxx true if GNU libstdc++ + check_cxx_source_compiles(" + #include + #if !defined(__GLIBCXX__) && !defined(__GLIBCPP__) + static_assert(false); + #endif + int main(){}" _conan_is_gnu_libstdcxx) + + # _conan_gnu_libstdcxx_is_cxx11_abi true if C++11 ABI + check_cxx_source_compiles(" + #include + static_assert(sizeof(std::string) != sizeof(void*), \"using libstdc++\"); + int main () {}" _conan_gnu_libstdcxx_is_cxx11_abi) + + set(_conan_gnu_libstdcxx_suffix "") + if(_conan_gnu_libstdcxx_is_cxx11_abi) + set(_conan_gnu_libstdcxx_suffix "11") + endif() + unset (_conan_gnu_libstdcxx_is_cxx11_abi) +endmacro() + + +macro(detect_libcxx) + # _conan_is_libcxx true if LLVM libc++ + check_cxx_source_compiles(" + #include + #if !defined(_LIBCPP_VERSION) + static_assert(false); + #endif + int main(){}" _conan_is_libcxx) +endmacro() + + +function(detect_lib_cxx lib_cxx) + if(CMAKE_SYSTEM_NAME STREQUAL "Android") + message(STATUS "CMake-Conan: android_stl=${CMAKE_ANDROID_STL_TYPE}") + set(${lib_cxx} ${CMAKE_ANDROID_STL_TYPE} PARENT_SCOPE) + return() + endif() + + include(CheckCXXSourceCompiles) + + if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + detect_gnu_libstdcxx() + set(${lib_cxx} "libstdc++${_conan_gnu_libstdcxx_suffix}" PARENT_SCOPE) + elseif(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") + set(${lib_cxx} "libc++" PARENT_SCOPE) + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_SYSTEM_NAME MATCHES "Windows") + # Check for libc++ + detect_libcxx() + if(_conan_is_libcxx) + set(${lib_cxx} "libc++" PARENT_SCOPE) + return() + endif() + + # Check for libstdc++ + detect_gnu_libstdcxx() + if(_conan_is_gnu_libstdcxx) + set(${lib_cxx} "libstdc++${_conan_gnu_libstdcxx_suffix}" PARENT_SCOPE) + return() + endif() + + # TODO: it would be an error if we reach this point + elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + # Do nothing - compiler.runtime and compiler.runtime_type + # should be handled separately: https://github.com/conan-io/cmake-conan/pull/516 + return() + else() + # TODO: unable to determine, ask user to provide a full profile file instead + endif() +endfunction() + + +function(detect_compiler compiler compiler_version compiler_runtime compiler_runtime_type) + if(DEFINED CMAKE_CXX_COMPILER_ID) + set(_compiler ${CMAKE_CXX_COMPILER_ID}) + set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION}) + else() + if(NOT DEFINED CMAKE_C_COMPILER_ID) + message(FATAL_ERROR "C or C++ compiler not defined") + endif() + set(_compiler ${CMAKE_C_COMPILER_ID}) + set(_compiler_version ${CMAKE_C_COMPILER_VERSION}) + endif() + + message(STATUS "CMake-Conan: CMake compiler=${_compiler}") + message(STATUS "CMake-Conan: CMake compiler version=${_compiler_version}") + + if(_compiler MATCHES MSVC) + set(_compiler "msvc") + string(SUBSTRING ${MSVC_VERSION} 0 3 _compiler_version) + # Configure compiler.runtime and compiler.runtime_type settings for MSVC + if(CMAKE_MSVC_RUNTIME_LIBRARY) + set(_msvc_runtime_library ${CMAKE_MSVC_RUNTIME_LIBRARY}) + else() + set(_msvc_runtime_library MultiThreaded$<$:Debug>DLL) # default value documented by CMake + endif() + + set(_KNOWN_MSVC_RUNTIME_VALUES "") + list(APPEND _KNOWN_MSVC_RUNTIME_VALUES MultiThreaded MultiThreadedDLL) + list(APPEND _KNOWN_MSVC_RUNTIME_VALUES MultiThreadedDebug MultiThreadedDebugDLL) + list(APPEND _KNOWN_MSVC_RUNTIME_VALUES MultiThreaded$<$:Debug> MultiThreaded$<$:Debug>DLL) + + # only accept the 6 possible values, otherwise we don't don't know to map this + if(NOT _msvc_runtime_library IN_LIST _KNOWN_MSVC_RUNTIME_VALUES) + message(FATAL_ERROR "CMake-Conan: unable to map MSVC runtime: ${_msvc_runtime_library} to Conan settings") + endif() + + # Runtime is "dynamic" in all cases if it ends in DLL + if(_msvc_runtime_library MATCHES ".*DLL$") + set(_compiler_runtime "dynamic") + else() + set(_compiler_runtime "static") + endif() + message(STATUS "CMake-Conan: CMake compiler.runtime=${_compiler_runtime}") + + # Only define compiler.runtime_type when explicitly requested + # If a generator expression is used, let Conan handle it conditional on build_type + if(NOT _msvc_runtime_library MATCHES ":Debug>") + if(_msvc_runtime_library MATCHES "Debug") + set(_compiler_runtime_type "Debug") + else() + set(_compiler_runtime_type "Release") + endif() + message(STATUS "CMake-Conan: CMake compiler.runtime_type=${_compiler_runtime_type}") + endif() + + unset(_KNOWN_MSVC_RUNTIME_VALUES) + + elseif(_compiler MATCHES AppleClang) + set(_compiler "apple-clang") + string(REPLACE "." ";" VERSION_LIST ${_compiler_version}) + list(GET VERSION_LIST 0 _compiler_version) + elseif(_compiler MATCHES Clang) + set(_compiler "clang") + string(REPLACE "." ";" VERSION_LIST ${_compiler_version}) + list(GET VERSION_LIST 0 _compiler_version) + elseif(_compiler MATCHES GNU) + set(_compiler "gcc") + string(REPLACE "." ";" VERSION_LIST ${_compiler_version}) + list(GET VERSION_LIST 0 _compiler_version) + endif() + + message(STATUS "CMake-Conan: [settings] compiler=${_compiler}") + message(STATUS "CMake-Conan: [settings] compiler.version=${_compiler_version}") + if (_compiler_runtime) + message(STATUS "CMake-Conan: [settings] compiler.runtime=${_compiler_runtime}") + endif() + if (_compiler_runtime_type) + message(STATUS "CMake-Conan: [settings] compiler.runtime_type=${_compiler_runtime_type}") + endif() + + set(${compiler} ${_compiler} PARENT_SCOPE) + set(${compiler_version} ${_compiler_version} PARENT_SCOPE) + set(${compiler_runtime} ${_compiler_runtime} PARENT_SCOPE) + set(${compiler_runtime_type} ${_compiler_runtime_type} PARENT_SCOPE) +endfunction() + + +function(detect_build_type build_type) + get_property(multiconfig_generator GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if(NOT multiconfig_generator) + # Only set when we know we are in a single-configuration generator + # Note: we may want to fail early if `CMAKE_BUILD_TYPE` is not defined + set(${build_type} ${CMAKE_BUILD_TYPE} PARENT_SCOPE) + endif() +endfunction() + + +macro(set_conan_compiler_if_appleclang lang command output_variable) + if(CMAKE_${lang}_COMPILER_ID STREQUAL "AppleClang") + execute_process(COMMAND xcrun --find ${command} + OUTPUT_VARIABLE _xcrun_out OUTPUT_STRIP_TRAILING_WHITESPACE) + cmake_path(GET _xcrun_out PARENT_PATH _xcrun_toolchain_path) + cmake_path(GET CMAKE_${lang}_COMPILER PARENT_PATH _compiler_parent_path) + if ("${_xcrun_toolchain_path}" STREQUAL "${_compiler_parent_path}") + set(${output_variable} "") + endif() + unset(_xcrun_out) + unset(_xcrun_toolchain_path) + unset(_compiler_parent_path) + endif() +endmacro() + + +macro(append_compiler_executables_configuration) + set(_conan_c_compiler "") + set(_conan_cpp_compiler "") + set(_conan_rc_compiler "") + set(_conan_compilers_list "") + if(CMAKE_C_COMPILER) + set(_conan_c_compiler "\"c\":\"${CMAKE_C_COMPILER}\"") + set_conan_compiler_if_appleclang(C cc _conan_c_compiler) + list(APPEND _conan_compilers_list ${_conan_c_compiler}) + else() + message(WARNING "CMake-Conan: The C compiler is not defined. " + "Please define CMAKE_C_COMPILER or enable the C language.") + endif() + if(CMAKE_CXX_COMPILER) + set(_conan_cpp_compiler "\"cpp\":\"${CMAKE_CXX_COMPILER}\"") + set_conan_compiler_if_appleclang(CXX c++ _conan_cpp_compiler) + list(APPEND _conan_compilers_list ${_conan_cpp_compiler}) + else() + message(WARNING "CMake-Conan: The C++ compiler is not defined. " + "Please define CMAKE_CXX_COMPILER or enable the C++ language.") + endif() + if(CMAKE_RC_COMPILER) + set(_conan_rc_compiler "\"rc\":\"${CMAKE_RC_COMPILER}\"") + list(APPEND _conan_compilers_list ${_conan_rc_compiler}) + # Not necessary to warn if RC not defined + endif() + if(NOT "x${_conan_compilers_list}" STREQUAL "x") + if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + string(REPLACE ";" "," _conan_compilers_list "${_conan_compilers_list}") + string(APPEND profile "tools.build:compiler_executables={${_conan_compilers_list}}\n") + endif() + endif() + unset(_conan_c_compiler) + unset(_conan_cpp_compiler) + unset(_conan_rc_compiler) + unset(_conan_compilers_list) +endmacro() + + +function(detect_host_profile output_file) + detect_os(os os_api_level os_sdk os_subsystem os_version) + detect_arch(arch) + detect_compiler(compiler compiler_version compiler_runtime compiler_runtime_type) + detect_cxx_standard(${compiler} compiler_cppstd) + detect_lib_cxx(compiler_libcxx) + detect_build_type(build_type) + + set(profile "") + string(APPEND profile "[settings]\n") + if(arch) + string(APPEND profile arch=${arch} "\n") + endif() + if(os) + string(APPEND profile os=${os} "\n") + endif() + if(os_api_level) + string(APPEND profile os.api_level=${os_api_level} "\n") + endif() + if(os_version) + string(APPEND profile os.version=${os_version} "\n") + endif() + if(os_sdk) + string(APPEND profile os.sdk=${os_sdk} "\n") + endif() + if(os_subsystem) + string(APPEND profile os.subsystem=${os_subsystem} "\n") + endif() + if(compiler) + string(APPEND profile compiler=${compiler} "\n") + endif() + if(compiler_version) + string(APPEND profile compiler.version=${compiler_version} "\n") + endif() + if(compiler_runtime) + string(APPEND profile compiler.runtime=${compiler_runtime} "\n") + endif() + if(compiler_runtime_type) + string(APPEND profile compiler.runtime_type=${compiler_runtime_type} "\n") + endif() + if(compiler_cppstd) + string(APPEND profile compiler.cppstd=${compiler_cppstd} "\n") + endif() + if(compiler_libcxx) + string(APPEND profile compiler.libcxx=${compiler_libcxx} "\n") + endif() + if(build_type) + string(APPEND profile "build_type=${build_type}\n") + endif() + + if(NOT DEFINED output_file) + set(file_name "${CMAKE_BINARY_DIR}/profile") + else() + set(file_name ${output_file}) + endif() + + string(APPEND profile "[conf]\n") + string(APPEND profile "tools.cmake.cmaketoolchain:generator=${CMAKE_GENERATOR}\n") + + # propagate compilers via profile + append_compiler_executables_configuration() + + if(os STREQUAL "Android") + string(APPEND profile "tools.android:ndk_path=${CMAKE_ANDROID_NDK}\n") + endif() + + message(STATUS "CMake-Conan: Creating profile ${file_name}") + file(WRITE ${file_name} ${profile}) + message(STATUS "CMake-Conan: Profile: \n${profile}") +endfunction() + + +function(conan_profile_detect_default) + message(STATUS "CMake-Conan: Checking if a default profile exists") + execute_process(COMMAND ${CONAN_COMMAND} profile path default + RESULT_VARIABLE return_code + OUTPUT_VARIABLE conan_stdout + ERROR_VARIABLE conan_stderr + ECHO_ERROR_VARIABLE # show the text output regardless + ECHO_OUTPUT_VARIABLE + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + if(NOT ${return_code} EQUAL "0") + message(STATUS "CMake-Conan: The default profile doesn't exist, detecting it.") + execute_process(COMMAND ${CONAN_COMMAND} profile detect + RESULT_VARIABLE return_code + OUTPUT_VARIABLE conan_stdout + ERROR_VARIABLE conan_stderr + ECHO_ERROR_VARIABLE # show the text output regardless + ECHO_OUTPUT_VARIABLE + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + endif() +endfunction() + + +function(conan_install) + set(conan_output_folder ${CMAKE_BINARY_DIR}/conan) + # Invoke "conan install" with the provided arguments + set(conan_args -of=${conan_output_folder}) + list(JOIN ARGN " " argn_str) + message(STATUS "CMake-Conan: conan install ${CMAKE_SOURCE_DIR} ${conan_args} ${argn_str}") + + + # In case there was not a valid cmake executable in the PATH, we inject the + # same we used to invoke the provider to the PATH + if(DEFINED PATH_TO_CMAKE_BIN) + set(old_path $ENV{PATH}) + if(CMAKE_HOST_WIN32) + set(ENV{PATH} "$ENV{PATH};${PATH_TO_CMAKE_BIN}") + else() + set(ENV{PATH} "$ENV{PATH}:${PATH_TO_CMAKE_BIN}") + endif() + endif() + + execute_process(COMMAND ${CONAN_COMMAND} install ${CMAKE_SOURCE_DIR} ${conan_args} ${ARGN} --format=json + RESULT_VARIABLE return_code + OUTPUT_VARIABLE conan_stdout + ERROR_VARIABLE conan_stderr + ECHO_ERROR_VARIABLE # show the text output regardless + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + + if(DEFINED PATH_TO_CMAKE_BIN) + set(ENV{PATH} "${old_path}") + endif() + + if(NOT "${return_code}" STREQUAL "0") + message(FATAL_ERROR "Conan install failed='${return_code}'") + endif() + + # the files are generated in a folder that depends on the layout used, if + # one is specified, but we don't know a priori where this is. + # TODO: this can be made more robust if Conan can provide this in the json output + string(JSON conan_generators_folder GET "${conan_stdout}" graph nodes 0 generators_folder) + cmake_path(CONVERT ${conan_generators_folder} TO_CMAKE_PATH_LIST conan_generators_folder) + + message(STATUS "CMake-Conan: CONAN_GENERATORS_FOLDER=${conan_generators_folder}") + set_property(GLOBAL PROPERTY CONAN_GENERATORS_FOLDER "${conan_generators_folder}") + # reconfigure on conanfile changes + string(JSON conanfile GET "${conan_stdout}" graph nodes 0 label) + message(STATUS "CMake-Conan: CONANFILE=${CMAKE_SOURCE_DIR}/${conanfile}") + set_property(DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/${conanfile}") + # success + set_property(GLOBAL PROPERTY CONAN_INSTALL_SUCCESS TRUE) + +endfunction() + + +function(conan_get_version conan_command conan_current_version) + execute_process( + COMMAND ${conan_command} --version + OUTPUT_VARIABLE conan_output + RESULT_VARIABLE conan_result + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(conan_result) + message(FATAL_ERROR "CMake-Conan: Error when trying to run Conan") + endif() + + string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" conan_version ${conan_output}) + set(${conan_current_version} ${conan_version} PARENT_SCOPE) +endfunction() + + +function(conan_version_check) + set(options ) + set(one_value_args MINIMUM CURRENT) + set(multi_value_args ) + cmake_parse_arguments(conan_version_check + "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN}) + + if(NOT conan_version_check_MINIMUM) + message(FATAL_ERROR "CMake-Conan: Required parameter MINIMUM not set!") + endif() + if(NOT conan_version_check_CURRENT) + message(FATAL_ERROR "CMake-Conan: Required parameter CURRENT not set!") + endif() + + if(conan_version_check_CURRENT VERSION_LESS conan_version_check_MINIMUM) + message(FATAL_ERROR "CMake-Conan: Conan version must be ${conan_version_check_MINIMUM} or later") + endif() +endfunction() + + +macro(construct_profile_argument argument_variable profile_list) + set(${argument_variable} "") + if("${profile_list}" STREQUAL "CONAN_HOST_PROFILE") + set(_arg_flag "--profile:host=") + elseif("${profile_list}" STREQUAL "CONAN_BUILD_PROFILE") + set(_arg_flag "--profile:build=") + endif() + + set(_profile_list "${${profile_list}}") + list(TRANSFORM _profile_list REPLACE "auto-cmake" "${CMAKE_BINARY_DIR}/conan_host_profile") + list(TRANSFORM _profile_list PREPEND ${_arg_flag}) + set(${argument_variable} ${_profile_list}) + + unset(_arg_flag) + unset(_profile_list) +endmacro() + + +macro(conan_provide_dependency method package_name) + set_property(GLOBAL PROPERTY CONAN_PROVIDE_DEPENDENCY_INVOKED TRUE) + get_property(_conan_install_success GLOBAL PROPERTY CONAN_INSTALL_SUCCESS) + if(NOT _conan_install_success) + find_program(CONAN_COMMAND "conan" REQUIRED) + conan_get_version("${CONAN_COMMAND}" CONAN_CURRENT_VERSION) + conan_version_check(MINIMUM ${CONAN_MINIMUM_VERSION} CURRENT ${CONAN_CURRENT_VERSION}) + message(STATUS "CMake-Conan: first find_package() found. Installing dependencies with Conan") + if("default" IN_LIST CONAN_HOST_PROFILE OR "default" IN_LIST CONAN_BUILD_PROFILE) + conan_profile_detect_default() + endif() + if("auto-cmake" IN_LIST CONAN_HOST_PROFILE) + detect_host_profile(${CMAKE_BINARY_DIR}/conan_host_profile) + endif() + construct_profile_argument(_host_profile_flags CONAN_HOST_PROFILE) + construct_profile_argument(_build_profile_flags CONAN_BUILD_PROFILE) + if(EXISTS "${CMAKE_SOURCE_DIR}/conanfile.py") + file(READ "${CMAKE_SOURCE_DIR}/conanfile.py" outfile) + if(NOT "${outfile}" MATCHES ".*CMakeConfigDeps.*") + message(WARNING "Cmake-conan: CMakeConfigDeps generator was not defined in the conanfile") + endif() + elseif (EXISTS "${CMAKE_SOURCE_DIR}/conanfile.txt") + file(READ "${CMAKE_SOURCE_DIR}/conanfile.txt" outfile) + if(NOT "${outfile}" MATCHES ".*CMakeConfigDeps.*") + message(WARNING "Cmake-conan: CMakeConfigDeps generator was not defined in the conanfile") + endif() + endif() + + get_property(_multiconfig_generator GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + + if(DEFINED CONAN_INSTALL_BUILD_CONFIGURATIONS) + # Configurations are specified by the project or user + set(_build_configs "${CONAN_INSTALL_BUILD_CONFIGURATIONS}") + list(LENGTH _build_configs _build_configs_length) + if(NOT _multiconfig_generator AND _build_configs_length GREATER 1) + message(FATAL_ERROR "cmake-conan: when using a single-config CMake generator, " + "please only specify a single configuration in CONAN_INSTALL_BUILD_CONFIGURATIONS") + endif() + unset(_build_configs_length) + else() + # No configuration overrides, provide sensible defaults + if(_multiconfig_generator) + set(_build_configs Release Debug) + else() + set(_build_configs ${CMAKE_BUILD_TYPE}) + endif() + + endif() + + list(JOIN _build_configs ", " _build_configs_msg) + message(STATUS "CMake-Conan: Installing configuration(s): ${_build_configs_msg}") + foreach(_build_config IN LISTS _build_configs) + set(_self_build_config "") + if(NOT _multiconfig_generator AND NOT _build_config STREQUAL "${CMAKE_BUILD_TYPE}") + set(_self_build_config -s &:build_type=${CMAKE_BUILD_TYPE}) + endif() + conan_install(${_host_profile_flags} ${_build_profile_flags} -s build_type=${_build_config} ${_self_build_config} ${CONAN_INSTALL_ARGS}) + endforeach() + + get_property(_conan_generators_folder GLOBAL PROPERTY CONAN_GENERATORS_FOLDER) + if(EXISTS "${_conan_generators_folder}/conan_cmakedeps_paths.cmake") + message(STATUS "CMake-Conan: Loading conan_cmakedeps_paths.cmake file") + include(${_conan_generators_folder}/conan_cmakedeps_paths.cmake) + endif() + + unset(_self_build_config) + unset(_multiconfig_generator) + unset(_build_configs) + unset(_build_configs_msg) + unset(_host_profile_flags) + unset(_build_profile_flags) + unset(_conan_install_success) + else() + message(STATUS "CMake-Conan: find_package(${ARGV1}) found, 'conan install' already ran") + unset(_conan_install_success) + endif() + + get_property(_conan_generators_folder GLOBAL PROPERTY CONAN_GENERATORS_FOLDER) + + # Ensure that we consider Conan-provided packages ahead of any other, + # irrespective of other settings that modify the search order or search paths + # This follows the guidelines from the find_package documentation + # (https://cmake.org/cmake/help/latest/command/find_package.html): + # find_package ( PATHS paths... NO_DEFAULT_PATH) + # find_package () + + # Filter out `REQUIRED` from the argument list, as the first call may fail + set(_find_args_${package_name} "${ARGN}") + list(REMOVE_ITEM _find_args_${package_name} "REQUIRED") + if(NOT "MODULE" IN_LIST _find_args_${package_name}) + find_package(${package_name} ${_find_args_${package_name}} BYPASS_PROVIDER PATHS "${_conan_generators_folder}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + unset(_find_args_${package_name}) + endif() + + # Invoke find_package a second time - if the first call succeeded, + # this will simply reuse the result. If not, fall back to CMake default search + # behaviour, also allowing modules to be searched. + if(NOT ${package_name}_FOUND) + list(FIND CMAKE_MODULE_PATH "${_conan_generators_folder}" _index) + if(_index EQUAL -1) + list(PREPEND CMAKE_MODULE_PATH "${_conan_generators_folder}") + endif() + unset(_index) + find_package(${package_name} ${ARGN} BYPASS_PROVIDER) + list(REMOVE_ITEM CMAKE_MODULE_PATH "${_conan_generators_folder}") + endif() +endmacro() + + +cmake_language( + SET_DEPENDENCY_PROVIDER conan_provide_dependency + SUPPORTED_METHODS FIND_PACKAGE +) + + +macro(conan_provide_dependency_check) + set(_conan_provide_dependency_invoked FALSE) + get_property(_conan_provide_dependency_invoked GLOBAL PROPERTY CONAN_PROVIDE_DEPENDENCY_INVOKED) + if(NOT _conan_provide_dependency_invoked) + message(WARNING "Conan is correctly configured as dependency provider, " + "but Conan has not been invoked. Please add at least one " + "call to `find_package()`.") + if(DEFINED CONAN_COMMAND) + # supress warning in case `CONAN_COMMAND` was specified but unused. + set(_conan_command ${CONAN_COMMAND}) + unset(_conan_command) + endif() + endif() + unset(_conan_provide_dependency_invoked) +endmacro() + + +# Add a deferred call at the end of processing the top-level directory +# to check if the dependency provider was invoked at all. +cmake_language(DEFER DIRECTORY "${CMAKE_SOURCE_DIR}" CALL conan_provide_dependency_check) + +# Configurable variables for Conan profiles +set(CONAN_HOST_PROFILE "default;auto-cmake" CACHE STRING "Conan host profile") +set(CONAN_BUILD_PROFILE "default" CACHE STRING "Conan build profile") +set(CONAN_INSTALL_ARGS "--build=missing" CACHE STRING "Command line arguments for conan install") + +find_program(_cmake_program NAMES cmake NO_PACKAGE_ROOT_PATH NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH) +if(NOT _cmake_program) + get_filename_component(PATH_TO_CMAKE_BIN "${CMAKE_COMMAND}" DIRECTORY) + set(PATH_TO_CMAKE_BIN "${PATH_TO_CMAKE_BIN}" CACHE INTERNAL "Path where the CMake executable is") +endif() + +cmake_policy(POP) diff --git a/cpp/cmake/cucumber_query-config.cmake.in b/cpp/cmake/cucumber_query-config.cmake.in new file mode 100644 index 00000000..6861f92f --- /dev/null +++ b/cpp/cmake/cucumber_query-config.cmake.in @@ -0,0 +1,8 @@ +@PACKAGE_INIT@ + +include(CMakeFindDependencyMacro) + +find_dependency(cucumber_messages) +find_dependency(nlohmann_json) + +include("${CMAKE_CURRENT_LIST_DIR}/cucumber_query-targets.cmake") diff --git a/cpp/compile_commands.json b/cpp/compile_commands.json new file mode 100644 index 00000000..57dcfbbd --- /dev/null +++ b/cpp/compile_commands.json @@ -0,0 +1,578 @@ +[ +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Attachment.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Attachment.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Attachment.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Attachment.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/AttachmentContentEncoding.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/AttachmentContentEncoding.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/AttachmentContentEncoding.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/AttachmentContentEncoding.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Background.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Background.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Background.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Background.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Ci.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Ci.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Ci.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Ci.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Comment.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Comment.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Comment.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Comment.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/DataTable.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/DataTable.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/DataTable.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/DataTable.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/DocString.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/DocString.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/DocString.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/DocString.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Duration.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Duration.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Duration.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Duration.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Envelope.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Envelope.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Envelope.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Envelope.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Examples.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Examples.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Examples.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Examples.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Exception.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Exception.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Exception.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Exception.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/ExternalAttachment.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/ExternalAttachment.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/ExternalAttachment.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/ExternalAttachment.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Feature.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Feature.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Feature.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Feature.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/FeatureChild.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/FeatureChild.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/FeatureChild.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/FeatureChild.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/GherkinDocument.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/GherkinDocument.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/GherkinDocument.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/GherkinDocument.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Git.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Git.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Git.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Git.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Group.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Group.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Group.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Group.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Hook.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Hook.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Hook.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Hook.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/HookType.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/HookType.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/HookType.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/HookType.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/JavaMethod.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/JavaMethod.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/JavaMethod.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/JavaMethod.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/JavaStackTraceElement.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/JavaStackTraceElement.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/JavaStackTraceElement.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/JavaStackTraceElement.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Location.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Location.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Location.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Location.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Meta.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Meta.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Meta.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Meta.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/ParameterType.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/ParameterType.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/ParameterType.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/ParameterType.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/ParseError.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/ParseError.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/ParseError.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/ParseError.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Pickle.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Pickle.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Pickle.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Pickle.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/PickleDocString.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/PickleDocString.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/PickleDocString.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/PickleDocString.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/PickleStep.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/PickleStep.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/PickleStep.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/PickleStep.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/PickleStepArgument.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/PickleStepArgument.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/PickleStepArgument.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/PickleStepArgument.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/PickleStepType.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/PickleStepType.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/PickleStepType.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/PickleStepType.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/PickleTable.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/PickleTable.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/PickleTable.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/PickleTable.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/PickleTableCell.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/PickleTableCell.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/PickleTableCell.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/PickleTableCell.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/PickleTableRow.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/PickleTableRow.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/PickleTableRow.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/PickleTableRow.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/PickleTag.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/PickleTag.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/PickleTag.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/PickleTag.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Product.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Product.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Product.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Product.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Rule.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Rule.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Rule.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Rule.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/RuleChild.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/RuleChild.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/RuleChild.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/RuleChild.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Scenario.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Scenario.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Scenario.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Scenario.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Snippet.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Snippet.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Snippet.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Snippet.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Source.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Source.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Source.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Source.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/SourceMediaType.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/SourceMediaType.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/SourceMediaType.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/SourceMediaType.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/SourceReference.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/SourceReference.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/SourceReference.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/SourceReference.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Step.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Step.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Step.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Step.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/StepDefinition.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/StepDefinition.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/StepDefinition.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/StepDefinition.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/StepDefinitionPattern.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/StepDefinitionPattern.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/StepDefinitionPattern.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/StepDefinitionPattern.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/StepDefinitionPatternType.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/StepDefinitionPatternType.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/StepDefinitionPatternType.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/StepDefinitionPatternType.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/StepKeywordType.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/StepKeywordType.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/StepKeywordType.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/StepKeywordType.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/StepMatchArgument.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/StepMatchArgument.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/StepMatchArgument.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/StepMatchArgument.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/StepMatchArgumentsList.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/StepMatchArgumentsList.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/StepMatchArgumentsList.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/StepMatchArgumentsList.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Suggestion.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Suggestion.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Suggestion.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Suggestion.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TableCell.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TableCell.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TableCell.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TableCell.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TableRow.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TableRow.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TableRow.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TableRow.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Tag.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Tag.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Tag.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Tag.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestCase.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestCase.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestCase.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestCase.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestCaseFinished.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestCaseFinished.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestCaseFinished.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestCaseFinished.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestCaseStarted.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestCaseStarted.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestCaseStarted.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestCaseStarted.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestRunFinished.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestRunFinished.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestRunFinished.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestRunFinished.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestRunHookFinished.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestRunHookFinished.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestRunHookFinished.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestRunHookFinished.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestRunHookStarted.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestRunHookStarted.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestRunHookStarted.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestRunHookStarted.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestRunStarted.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestRunStarted.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestRunStarted.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestRunStarted.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestStep.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestStep.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestStep.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestStep.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestStepFinished.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestStepFinished.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestStepFinished.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestStepFinished.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestStepResult.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestStepResult.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestStepResult.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestStepResult.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestStepResultStatus.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestStepResultStatus.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestStepResultStatus.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestStepResultStatus.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestStepStarted.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestStepStarted.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/TestStepStarted.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/TestStepStarted.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Timestamp.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Timestamp.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/Timestamp.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/Timestamp.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/UndefinedParameterType.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/UndefinedParameterType.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/generated/cucumber/messages/UndefinedParameterType.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/generated/cucumber/messages/UndefinedParameterType.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -I/workspaces/cucumber-cpp-development/messages/cpp/src/messages -O3 -DNDEBUG -std=c++17 -o messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/messages/cucumber/messages/DurationUtil.cpp.o -c /workspaces/cucumber-cpp-development/messages/cpp/src/messages/cucumber/messages/DurationUtil.cpp", + "file": "/workspaces/cucumber-cpp-development/messages/cpp/src/messages/cucumber/messages/DurationUtil.cpp", + "output": "messages/cpp/CMakeFiles/cucumber_messages_lib.dir/src/messages/cucumber/messages/DurationUtil.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/gherkin/cpp/include/gherkin -I/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/App.cpp.o -c /workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/App.cpp", + "file": "/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/App.cpp", + "output": "gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/App.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/gherkin/cpp/include/gherkin -I/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/AstBuilder.cpp.o -c /workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/AstBuilder.cpp", + "file": "/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/AstBuilder.cpp", + "output": "gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/AstBuilder.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/gherkin/cpp/include/gherkin -I/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/AstNode.cpp.o -c /workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/AstNode.cpp", + "file": "/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/AstNode.cpp", + "output": "gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/AstNode.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/gherkin/cpp/include/gherkin -I/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/Demangle.cpp.o -c /workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/Demangle.cpp", + "file": "/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/Demangle.cpp", + "output": "gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/Demangle.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/gherkin/cpp/include/gherkin -I/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/Dialect.cpp.o -c /workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/Dialect.cpp", + "file": "/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/Dialect.cpp", + "output": "gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/Dialect.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/gherkin/cpp/include/gherkin -I/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/Exceptions.cpp.o -c /workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/Exceptions.cpp", + "file": "/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/Exceptions.cpp", + "output": "gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/Exceptions.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/gherkin/cpp/include/gherkin -I/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/IdGenerator.cpp.o -c /workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/IdGenerator.cpp", + "file": "/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/IdGenerator.cpp", + "output": "gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/IdGenerator.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/gherkin/cpp/include/gherkin -I/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/Keywords.cpp.o -c /workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/Keywords.cpp", + "file": "/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/Keywords.cpp", + "output": "gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/Keywords.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/gherkin/cpp/include/gherkin -I/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/Line.cpp.o -c /workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/Line.cpp", + "file": "/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/Line.cpp", + "output": "gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/Line.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/gherkin/cpp/include/gherkin -I/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/ParseError.cpp.o -c /workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/ParseError.cpp", + "file": "/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/ParseError.cpp", + "output": "gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/ParseError.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/gherkin/cpp/include/gherkin -I/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/PickleCompiler.cpp.o -c /workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/PickleCompiler.cpp", + "file": "/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/PickleCompiler.cpp", + "output": "gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/PickleCompiler.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/gherkin/cpp/include/gherkin -I/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/PickleCompilerContext.cpp.o -c /workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/PickleCompilerContext.cpp", + "file": "/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/PickleCompilerContext.cpp", + "output": "gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/PickleCompilerContext.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/gherkin/cpp/include/gherkin -I/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/Regex.cpp.o -c /workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/Regex.cpp", + "file": "/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/Regex.cpp", + "output": "gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/Regex.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/gherkin/cpp/include/gherkin -I/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/RuleType.cpp.o -c /workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/RuleType.cpp", + "file": "/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/RuleType.cpp", + "output": "gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/RuleType.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/gherkin/cpp/include/gherkin -I/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/Token.cpp.o -c /workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/Token.cpp", + "file": "/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/Token.cpp", + "output": "gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/Token.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/gherkin/cpp/include/gherkin -I/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/TokenFormatterBuilder.cpp.o -c /workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/TokenFormatterBuilder.cpp", + "file": "/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/TokenFormatterBuilder.cpp", + "output": "gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/TokenFormatterBuilder.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/gherkin/cpp/include/gherkin -I/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/TokenMatcher.cpp.o -c /workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/TokenMatcher.cpp", + "file": "/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/TokenMatcher.cpp", + "output": "gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/TokenMatcher.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/gherkin/cpp/include/gherkin -I/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/TokenScanner.cpp.o -c /workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/TokenScanner.cpp", + "file": "/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/TokenScanner.cpp", + "output": "gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/TokenScanner.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/gherkin/cpp/include/gherkin -I/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/Utils.cpp.o -c /workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/Utils.cpp", + "file": "/workspaces/cucumber-cpp-development/gherkin/cpp/src/lib/gherkin/cucumber/gherkin/Utils.cpp", + "output": "gherkin/cpp/src/lib/gherkin/CMakeFiles/cucumber_gherkin_lib.dir/cucumber/gherkin/Utils.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/gherkin/cpp/src/bin/gherkin -I/workspaces/cucumber-cpp-development/gherkin/cpp/include/gherkin -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o gherkin/cpp/src/bin/gherkin/CMakeFiles/cucumber_gherkin_bin.dir/Gherkin.cpp.o -c /workspaces/cucumber-cpp-development/gherkin/cpp/src/bin/gherkin/Gherkin.cpp", + "file": "/workspaces/cucumber-cpp-development/gherkin/cpp/src/bin/gherkin/Gherkin.cpp", + "output": "gherkin/cpp/src/bin/gherkin/CMakeFiles/cucumber_gherkin_bin.dir/Gherkin.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/gherkin/cpp/src/bin/gherkin-generate-tokens -I/workspaces/cucumber-cpp-development/gherkin/cpp/include/gherkin -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o gherkin/cpp/src/bin/gherkin-generate-tokens/CMakeFiles/cucumber_gherkin_generate_tokens_bin.dir/GherkinGenerateTokens.cpp.o -c /workspaces/cucumber-cpp-development/gherkin/cpp/src/bin/gherkin-generate-tokens/GherkinGenerateTokens.cpp", + "file": "/workspaces/cucumber-cpp-development/gherkin/cpp/src/bin/gherkin-generate-tokens/GherkinGenerateTokens.cpp", + "output": "gherkin/cpp/src/bin/gherkin-generate-tokens/CMakeFiles/cucumber_gherkin_generate_tokens_bin.dir/GherkinGenerateTokens.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/query/cpp/include -I/workspaces/cucumber-cpp-development/query/cpp/src/query -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o query/cpp/CMakeFiles/cucumber_query_lib.dir/src/query/Lineage.cpp.o -c /workspaces/cucumber-cpp-development/query/cpp/src/query/Lineage.cpp", + "file": "/workspaces/cucumber-cpp-development/query/cpp/src/query/Lineage.cpp", + "output": "query/cpp/CMakeFiles/cucumber_query_lib.dir/src/query/Lineage.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/query/cpp/include -I/workspaces/cucumber-cpp-development/query/cpp/src/query -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o query/cpp/CMakeFiles/cucumber_query_lib.dir/src/query/Query.cpp.o -c /workspaces/cucumber-cpp-development/query/cpp/src/query/Query.cpp", + "file": "/workspaces/cucumber-cpp-development/query/cpp/src/query/Query.cpp", + "output": "query/cpp/CMakeFiles/cucumber_query_lib.dir/src/query/Query.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/query/cpp/include -I/workspaces/cucumber-cpp-development/query/cpp/src/query -I/workspaces/cucumber-cpp-development/messages/cpp/include/util -I/workspaces/cucumber-cpp-development/messages/cpp/include/generated -O3 -DNDEBUG -std=c++17 -o query/cpp/CMakeFiles/cucumber_query_lib.dir/src/query/NamingStrategy.cpp.o -c /workspaces/cucumber-cpp-development/query/cpp/src/query/NamingStrategy.cpp", + "file": "/workspaces/cucumber-cpp-development/query/cpp/src/query/NamingStrategy.cpp", + "output": "query/cpp/CMakeFiles/cucumber_query_lib.dir/src/query/NamingStrategy.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/tag-expressions/cpp/include -I/workspaces/cucumber-cpp-development/tag-expressions/cpp/src -O3 -DNDEBUG -std=c++17 -o tag-expressions/cpp/CMakeFiles/cucumber_tag_expressions_lib.dir/src/cucumber/tag-expressions/Error.cpp.o -c /workspaces/cucumber-cpp-development/tag-expressions/cpp/src/cucumber/tag-expressions/Error.cpp", + "file": "/workspaces/cucumber-cpp-development/tag-expressions/cpp/src/cucumber/tag-expressions/Error.cpp", + "output": "tag-expressions/cpp/CMakeFiles/cucumber_tag_expressions_lib.dir/src/cucumber/tag-expressions/Error.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/tag-expressions/cpp/include -I/workspaces/cucumber-cpp-development/tag-expressions/cpp/src -O3 -DNDEBUG -std=c++17 -o tag-expressions/cpp/CMakeFiles/cucumber_tag_expressions_lib.dir/src/cucumber/tag-expressions/Model.cpp.o -c /workspaces/cucumber-cpp-development/tag-expressions/cpp/src/cucumber/tag-expressions/Model.cpp", + "file": "/workspaces/cucumber-cpp-development/tag-expressions/cpp/src/cucumber/tag-expressions/Model.cpp", + "output": "tag-expressions/cpp/CMakeFiles/cucumber_tag_expressions_lib.dir/src/cucumber/tag-expressions/Model.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/tag-expressions/cpp/include -I/workspaces/cucumber-cpp-development/tag-expressions/cpp/src -O3 -DNDEBUG -std=c++17 -o tag-expressions/cpp/CMakeFiles/cucumber_tag_expressions_lib.dir/src/cucumber/tag-expressions/Parser.cpp.o -c /workspaces/cucumber-cpp-development/tag-expressions/cpp/src/cucumber/tag-expressions/Parser.cpp", + "file": "/workspaces/cucumber-cpp-development/tag-expressions/cpp/src/cucumber/tag-expressions/Parser.cpp", + "output": "tag-expressions/cpp/CMakeFiles/cucumber_tag_expressions_lib.dir/src/cucumber/tag-expressions/Parser.cpp.o" +}, +{ + "directory": "/workspaces/cucumber-cpp-development/build/host-system", + "command": "/usr/bin/c++ -I/workspaces/cucumber-cpp-development/tag-expressions/cpp/include -I/workspaces/cucumber-cpp-development/tag-expressions/cpp/src -O3 -DNDEBUG -std=c++17 -o tag-expressions/cpp/CMakeFiles/cucumber_tag_expressions_lib.dir/src/cucumber/tag-expressions/Token.cpp.o -c /workspaces/cucumber-cpp-development/tag-expressions/cpp/src/cucumber/tag-expressions/Token.cpp", + "file": "/workspaces/cucumber-cpp-development/tag-expressions/cpp/src/cucumber/tag-expressions/Token.cpp", + "output": "tag-expressions/cpp/CMakeFiles/cucumber_tag_expressions_lib.dir/src/cucumber/tag-expressions/Token.cpp.o" +} +] \ No newline at end of file diff --git a/cpp/conanfile.py b/cpp/conanfile.py new file mode 100644 index 00000000..8780ede2 --- /dev/null +++ b/cpp/conanfile.py @@ -0,0 +1,91 @@ +from conan import ConanFile +from conan.tools.build import can_run, check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +import os + +class CucumberQuery(ConanFile): + name = "cucumber_query" + version = "0.1.0" + package_type = "library" + + license = "MIT" + url = "https://github.com/cucumber/query" + homepage = "https://github.com/cucumber/query" + description = "Cucumber Query for C++" + topics = ("cucumber", "query", "bdd", "json") + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + } + + def set_version(self): + version_file = os.path.join(self.recipe_folder, "VERSION") + if os.path.exists(version_file): + with open(version_file, "r", encoding="utf-8") as f: + self.version = f.readline().strip() + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def _build_tests(self): + # Unit tests read the repo-root testdata/ folder, which is not part of + # the exported package, so only build them when that folder is present. + if self.conf.get("tools.build:skip_test", default=False): + return False + return os.path.isdir(os.path.join(self.source_folder, os.pardir, "testdata")) + + def requirements(self): + self.requires("nlohmann_json/3.12.0") + self.requires("cucumber_messages/34.2.1") + + def build_requirements(self): + if not self.conf.get("tools.build:skip_test", default=False): + self.test_requires("gtest/1.17.0") + + def validate(self): + check_min_cppstd(self, 17) + + def layout(self): + cmake_layout(self) + + def generate(self): + cmake_deps = CMakeDeps(self) + cmake_deps.generate() + + cmake_toolchain = CMakeToolchain(self) + cmake_toolchain.user_presets_path = False + cmake_toolchain.cache_variables["CUCUMBER_QUERY_BUILD_TESTS"] = self._build_tests() + cmake_toolchain.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + if self._build_tests() and can_run(self): + cmake.ctest() + + def package(self): + cmake = CMake(self) + cmake.install() + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "cucumber_query") + self.cpp_info.set_property("cmake_target_name", "cucumber::query") + self.cpp_info.libs = ["cucumber_query"] + + + exports_sources = ( + "cmake/*", + "include/*", + "src/*", + "CMakeLists.txt", + "README.md", + "VERSION", + ) diff --git a/cpp/include/cucumber/query/Lineage.hpp b/cpp/include/cucumber/query/Lineage.hpp new file mode 100644 index 00000000..4723c0b1 --- /dev/null +++ b/cpp/include/cucumber/query/Lineage.hpp @@ -0,0 +1,34 @@ +#ifndef CUCUMBER_QUERY_LINEAGE_HPP +#define CUCUMBER_QUERY_LINEAGE_HPP + +#include "cucumber/messages/Background.hpp" +#include "cucumber/messages/Examples.hpp" +#include "cucumber/messages/Feature.hpp" +#include "cucumber/messages/GherkinDocument.hpp" +#include "cucumber/messages/Rule.hpp" +#include "cucumber/messages/Scenario.hpp" +#include "cucumber/messages/TableRow.hpp" +#include +#include +#include + +namespace cucumber::query +{ + struct Lineage + { + std::shared_ptr gherkinDocument; + std::shared_ptr feature; + std::shared_ptr background; + std::shared_ptr rule; + std::shared_ptr ruleBackground; + std::shared_ptr scenario; + std::shared_ptr examples; + std::optional examplesIndex; + std::shared_ptr example; + std::optional exampleIndex; + + auto operator+(const Lineage& other) const -> Lineage; + }; +} + +#endif diff --git a/cpp/include/cucumber/query/NamingStrategy.hpp b/cpp/include/cucumber/query/NamingStrategy.hpp new file mode 100644 index 00000000..152f1144 --- /dev/null +++ b/cpp/include/cucumber/query/NamingStrategy.hpp @@ -0,0 +1,61 @@ +#ifndef CUCUMBER_QUERY_NAMING_STRATEGY_HPP +#define CUCUMBER_QUERY_NAMING_STRATEGY_HPP + +#include "cucumber/messages/Pickle.hpp" +#include "cucumber/query/Lineage.hpp" +#include +#include +#include + +namespace cucumber::query +{ + struct NamingStrategy + { + NamingStrategy() = default; + + NamingStrategy(const NamingStrategy&) = default; + NamingStrategy(NamingStrategy&&) = default; + auto operator=(const NamingStrategy&) -> NamingStrategy& = default; + auto operator=(NamingStrategy&&) -> NamingStrategy& = default; + + virtual ~NamingStrategy() = default; + + [[nodiscard]] virtual auto Reduce(const Lineage& lineage, const messages::Pickle& pickle) const -> std::string = 0; + }; + + enum class NamingStrategyLength : std::uint8_t + { + longName, + shortName, + }; + + enum class NamingStrategyFeatureName : std::uint8_t + { + include, + exclude, + }; + + enum class NamingStrategyExampleName : std::uint8_t + { + number, + pickle, + numberAndPickleIfParameterized, + }; + + struct BuiltinNamingStrategy : NamingStrategy + { + BuiltinNamingStrategy(NamingStrategyLength length, NamingStrategyFeatureName featureName, NamingStrategyExampleName exampleName); + + [[nodiscard]] auto Reduce(const Lineage& lineage, const messages::Pickle& pickle) const -> std::string override; + + private: + NamingStrategyLength length; + NamingStrategyFeatureName featureName; + NamingStrategyExampleName exampleName; + }; + + auto CreateNamingStrategy(NamingStrategyLength length, NamingStrategyFeatureName featureName = NamingStrategyFeatureName::include, + NamingStrategyExampleName exampleName = NamingStrategyExampleName::numberAndPickleIfParameterized) -> std::unique_ptr; +} + +#endif diff --git a/cpp/include/cucumber/query/Query.hpp b/cpp/include/cucumber/query/Query.hpp new file mode 100644 index 00000000..7d2f5bd9 --- /dev/null +++ b/cpp/include/cucumber/query/Query.hpp @@ -0,0 +1,251 @@ +#ifndef CUCUMBER_QUERY_QUERY_HPP +#define CUCUMBER_QUERY_QUERY_HPP + +#include "cucumber/messages/All.hpp" +#include "cucumber/messages/Envelope.hpp" +#include "cucumber/messages/Feature.hpp" +#include "cucumber/messages/GherkinDocument.hpp" +#include "cucumber/messages/Pickle.hpp" +#include "cucumber/messages/Rule.hpp" +#include "cucumber/messages/TestCase.hpp" +#include "cucumber/messages/TestCaseStarted.hpp" +#include "cucumber/messages/TestStepFinished.hpp" +#include "cucumber/messages/TestStepResultStatus.hpp" +#include "cucumber/query/Lineage.hpp" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace cucumber::query +{ + struct LineageAndPickle + { + std::shared_ptr lineage; + std::shared_ptr pickle; + }; + + struct TestStepFinishedAndTestStep{ + std::shared_ptr testStepFinished; + std::shared_ptr testStep; + }; + + class Query + { + public: + auto Update(const cucumber::messages::Envelope& envelope) -> void; + + [[nodiscard]] auto CountMostSevereTestStepResultStatus() const -> std::unordered_map; + + [[nodiscard]] auto CountTestCasesStarted() const -> std::size_t; + + [[nodiscard]] auto FindAllPickles() const -> std::vector>; + + [[nodiscard]] auto FindAllPickleSteps() const -> std::vector>; + + [[nodiscard]] auto FindAllStepDefinitions() const -> std::vector>; + + [[nodiscard]] auto FindAllTestCaseStarted() const -> std::vector>; + + [[nodiscard]] auto FindAllTestCaseFinished() const -> std::vector>; + + template + [[nodiscard]] auto FindAllTestCaseStartedOrderBy(TFind findOrderBy, Cmp order) const -> std::vector>; + + template + [[nodiscard]] auto FindAllTestCaseFinishedOrderBy(TFind findOrderBy, Cmp order) const -> std::vector>; + + [[nodiscard]] auto FindAllTestSteps() const -> std::vector>; + + [[nodiscard]] auto FindAllTestCases() const -> std::vector>; + + [[nodiscard]] auto FindAllTestStepStarted() const -> std::vector>; + + [[nodiscard]] auto FindAllTestStepFinished() const -> std::vector>; + + [[nodiscard]] auto FindAllTestRunHookStarted() const -> std::vector>; + + [[nodiscard]] auto FindAllTestRunHookFinished() const -> std::vector>; + + [[nodiscard]] auto FindAllUndefinedParameterTypes() const -> std::vector>; + + [[nodiscard]] auto FindAttachmentsBy(const std::shared_ptr& element) const -> std::vector>; + [[nodiscard]] auto FindAttachmentsBy(const std::shared_ptr& element) const -> std::vector>; + + [[nodiscard]] auto FindHookBy(const std::shared_ptr& element) const -> std::optional>; + [[nodiscard]] auto FindHookBy(const std::shared_ptr& element) const -> std::optional>; + [[nodiscard]] auto FindHookBy(const std::shared_ptr& element) const -> std::optional>; + + [[nodiscard]] auto FindMeta() const -> std::optional>; + + [[nodiscard]] auto FindMostSevereTestStepResultBy(const std::shared_ptr& element) const -> std::optional>; + [[nodiscard]] auto FindMostSevereTestStepResultBy(const std::shared_ptr& element) const -> std::optional>; + + [[nodiscard]] auto FindLocationOf(const std::shared_ptr& pickle) const -> std::optional>; + + [[nodiscard]] auto FindPickleBy(const std::shared_ptr& element) const -> std::optional>; + [[nodiscard]] auto FindPickleBy(const std::shared_ptr& element) const -> std::optional>; + [[nodiscard]] auto FindPickleBy(const std::shared_ptr& element) const -> std::optional>; + [[nodiscard]] auto FindPickleBy(const std::shared_ptr& element) const -> std::optional>; + + [[nodiscard]] auto FindPickleStepBy(const std::shared_ptr& testStep) const -> std::optional>; + + [[nodiscard]] auto FindStepBy(const std::shared_ptr& pickleStep) const -> std::optional>; + + [[nodiscard]] auto FindStepDefinitionsBy(const std::shared_ptr& testStep) const -> std::vector>; + + [[nodiscard]] auto FindSuggestionsBy(const std::shared_ptr& element) const -> std::vector>; + [[nodiscard]] auto FindSuggestionsBy(const std::shared_ptr& element) const -> std::vector>; + + [[nodiscard]] auto FindUnambiguousStepDefinitionBy(const std::shared_ptr& testStep) const -> std::optional>; + + [[nodiscard]] auto FindTestCaseBy(const std::shared_ptr& element) const -> std::optional>; + [[nodiscard]] auto FindTestCaseBy(const std::shared_ptr& element) const -> std::optional>; + [[nodiscard]] auto FindTestCaseBy(const std::shared_ptr& element) const -> std::optional>; + [[nodiscard]] auto FindTestCaseBy(const std::shared_ptr& element) const -> std::optional>; + + [[nodiscard]] auto FindTestCaseDurationBy(const std::shared_ptr& element) const -> std::optional>; + + [[nodiscard]] auto FindTestCaseDurationBy(const std::shared_ptr& element) const -> std::optional>; + + [[nodiscard]] auto FindTestCaseStartedBy(const std::shared_ptr& element) const -> std::optional>; + [[nodiscard]] auto FindTestCaseStartedBy(const std::shared_ptr& element) const -> std::optional>; + [[nodiscard]] auto FindTestCaseStartedBy(const std::shared_ptr& element) const -> std::optional>; + + [[nodiscard]] auto FindTestCaseFinishedBy(const std::shared_ptr& testCaseStarted) const -> std::optional>; + + [[nodiscard]] auto FindTestRunHookStartedBy(const std::shared_ptr& testRunHookFinished) const + -> std::optional>; + + [[nodiscard]] auto FindTestRunHookFinishedBy(const std::shared_ptr& testRunHookStarted) const + -> std::optional>; + + [[nodiscard]] auto FindTestRunDuration() const -> std::optional>; + + [[nodiscard]] auto FindTestRunFinished() const -> std::optional>; + + [[nodiscard]] auto FindTestRunStarted() const -> std::optional>; + + [[nodiscard]] auto FindTestStepBy(const std::shared_ptr& element) const -> std::optional>; + [[nodiscard]] auto FindTestStepBy(const std::shared_ptr& element) const -> std::optional>; + + [[nodiscard]] auto FindTestStepsStartedBy(const std::shared_ptr& testCaseStarted) const -> std::vector>; + [[nodiscard]] auto FindTestStepsStartedBy(const std::shared_ptr& testCaseFinished) const -> std::vector>; + + [[nodiscard]] auto FindTestStepsFinishedBy(const std::shared_ptr& element) const -> std::vector>; + [[nodiscard]] auto FindTestStepsFinishedBy(const std::shared_ptr& element) const -> std::vector>; + + [[nodiscard]] auto FindTestStepFinishedAndTestStepBy(const std::shared_ptr& testCaseStarted) const + -> std::vector; + + [[nodiscard]] auto FindLineageBy(const std::shared_ptr& element) const -> std::optional; + [[nodiscard]] auto FindLineageBy(const std::shared_ptr& element) const -> std::optional; + [[nodiscard]] auto FindLineageBy(const std::shared_ptr& element) const -> std::optional; + + private: + auto UpdateGherkinDocument(const std::shared_ptr& gherkinDocument) -> void; + auto UpdateFeature(const std::shared_ptr& feature, const std::shared_ptr& lineage) -> void; + auto UpdateRule(const std::shared_ptr& rule, const std::shared_ptr& lineage) -> void; + auto UpdateScenario(const std::shared_ptr& scenario, const std::shared_ptr& lineage) -> void; + auto UpdateSteps(const std::vector>& steps) -> void; + auto UpdatePickle(std::shared_ptr pickle) -> void; + auto UpdateTestRunHookStarted(const std::shared_ptr& testRunHookStarted) -> void; + auto UpdateTestRunHookFinished(const std::shared_ptr& testRunHookFinished) -> void; + auto UpdateTestCase(std::shared_ptr testCase) -> void; + auto UpdateTestCaseStarted(std::shared_ptr testCaseStarted) -> void; + auto UpdateAttachment(const std::shared_ptr& attachment) -> void; + auto UpdateTestStepFinished(std::shared_ptr testStepFinished) -> void; + auto UpdateTestCaseFinished(std::shared_ptr testCaseFinished) -> void; + + std::optional> meta; + + std::optional> testRunStarted; + std::optional> testRunFinished; + + std::unordered_map> testCaseStartedById; + std::unordered_map> lineageById; + std::unordered_map> stepById; + std::unordered_map> pickleById; + std::unordered_map> pickleStepById; + std::unordered_map> hookById; + std::unordered_map> stepDefinitionById; + std::unordered_map> testCaseById; + std::unordered_map> testStepById; + std::unordered_map> testCaseFinishedByTestCaseStartedId; + std::unordered_map> testRunHookStartedById; + std::unordered_map> testRunHookFinishedByTestRunHookStartedId; + std::unordered_map>> testStepStartedByTestCaseStartedId; + std::unordered_map>> testStepFinishedByTestCaseStartedId; + std::unordered_map>> attachmentsByTestCaseStartedId; + std::unordered_map>> attachmentsByTestRunHookStartedId; + std::unordered_map> suggestionsByPickleStepId; + std::vector> undefinedParameterTypes; + }; + + namespace detail + { + template + [[nodiscard]] auto FindAllOrderBy(const Query& query, const std::vector>& allElements, Transform findOrderBy, Cmp order) + -> std::vector> + { + using TransformResult = decltype(std::invoke(findOrderBy, query, std::declval>())); + + std::vector, TransformResult>> transformed; + transformed.reserve(allElements.size()); + + for (const auto& element : allElements) + { + transformed.emplace_back(element, std::invoke(findOrderBy, query, element)); + } + + std::sort(transformed.begin(), transformed.end(), + [&](const auto& lhs, const auto& rhs) + { + const auto lhsHasValue = lhs.second.has_value(); + const auto rhsHasValue = rhs.second.has_value(); + if (!lhsHasValue && !rhsHasValue) + { + return false; + } + if (!lhsHasValue) + { + return true; + } + if (!rhsHasValue) + { + return false; + } + + return std::invoke(order, lhs.second.value(), rhs.second.value()) < 0; + }); + + std::vector> result; + result.reserve(allElements.size()); + for (const auto& pair : transformed) + { + result.push_back(pair.first); + } + + return result; + } + } + + template + [[nodiscard]] auto Query::FindAllTestCaseStartedOrderBy(Transform findOrderBy, Cmp order) const -> std::vector> + { + return detail::FindAllOrderBy(*this, FindAllTestCaseStarted(), std::move(findOrderBy), std::move(order)); + } + + template + [[nodiscard]] auto Query::FindAllTestCaseFinishedOrderBy(Transform findOrderBy, Cmp order) const -> std::vector> + { + return detail::FindAllOrderBy(*this, FindAllTestCaseFinished(), std::move(findOrderBy), std::move(order)); + } +} + +#endif diff --git a/cpp/src/query/Lineage.cpp b/cpp/src/query/Lineage.cpp new file mode 100644 index 00000000..9b09d53e --- /dev/null +++ b/cpp/src/query/Lineage.cpp @@ -0,0 +1,22 @@ +#include "cucumber/query/Lineage.hpp" + +namespace cucumber::query +{ + auto Lineage::operator+(const Lineage& other) const -> Lineage + { + Lineage combined; + + combined.gherkinDocument = other.gherkinDocument ? other.gherkinDocument : gherkinDocument; + combined.feature = other.feature ? other.feature : feature; + combined.background = other.background ? other.background : background; + combined.rule = other.rule ? other.rule : rule; + combined.ruleBackground = other.ruleBackground ? other.ruleBackground : ruleBackground; + combined.scenario = other.scenario ? other.scenario : scenario; + combined.examples = other.examples ? other.examples : examples; + combined.examplesIndex = other.examplesIndex ? other.examplesIndex : examplesIndex; + combined.example = other.example ? other.example : example; + combined.exampleIndex = other.exampleIndex ? other.exampleIndex : exampleIndex; + + return combined; + } +} diff --git a/cpp/src/query/NamingStrategy.cpp b/cpp/src/query/NamingStrategy.cpp new file mode 100644 index 00000000..dcf7073e --- /dev/null +++ b/cpp/src/query/NamingStrategy.cpp @@ -0,0 +1,99 @@ +#include "cucumber/query/NamingStrategy.hpp" +#include "cucumber/query/Lineage.hpp" +#include +#include +#include +#include +#include +#include + +namespace cucumber::query +{ + BuiltinNamingStrategy::BuiltinNamingStrategy(NamingStrategyLength length, NamingStrategyFeatureName featureName, NamingStrategyExampleName exampleName) + : length{ length } + , featureName{ featureName } + , exampleName{ exampleName } + {} + + auto BuiltinNamingStrategy::Reduce(const Lineage& lineage, const messages::Pickle& pickle) const -> std::string + { + static constexpr std::size_t namingStrategyPartsCount = 8; + + std::vector parts(namingStrategyPartsCount); + + if (lineage.feature && !lineage.feature->name.empty() && featureName == NamingStrategyFeatureName::include) + { + parts.emplace_back(lineage.feature->name); + } + + if (lineage.rule && !lineage.rule->name.empty()) + { + parts.emplace_back(lineage.rule->name); + } + + if (lineage.scenario && !lineage.scenario->name.empty()) + { + parts.emplace_back(lineage.scenario->name); + } + else + { + parts.emplace_back(pickle.name); + } + + if (lineage.examples && !lineage.examples->name.empty()) + { + parts.emplace_back(lineage.examples->name); + } + + if (lineage.example) + { + const auto exampleNumber = "#" + std::to_string(lineage.examplesIndex.value_or(0) + 1) + "." + std::to_string(lineage.exampleIndex.value_or(0) + 1); + + switch (exampleName) + { + case NamingStrategyExampleName::number: + parts.emplace_back(exampleNumber); + break; + case NamingStrategyExampleName::pickle: + parts.emplace_back(pickle.name); + break; + case NamingStrategyExampleName::numberAndPickleIfParameterized: + if (lineage.scenario && lineage.scenario->name != pickle.name) + { + parts.emplace_back(exampleNumber + ": " + pickle.name); + } + else + { + parts.emplace_back(exampleNumber); + } + break; + } + } + + if (this->length == NamingStrategyLength::shortName) + { + return parts.back(); + } + + return std::accumulate(parts.begin(), parts.end(), std::string{}, + [](const std::string& cumulative, const std::string& element) -> std::string + { + if (element.empty()) + { + return cumulative; + } + + if (cumulative.empty()) + { + return element; + } + + return cumulative + " - " + element; + }); + } + + auto CreateNamingStrategy(NamingStrategyLength length, NamingStrategyFeatureName featureName, NamingStrategyExampleName exampleName) -> std::unique_ptr + { + return std::make_unique(length, featureName, exampleName); + } +} diff --git a/cpp/src/query/Query.cpp b/cpp/src/query/Query.cpp new file mode 100644 index 00000000..83d0b4e4 --- /dev/null +++ b/cpp/src/query/Query.cpp @@ -0,0 +1,889 @@ +#include "cucumber/query/Query.hpp" +#include "cucumber/messages/All.hpp" +#include "cucumber/messages/DurationUtil.hpp" +#include "cucumber/messages/TestStepResultStatus.hpp" +#include "cucumber/query/Lineage.hpp" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace cucumber::query +{ + namespace + { + template + auto SortBy(std::vector& container, const Proj& projection) -> void + { + std::sort(container.begin(), container.end(), + [&projection](const auto& lhs, const auto& rhs) + { + return std::stoi(std::invoke(projection, lhs)) < std::stoi(std::invoke(projection, rhs)); + }); + } + + auto SortBySeverity(std::vector& container) -> void + { + std::sort(container.begin(), container.end(), + [](const auto& lhs, const auto& rhs) + { + using underlying_type = std::underlying_type_t; + return static_cast(lhs.testStepFinished->testStepResult->status) > static_cast(rhs.testStepFinished->testStepResult->status); + }); + } + + template + auto MapValuesToVector(const std::unordered_map& container) + { + std::vector result; + result.reserve(container.size()); + + for (const auto& [key, value] : container) + { + result.push_back(value); + } + + return result; + } + + template + auto MapValuesToVectorSortBy(const std::unordered_map& container, const Proj& projection) + { + auto result = MapValuesToVector(container); + + SortBy(result, projection); + + return result; + } + + template + auto MapValuesToVector(const std::unordered_map>& container) + { + std::vector result; + result.reserve(container.size()); + + for (const auto& [key, value] : container) + { + result.insert(result.end(), value.begin(), value.end()); + } + + return result; + } + + template + auto MapValuesToVectorSortBy(const std::unordered_map>& container, const Proj& projection) + { + auto result = MapValuesToVector(container); + + SortBy(result, projection); + + return result; + } + + template + struct overloaded : Ts... + { + using Ts::operator()...; + }; + // explicit deduction guide (not needed as of C++20) + template + overloaded(Ts...) -> overloaded; + } + + auto Query::Update(const cucumber::messages::Envelope& envelope) -> void + { + if (envelope.meta.has_value()) + { + meta = envelope.meta.value(); + } + if (envelope.gherkinDocument.has_value()) + { + UpdateGherkinDocument(envelope.gherkinDocument.value()); + } + if (envelope.pickle.has_value()) + { + UpdatePickle(envelope.pickle.value()); + } + if (envelope.hook.has_value()) + { + hookById[envelope.hook.value()->id] = envelope.hook.value(); + } + if (envelope.stepDefinition.has_value()) + { + stepDefinitionById[envelope.stepDefinition.value()->id] = envelope.stepDefinition.value(); + } + if (envelope.testRunStarted.has_value()) + { + testRunStarted = envelope.testRunStarted.value(); + } + if (envelope.testRunHookStarted.has_value()) + { + UpdateTestRunHookStarted(envelope.testRunHookStarted.value()); + } + if (envelope.testRunHookFinished.has_value()) + { + UpdateTestRunHookFinished(envelope.testRunHookFinished.value()); + } + if (envelope.testCase.has_value()) + { + UpdateTestCase(envelope.testCase.value()); + } + if (envelope.testCaseStarted.has_value()) + { + UpdateTestCaseStarted(envelope.testCaseStarted.value()); + } + if (envelope.testStepStarted.has_value()) + { + testStepStartedByTestCaseStartedId[envelope.testStepStarted.value()->testCaseStartedId].push_back(envelope.testStepStarted.value()); + } + if (envelope.attachment.has_value()) + { + UpdateAttachment(envelope.attachment.value()); + } + if (envelope.testStepFinished.has_value()) + { + UpdateTestStepFinished(envelope.testStepFinished.value()); + } + if (envelope.testCaseFinished.has_value()) + { + UpdateTestCaseFinished(envelope.testCaseFinished.value()); + } + if (envelope.testRunFinished.has_value()) + { + testRunFinished = envelope.testRunFinished.value(); + } + if (envelope.suggestion.has_value()) + { + suggestionsByPickleStepId[envelope.suggestion.value()->pickleStepId] = envelope.suggestion.value(); + } + if (envelope.undefinedParameterType.has_value()) + { + undefinedParameterTypes.push_back(envelope.undefinedParameterType.value()); + } + } + + auto Query::CountMostSevereTestStepResultStatus() const -> std::unordered_map + { + std::unordered_map result{ + { messages::TestStepResultStatus::AMBIGUOUS, 0 }, + { messages::TestStepResultStatus::FAILED, 0 }, + { messages::TestStepResultStatus::PASSED, 0 }, + { messages::TestStepResultStatus::PENDING, 0 }, + { messages::TestStepResultStatus::SKIPPED, 0 }, + { messages::TestStepResultStatus::UNDEFINED, 0 }, + { messages::TestStepResultStatus::UNKNOWN, 0 }, + }; + + for (const auto& testCaseStarted : FindAllTestCaseStarted()) + { + auto testStepFinishedAndTestStep = FindTestStepFinishedAndTestStepBy(testCaseStarted); + if (!testStepFinishedAndTestStep.empty()) + { + SortBySeverity(testStepFinishedAndTestStep); + + ++result[testStepFinishedAndTestStep.front().testStepFinished->testStepResult->status]; + } + } + + return result; + } + + auto Query::CountTestCasesStarted() const -> std::size_t + { + return FindAllTestCaseStarted().size(); + } + + auto Query::FindAllPickles() const -> std::vector> + { + return MapValuesToVectorSortBy(pickleById, &messages::Pickle::id); + } + + auto Query::FindAllPickleSteps() const -> std::vector> + { + return MapValuesToVectorSortBy(pickleStepById, &messages::PickleStep::id); + } + + auto Query::FindAllStepDefinitions() const -> std::vector> + { + return MapValuesToVectorSortBy(stepDefinitionById, &messages::StepDefinition::id); + } + + auto Query::FindAllTestCaseStarted() const -> std::vector> + { + std::vector> result; + + for (const auto& [testCaseStartedId, testCaseStarted] : testCaseStartedById) + { + auto iter = testCaseFinishedByTestCaseStartedId.find(testCaseStarted->id); + + if (iter == testCaseFinishedByTestCaseStartedId.end() || !iter->second->willBeRetried) + { + result.push_back(testCaseStarted); + } + } + + SortBy(result, &messages::TestCaseStarted::id); + + return result; + } + + auto Query::FindAllTestCaseFinished() const -> std::vector> + { + std::vector> result; + + for (const auto& [testCaseStartedId, testCaseFinished] : testCaseFinishedByTestCaseStartedId) + { + if (!testCaseFinished->willBeRetried) + { + result.push_back(testCaseFinished); + } + } + + SortBy(result, &messages::TestCaseFinished::testCaseStartedId); + + return result; + } + + auto Query::FindAllTestSteps() const -> std::vector> + { + return MapValuesToVectorSortBy(testStepById, &messages::TestStep::id); + } + + auto Query::FindAllTestCases() const -> std::vector> + { + return MapValuesToVectorSortBy(testCaseById, &messages::TestCase::id); + } + + auto Query::FindAllTestStepStarted() const -> std::vector> + { + return MapValuesToVectorSortBy(testStepStartedByTestCaseStartedId, &messages::TestStepStarted::testCaseStartedId); + } + + auto Query::FindAllTestStepFinished() const -> std::vector> + { + return MapValuesToVectorSortBy(testStepFinishedByTestCaseStartedId, &messages::TestStepFinished::testCaseStartedId); + } + + auto Query::FindAllTestRunHookStarted() const -> std::vector> + { + return MapValuesToVectorSortBy(testRunHookStartedById, &messages::TestRunHookStarted::id); + } + + auto Query::FindAllTestRunHookFinished() const -> std::vector> + { + return MapValuesToVectorSortBy(testRunHookFinishedByTestRunHookStartedId, &messages::TestRunHookFinished::testRunHookStartedId); + } + + auto Query::FindAllUndefinedParameterTypes() const -> std::vector> + { + return undefinedParameterTypes; + } + + auto Query::FindAttachmentsBy(const std::shared_ptr& element) const -> std::vector> + { + std::vector> result; + if (attachmentsByTestCaseStartedId.find(element->testCaseStartedId) != attachmentsByTestCaseStartedId.end()) + { + for (const auto& attachment : attachmentsByTestCaseStartedId.at(element->testCaseStartedId)) + { + if (attachment->testStepId == element->testStepId) + { + result.push_back(attachment); + } + } + } + return result; + } + + auto Query::FindAttachmentsBy(const std::shared_ptr& element) const -> std::vector> + { + if (attachmentsByTestRunHookStartedId.find(element->testRunHookStartedId) != attachmentsByTestRunHookStartedId.end()) + { + return attachmentsByTestRunHookStartedId.at(element->testRunHookStartedId); + } + return {}; + } + + auto Query::FindHookBy(const std::shared_ptr& element) const -> std::optional> + { + if (element->hookId.has_value()) + { + return hookById.at(element->hookId.value()); + } + return std::nullopt; + } + + auto Query::FindHookBy(const std::shared_ptr& element) const -> std::optional> + { + if (hookById.find(element->hookId) != hookById.end()) + { + return hookById.at(element->hookId); + } + return std::nullopt; + } + + auto Query::FindHookBy(const std::shared_ptr& element) const -> std::optional> + { + const auto testRunHookStarted = FindTestRunHookStartedBy(element); + if (testRunHookStarted.has_value()) + { + return FindHookBy(testRunHookStarted.value()); + } + return std::nullopt; + } + + auto Query::FindMeta() const -> std::optional> + { + return meta; + } + + auto Query::FindMostSevereTestStepResultBy(const std::shared_ptr& element) const -> std::optional> + { + auto testStepFinishedAndTestStep = FindTestStepFinishedAndTestStepBy(element); + if (!testStepFinishedAndTestStep.empty()) + { + SortBySeverity(testStepFinishedAndTestStep); + + return testStepFinishedAndTestStep.front().testStepFinished->testStepResult; + } + return std::nullopt; + } + + auto Query::FindMostSevereTestStepResultBy(const std::shared_ptr& element) const -> std::optional> + { + const auto testCaseStarted = FindTestCaseStartedBy(element); + if (testCaseStarted.has_value()) + { + return FindMostSevereTestStepResultBy(testCaseStarted.value()); + } + return std::nullopt; + } + + auto Query::FindLocationOf(const std::shared_ptr& pickle) const -> std::optional> + { + if (pickle->location.has_value()) + { + return pickle->location.value(); + } + + const auto lineageAndPickle = FindLineageBy(pickle); + + if (lineageAndPickle.has_value()) + { + const auto& lineage = lineageAndPickle.value().lineage; + + if (lineage->example) + { + return lineage->example->location; + } + + if (lineage->scenario) + { + return lineage->scenario->location; + } + } + + return std::nullopt; + } + + auto Query::FindPickleBy(const std::shared_ptr& element) const -> std::optional> + { + const auto& testCase = FindTestCaseBy(element); + if (testCase.has_value()) + { + return pickleById.at(testCase.value()->pickleId); + } + return std::nullopt; + } + + auto Query::FindPickleBy(const std::shared_ptr& element) const -> std::optional> + { + const auto& testCase = FindTestCaseBy(element); + if (testCase.has_value()) + { + return pickleById.at(testCase.value()->pickleId); + } + return std::nullopt; + } + + auto Query::FindPickleBy(const std::shared_ptr& element) const -> std::optional> + { + const auto& testCase = FindTestCaseBy(element); + if (testCase.has_value()) + { + return pickleById.at(testCase.value()->pickleId); + } + return std::nullopt; + } + + auto Query::FindPickleBy(const std::shared_ptr& element) const -> std::optional> + { + const auto& testCase = FindTestCaseBy(element); + if (testCase.has_value()) + { + return pickleById.at(testCase.value()->pickleId); + } + return std::nullopt; + } + + auto Query::FindPickleStepBy(const std::shared_ptr& testStep) const -> std::optional> + { + if (testStep->pickleStepId.has_value()) + { + return pickleStepById.at(testStep->pickleStepId.value()); + } + return std::nullopt; + } + + auto Query::FindStepBy(const std::shared_ptr& pickleStep) const -> std::optional> + { + const auto stepId = pickleStep->astNodeIds.front(); + + if (stepById.find(stepId) != stepById.end()) + { + return stepById.at(pickleStep->astNodeIds.front()); + } + return std::nullopt; + } + + auto Query::FindStepDefinitionsBy(const std::shared_ptr& testStep) const -> std::vector> + { + std::vector> result; + + if (testStep->stepDefinitionIds.has_value()) + { + for (const auto& stepDefinitionId : testStep->stepDefinitionIds.value()) + { + if (stepDefinitionById.find(stepDefinitionId) != stepDefinitionById.end()) + { + result.push_back(stepDefinitionById.at(stepDefinitionId)); + } + } + } + + return result; + } + + auto Query::FindSuggestionsBy(const std::shared_ptr& element) const -> std::vector> + { + if (suggestionsByPickleStepId.find(element->id) != suggestionsByPickleStepId.end()) + { + return { suggestionsByPickleStepId.at(element->id) }; + } + + return {}; + } + + auto Query::FindSuggestionsBy(const std::shared_ptr& element) const -> std::vector> + { + std::vector> result; + for (const auto& pickleStep : element->steps) + { + const auto suggestions = FindSuggestionsBy(pickleStep); + result.insert(result.end(), suggestions.begin(), suggestions.end()); + } + return result; + } + + auto Query::FindUnambiguousStepDefinitionBy(const std::shared_ptr& testStep) const -> std::optional> + { + if (testStep->stepDefinitionIds.has_value() && testStep->stepDefinitionIds.value().size() == 1) + { + const auto stepDefinitionId = testStep->stepDefinitionIds.value().front(); + if (stepDefinitionById.find(stepDefinitionId) != stepDefinitionById.end()) + { + return stepDefinitionById.at(stepDefinitionId); + } + } + return std::nullopt; + } + + auto Query::FindTestCaseBy(const std::shared_ptr& element) const -> std::optional> + { + if (testCaseById.find(element->testCaseId) != testCaseById.end()) + { + return testCaseById.at(element->testCaseId); + } + + return std::nullopt; + } + + auto Query::FindTestCaseBy(const std::shared_ptr& element) const -> std::optional> + { + const auto& testCaseStarted = FindTestCaseStartedBy(element); + if (testCaseStarted.has_value()) + { + return FindTestCaseBy(testCaseStarted.value()); + } + return std::nullopt; + } + + auto Query::FindTestCaseBy(const std::shared_ptr& element) const -> std::optional> + { + const auto& testCaseStarted = FindTestCaseStartedBy(element); + if (testCaseStarted.has_value()) + { + return FindTestCaseBy(testCaseStarted.value()); + } + return std::nullopt; + } + + auto Query::FindTestCaseBy(const std::shared_ptr& element) const -> std::optional> + { + const auto& testCaseStarted = FindTestCaseStartedBy(element); + if (testCaseStarted.has_value()) + { + return FindTestCaseBy(testCaseStarted.value()); + } + return std::nullopt; + } + + auto Query::FindTestCaseDurationBy(const std::shared_ptr& element) const -> std::optional> + { + const auto& testCaseFinished = FindTestCaseFinishedBy(element); + if (testCaseFinished.has_value()) + { + return std::make_shared(*testCaseFinished.value()->timestamp - *element->timestamp); + } + return std::nullopt; + } + + auto Query::FindTestCaseDurationBy(const std::shared_ptr& element) const -> std::optional> + { + const auto testCaseStarted = FindTestCaseStartedBy(element); + + if (testCaseStarted.has_value()) + { + return FindTestCaseDurationBy(testCaseStarted.value()); + } + + return std::nullopt; + } + + auto Query::FindTestCaseStartedBy(const std::shared_ptr& element) const -> std::optional> + { + const auto iter = testCaseStartedById.find(element->testCaseStartedId); + if (iter != testCaseStartedById.end()) + { + return iter->second; + } + return std::nullopt; + } + + auto Query::FindTestCaseStartedBy(const std::shared_ptr& element) const -> std::optional> + { + const auto iter = testCaseStartedById.find(element->testCaseStartedId); + if (iter != testCaseStartedById.end()) + { + return iter->second; + } + return std::nullopt; + } + + auto Query::FindTestCaseStartedBy(const std::shared_ptr& element) const -> std::optional> + { + const auto iter = testCaseStartedById.find(element->testCaseStartedId); + if (iter != testCaseStartedById.end()) + { + return iter->second; + } + return std::nullopt; + } + + auto Query::FindTestCaseFinishedBy(const std::shared_ptr& testCaseStarted) const -> std::optional> + { + if (testCaseFinishedByTestCaseStartedId.find(testCaseStarted->id) != testCaseFinishedByTestCaseStartedId.end()) + { + return testCaseFinishedByTestCaseStartedId.at(testCaseStarted->id); + } + return std::nullopt; + } + + auto Query::FindTestRunHookStartedBy(const std::shared_ptr& testRunHookFinished) const -> std::optional> + { + const auto iter = testRunHookStartedById.find(testRunHookFinished->testRunHookStartedId); + if (iter != testRunHookStartedById.end()) + { + return iter->second; + } + return std::nullopt; + } + + auto Query::FindTestRunHookFinishedBy(const std::shared_ptr& testRunHookStarted) const -> std::optional> + { + if (testRunHookFinishedByTestRunHookStartedId.find(testRunHookStarted->id) != testRunHookFinishedByTestRunHookStartedId.end()) + { + return testRunHookFinishedByTestRunHookStartedId.at(testRunHookStarted->id); + } + return std::nullopt; + } + + auto Query::FindTestRunDuration() const -> std::optional> + { + if (testRunStarted.has_value() && testRunFinished.has_value()) + { + return std::make_shared(*testRunFinished.value()->timestamp - *testRunStarted.value()->timestamp); + } + + return std::nullopt; + } + + auto Query::FindTestRunFinished() const -> std::optional> + { + return testRunFinished; + } + + auto Query::FindTestRunStarted() const -> std::optional> + { + return testRunStarted; + } + + auto Query::FindTestStepBy(const std::shared_ptr& element) const -> std::optional> + { + if (testStepById.find(element->testStepId) != testStepById.end()) + { + return testStepById.at(element->testStepId); + } + return std::nullopt; + } + + auto Query::FindTestStepBy(const std::shared_ptr& element) const -> std::optional> + { + if (testStepById.find(element->testStepId) != testStepById.end()) + { + return testStepById.at(element->testStepId); + } + return std::nullopt; + } + + auto Query::FindTestStepsStartedBy(const std::shared_ptr& testCaseStarted) const -> std::vector> + { + if (testStepStartedByTestCaseStartedId.find(testCaseStarted->id) != testStepStartedByTestCaseStartedId.end()) + { + return testStepStartedByTestCaseStartedId.at(testCaseStarted->id); + } + return {}; + } + + auto Query::FindTestStepsStartedBy(const std::shared_ptr& testCaseFinished) const -> std::vector> + { + if (testStepStartedByTestCaseStartedId.find(testCaseFinished->testCaseStartedId) != testStepStartedByTestCaseStartedId.end()) + { + return testStepStartedByTestCaseStartedId.at(testCaseFinished->testCaseStartedId); + } + return {}; + } + + auto Query::FindTestStepsFinishedBy(const std::shared_ptr& element) const -> std::vector> + { + if (testStepFinishedByTestCaseStartedId.find(element->id) != testStepFinishedByTestCaseStartedId.end()) + { + return testStepFinishedByTestCaseStartedId.at(element->id); + } + + return {}; + } + + auto Query::FindTestStepsFinishedBy(const std::shared_ptr& element) const -> std::vector> + { + const auto& testCaseStarted = FindTestCaseStartedBy(element); + + if (testCaseStarted.has_value()) + { + return FindTestStepsFinishedBy(testCaseStarted.value()); + } + + return {}; + } + + auto Query::FindTestStepFinishedAndTestStepBy(const std::shared_ptr& testCaseStarted) const -> std::vector + { + std::vector result; + const auto testStepsFinishedIter = testStepFinishedByTestCaseStartedId.find(testCaseStarted->id); + + if (testStepsFinishedIter != testStepFinishedByTestCaseStartedId.end()) + { + for (const auto& testStepFinished : testStepsFinishedIter->second) + { + const auto& testStep = FindTestStepBy(testStepFinished); + if (testStep.has_value()) + { + result.emplace_back(TestStepFinishedAndTestStep{ testStepFinished, *testStep }); + } + } + } + + return result; + } + + auto Query::FindLineageBy(const std::shared_ptr& element) const -> std::optional + { + if (lineageById.find(element->astNodeIds.back()) != lineageById.end()) + { + return LineageAndPickle{ lineageById.at(element->astNodeIds.back()), element }; + } + + return std::nullopt; + } + + auto Query::FindLineageBy(const std::shared_ptr& element) const -> std::optional + { + const auto& pickle = FindPickleBy(element); + + if (pickle.has_value()) + { + return FindLineageBy(pickle.value()); + } + + return std::nullopt; + } + + auto Query::FindLineageBy(const std::shared_ptr& element) const -> std::optional + { + const auto& pickle = FindPickleBy(element); + + if (pickle.has_value()) + { + return FindLineageBy(pickle.value()); + } + + return std::nullopt; + } + + auto Query::UpdateGherkinDocument(const std::shared_ptr& gherkinDocument) -> void + { + if (gherkinDocument->feature.has_value()) + { + UpdateFeature(gherkinDocument->feature.value(), std::make_shared(Lineage{ gherkinDocument })); + } + } + + auto Query::UpdateFeature(const std::shared_ptr& feature, const std::shared_ptr& lineage) -> void + { + for (const auto& featureChild : feature->children) + { + if (featureChild->background.has_value()) + { + lineage->background = featureChild->background.value(); + UpdateSteps(featureChild->background.value()->steps); + } + + if (featureChild->scenario.has_value()) + { + UpdateScenario(featureChild->scenario.value(), std::make_shared(*lineage + Lineage{ {}, feature })); + } + + if (featureChild->rule.has_value()) + { + UpdateRule(featureChild->rule.value(), std::make_shared(*lineage + Lineage{ {}, feature })); + } + } + } + + auto Query::UpdateRule(const std::shared_ptr& rule, const std::shared_ptr& lineage) -> void + { + for (const auto& ruleChild : rule->children) + { + if (ruleChild->background.has_value()) + { + lineage->ruleBackground = ruleChild->background.value(); + UpdateSteps(ruleChild->background.value()->steps); + } + + if (ruleChild->scenario.has_value()) + { + UpdateScenario(ruleChild->scenario.value(), std::make_shared(*lineage + Lineage{ {}, {}, {}, rule })); + } + } + } + + auto Query::UpdateScenario(const std::shared_ptr& scenario, const std::shared_ptr& lineage) -> void + { + lineageById[scenario->id] = std::make_shared(*lineage + Lineage{ {}, {}, {}, {}, {}, scenario }); + + std::size_t examplesIndex = 0; + for (const auto& examples : scenario->examples) + { + lineageById[examples->id] = std::make_shared(*lineage + Lineage{ {}, {}, {}, {}, {}, scenario, examples, examplesIndex }); + + std::size_t exampleIndex = 0; + for (const auto& example : examples->tableBody) + { + lineageById[example->id] = std::make_shared(*lineage + Lineage{ {}, {}, {}, {}, {}, scenario, examples, examplesIndex, example, exampleIndex }); + ++exampleIndex; + } + ++examplesIndex; + } + + UpdateSteps(scenario->steps); + } + + auto Query::UpdateSteps(const std::vector>& steps) -> void + { + for (const auto& step : steps) + { + stepById[step->id] = step; + } + } + + auto Query::UpdatePickle(std::shared_ptr pickle) -> void + { + auto&& entry = pickleById[pickle->id] = std::move(pickle); + for (const auto& pickleStep : entry->steps) + { + pickleStepById[pickleStep->id] = pickleStep; + } + } + + auto Query::UpdateTestRunHookStarted(const std::shared_ptr& testRunHookStarted) -> void + { + testRunHookStartedById[testRunHookStarted->id] = testRunHookStarted; + } + + auto Query::UpdateTestRunHookFinished(const std::shared_ptr& testRunHookFinished) -> void + { + testRunHookFinishedByTestRunHookStartedId[testRunHookFinished->testRunHookStartedId] = testRunHookFinished; + } + + auto Query::UpdateTestCase(std::shared_ptr testCase) -> void + { + for (const auto& testStep : testCase->testSteps) + { + testStepById[testStep->id] = testStep; + } + testCaseById[testCase->id] = std::move(testCase); + } + + auto Query::UpdateTestCaseStarted(std::shared_ptr testCaseStarted) -> void + { + testCaseStartedById[testCaseStarted->id] = std::move(testCaseStarted); + } + + auto Query::UpdateAttachment(const std::shared_ptr& attachment) -> void + { + if (attachment->testCaseStartedId.has_value()) + { + attachmentsByTestCaseStartedId[attachment->testCaseStartedId.value()].push_back(attachment); + } + if (attachment->testRunHookStartedId.has_value()) + { + attachmentsByTestRunHookStartedId[attachment->testRunHookStartedId.value()].push_back(attachment); + } + } + + auto Query::UpdateTestStepFinished(std::shared_ptr testStepFinished) -> void + { + testStepFinishedByTestCaseStartedId[testStepFinished->testCaseStartedId].push_back(std::move(testStepFinished)); + } + + auto Query::UpdateTestCaseFinished(std::shared_ptr testCaseFinished) -> void + { + testCaseFinishedByTestCaseStartedId[testCaseFinished->testCaseStartedId] = std::move(testCaseFinished); + } +} diff --git a/cpp/test/CMakeLists.txt b/cpp/test/CMakeLists.txt new file mode 100644 index 00000000..de57ecf5 --- /dev/null +++ b/cpp/test/CMakeLists.txt @@ -0,0 +1,30 @@ +add_executable(cucumber_query_lib.test) + +target_sources(cucumber_query_lib.test + PRIVATE + TestQuery.cpp +) + +target_link_libraries(cucumber_query_lib.test + PRIVATE + cucumber::query + GTest::gmock_main +) + +target_compile_definitions(cucumber_query_lib.test + PRIVATE + TESTDATA_SRC="${PROJECT_SOURCE_DIR}/../testdata/src" +) + +include(GoogleTest) +gtest_discover_tests(cucumber_query_lib.test) + +add_custom_target( + check-testdata-coverage + COMMAND ${CMAKE_COMMAND} + -DTEST_BINARY=$ + -DTESTDATA_SRC=${PROJECT_SOURCE_DIR}/../testdata/src + -P ${CMAKE_CURRENT_SOURCE_DIR}/CheckTestdataCoverage.cmake + DEPENDS cucumber_query_lib.test + COMMENT "Checking testdata coverage in C++ tests" +) diff --git a/cpp/test/CheckTestdataCoverage.cmake b/cpp/test/CheckTestdataCoverage.cmake new file mode 100644 index 00000000..ea047599 --- /dev/null +++ b/cpp/test/CheckTestdataCoverage.cmake @@ -0,0 +1,91 @@ +# Verifies that every query type and naming strategy variant in testdata/src +# has a corresponding TEST_P in the C++ acceptance tests. +# +# Required variables (passed via -D): +# TEST_BINARY — path to the built cucumber_query_lib.test binary +# TESTDATA_SRC — path to testdata/src + +execute_process( + COMMAND "${TEST_BINARY}" --gtest_list_tests + OUTPUT_VARIABLE raw_output + RESULT_VARIABLE result_code + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +if(NOT result_code EQUAL 0) + message(FATAL_ERROR "Failed to list tests: ${TEST_BINARY} --gtest_list_tests") +endif() + +string(REPLACE "\r\n" "\n" raw_output "${raw_output}") +string(REPLACE "\n" ";" lines "${raw_output}") + +set(in_query_suite FALSE) +set(in_naming_suite FALSE) +set(cpp_query_names "") +set(cpp_naming_variants "") + +foreach(line IN LISTS lines) + if(line MATCHES "^Acceptance/QueryAcceptanceTest\\.") + set(in_query_suite TRUE) + set(in_naming_suite FALSE) + elseif(line MATCHES "^Acceptance/NamingStrategyAcceptanceTest\\.") + set(in_query_suite FALSE) + set(in_naming_suite TRUE) + elseif(line MATCHES "^[^ ]") + set(in_query_suite FALSE) + set(in_naming_suite FALSE) + elseif(in_query_suite AND line MATCHES "^ [^ ]") + string(REGEX REPLACE "^ ([^ /]+)/.*$" "\\1" test_name "${line}") + list(APPEND cpp_query_names "${test_name}") + elseif(in_naming_suite AND line MATCHES "^ [^ ]") + string(REGEX REPLACE "^ ([^ /]+)/.*$" "\\1" test_name "${line}") + # gtest uses underscores in test names; testdata file variants use hyphens + string(REPLACE "_" "-" variant_name "${test_name}") + list(APPEND cpp_naming_variants "${variant_name}") + endif() +endforeach() + +list(REMOVE_DUPLICATES cpp_query_names) +list(REMOVE_DUPLICATES cpp_naming_variants) + +file(GLOB result_files "${TESTDATA_SRC}/*.results.json") +set(testdata_query_names "") +foreach(f IN LISTS result_files) + get_filename_component(filename "${f}" NAME) + string(REGEX REPLACE "^[^.]+\\.(.+)\\.results\\.json$" "\\1" query_name "${filename}") + list(APPEND testdata_query_names "${query_name}") +endforeach() +list(REMOVE_DUPLICATES testdata_query_names) + +file(GLOB naming_files "${TESTDATA_SRC}/*.naming-strategy.*.txt") +set(testdata_naming_variants "") +foreach(f IN LISTS naming_files) + get_filename_component(filename "${f}" NAME) + string(REGEX REPLACE "^[^.]+\\.naming-strategy\\.(.+)\\.txt$" "\\1" variant "${filename}") + list(APPEND testdata_naming_variants "${variant}") +endforeach() +list(REMOVE_DUPLICATES testdata_naming_variants) + +set(found_gaps FALSE) + +foreach(name IN LISTS testdata_query_names) + list(FIND cpp_query_names "${name}" query_index) + if(query_index EQUAL -1) + message(WARNING "Query type '${name}' exists in testdata but has no TEST_P in QueryAcceptanceTest") + set(found_gaps TRUE) + endif() +endforeach() + +foreach(variant IN LISTS testdata_naming_variants) + list(FIND cpp_naming_variants "${variant}" variant_index) + if(variant_index EQUAL -1) + message(WARNING "Naming strategy variant '${variant}' exists in testdata but has no TEST_P in NamingStrategyAcceptanceTest") + set(found_gaps TRUE) + endif() +endforeach() + +if(found_gaps) + message(FATAL_ERROR "C++ tests are missing coverage for new testdata. Add TEST_P entries to TestQuery.cpp.") +endif() + +message(STATUS "All testdata query types and naming strategy variants are covered.") diff --git a/cpp/test/TestQuery.cpp b/cpp/test/TestQuery.cpp new file mode 100644 index 00000000..b7eb6b5e --- /dev/null +++ b/cpp/test/TestQuery.cpp @@ -0,0 +1,887 @@ +#include "cucumber/messages/All.hpp" +#include "cucumber/messages/TestStepResultStatus.hpp" +#include "cucumber/query/NamingStrategy.hpp" +#include "cucumber/query/Query.hpp" +#include "nlohmann/json.hpp" +#include "nlohmann/json_fwd.hpp" +#include "gmock/gmock.h" +#include "gtest/gtest.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace cucumber::query +{ + namespace + { + auto EndsWith(std::string_view value, std::string_view suffix) -> bool + { + return value.size() >= suffix.size() && value.compare(value.size() - suffix.size(), suffix.size(), suffix) == 0; + } + + template + auto ToJson(const std::optional& value) -> nlohmann::json + { + return value.has_value() ? nlohmann::json(*value) : nlohmann::json(nullptr); + } + + struct Expectation + { + std::string_view infix; + std::string_view suffix; + }; + + struct DataSet + { + std::filesystem::path source; + }; + + // Determines how ctest names the generated tests. + auto PrintTo(const DataSet& dataSet, std::ostream* stream) -> void + { + *stream << dataSet.source.stem().string(); + } + + // Data sets are `.ndjson`, their expectations ``. + auto GetDataSets(const Expectation& expectation) -> std::vector + { + std::vector sources; + std::vector expectations; + + for (const auto& entry : std::filesystem::directory_iterator{ std::filesystem::path{ TESTDATA_SRC } }) + { + auto fileName = entry.path().filename().string(); + + if (entry.path().extension() == ".ndjson") + { + sources.push_back(entry.path()); + } + else if (EndsWith(fileName, expectation.suffix)) + { + expectations.push_back(std::move(fileName)); + } + } + + std::vector dataSets; + + for (auto& source : sources) + { + const auto prefix = source.stem().string() + std::string{ expectation.infix }; + const auto hasExpectations = std::any_of(expectations.begin(), expectations.end(), + [&prefix](const std::string& expectation) -> bool + { + return expectation.compare(0, prefix.size(), prefix) == 0; + }); + + if (hasExpectations) + { + dataSets.push_back(DataSet{ std::move(source) }); + } + } + + std::sort(dataSets.begin(), dataSets.end(), + [](const DataSet& lhs, const DataSet& rhs) -> bool + { + return lhs.source < rhs.source; + }); + + return dataSets; + } + + auto ExpectedPath(const std::filesystem::path& dataSet, const std::string& suffix) -> std::filesystem::path + { + return dataSet.parent_path() / (dataSet.stem().string() + suffix); + } + + auto DataSetName(const testing::TestParamInfo& info) -> std::string + { + auto name = info.param.source.stem().string(); + + std::replace_if( + name.begin(), name.end(), + [](unsigned char character) -> bool + { + return std::isalnum(character) == 0; + }, + '_'); + + return name; + } + + auto LoadQuery(const std::filesystem::path& source) -> Query + { + Query query; + + std::ifstream ifstream{ source }; + std::string line; + while (std::getline(ifstream, line)) + { + messages::Envelope envelope; + envelope.from_json(nlohmann::json::parse(line)); + + query.Update(envelope); + } + + return query; + } + + auto ReversePickleComparator(const std::shared_ptr& lhs, const std::shared_ptr& rhs) -> std::int32_t + { + if (lhs->uri != rhs->uri) + { + return static_cast(lhs->uri.compare(rhs->uri)); + } + if (!lhs->location.has_value() || !rhs->location.has_value()) + { + return 0; + } + if (lhs->location.value()->line != rhs->location.value()->line) + { + return static_cast(rhs->location.value()->line) - static_cast(lhs->location.value()->line); + } + return static_cast(rhs->location.value()->column.value_or(0)) - static_cast(lhs->location.value()->column.value_or(0)); + } + + struct QueryAcceptanceTest : testing::TestWithParam + { + protected: + auto SetUp() -> void override + { + query = LoadQuery(GetParam().source); + } + + static auto Verify(std::string_view queryName, const nlohmann::json& actual) -> void + { + const auto expected = ExpectedPath(GetParam().source, "." + std::string{ queryName } + ".results.json"); + + if (!std::filesystem::exists(expected)) + { + GTEST_SKIP() << "No expected results at " << expected; + } + + std::ifstream ifstream{ expected }; + EXPECT_THAT(actual, testing::Eq(nlohmann::json::parse(ifstream))); + } + + Query query; + }; + + INSTANTIATE_TEST_SUITE_P(Acceptance, QueryAcceptanceTest, testing::ValuesIn(GetDataSets({ ".", ".results.json" })), DataSetName); + + TEST_P(QueryAcceptanceTest, findAllPickles) + { + Verify("findAllPickles", query.FindAllPickles().size()); + } + + TEST_P(QueryAcceptanceTest, findAllPickleSteps) + { + Verify("findAllPickleSteps", query.FindAllPickleSteps().size()); + } + + TEST_P(QueryAcceptanceTest, findAllStepDefinitions) + { + Verify("findAllStepDefinitions", query.FindAllStepDefinitions().size()); + } + + TEST_P(QueryAcceptanceTest, findAllTestCaseFinished) + { + Verify("findAllTestCaseFinished", query.FindAllTestCaseFinished().size()); + } + + TEST_P(QueryAcceptanceTest, findAllTestCases) + { + Verify("findAllTestCases", query.FindAllTestCases().size()); + } + + TEST_P(QueryAcceptanceTest, findAllTestCaseStarted) + { + Verify("findAllTestCaseStarted", query.FindAllTestCaseStarted().size()); + } + + TEST_P(QueryAcceptanceTest, findAllTestRunHookFinished) + { + Verify("findAllTestRunHookFinished", query.FindAllTestRunHookFinished().size()); + } + + TEST_P(QueryAcceptanceTest, findAllTestRunHookStarted) + { + Verify("findAllTestRunHookStarted", query.FindAllTestRunHookStarted().size()); + } + + TEST_P(QueryAcceptanceTest, findAllTestStepFinished) + { + Verify("findAllTestStepFinished", query.FindAllTestStepFinished().size()); + } + + TEST_P(QueryAcceptanceTest, findAllTestSteps) + { + Verify("findAllTestSteps", query.FindAllTestSteps().size()); + } + + TEST_P(QueryAcceptanceTest, findAllTestStepStarted) + { + Verify("findAllTestStepStarted", query.FindAllTestStepStarted().size()); + } + + TEST_P(QueryAcceptanceTest, countMostSevereTestStepResultStatus) + { + nlohmann::json actual; + + for (const auto& [status, count] : query.CountMostSevereTestStepResultStatus()) + { + actual[to_string(status)] = count; + } + + Verify("countMostSevereTestStepResultStatus", actual); + } + + TEST_P(QueryAcceptanceTest, countTestCasesStarted) + { + Verify("countTestCasesStarted", query.CountTestCasesStarted()); + } + + TEST_P(QueryAcceptanceTest, findAllTestCaseFinishedOrderBy) + { + const auto allResults = query.FindAllTestCaseFinishedOrderBy( + [](const query::Query& query, const auto& element) + { + return query.FindPickleBy(element); + }, + ReversePickleComparator); + + nlohmann::json actual; + for (const auto& testCaseFinished : allResults) + { + actual.push_back(testCaseFinished->testCaseStartedId); + } + + Verify("findAllTestCaseFinishedOrderBy", actual); + } + + TEST_P(QueryAcceptanceTest, findAllTestCaseStartedOrderBy) + { + const auto allResults = query.FindAllTestCaseStartedOrderBy( + [](const query::Query& query, const auto& element) + { + return query.FindPickleBy(element); + }, + ReversePickleComparator); + + nlohmann::json actual; + for (const auto& testCaseStarted : allResults) + { + actual.push_back(testCaseStarted->id); + } + + Verify("findAllTestCaseStartedOrderBy", actual); + } + + TEST_P(QueryAcceptanceTest, findAllUndefinedParameterTypes) + { + nlohmann::json actual = nlohmann::json::array(); + + for (const auto& undefinedParameterType : query.FindAllUndefinedParameterTypes()) + { + actual.push_back({ undefinedParameterType->name, undefinedParameterType->expression }); + } + + Verify("findAllUndefinedParameterTypes", actual); + } + + TEST_P(QueryAcceptanceTest, findAttachmentsBy) + { + nlohmann::json actual = { { "testStepFinished", nlohmann::json::array() }, { "testRunHookFinished", nlohmann::json::array() } }; + + const auto& allTestCaseStarted = query.FindAllTestCaseStarted(); + for (const auto& testCaseStarted : allTestCaseStarted) + { + const auto& allFinishedSteps = query.FindTestStepsFinishedBy(testCaseStarted); + for (const auto& testStepFinished : allFinishedSteps) + { + const auto& attachments = query.FindAttachmentsBy(testStepFinished); + + for (const auto& attachment : attachments) + { + actual["testStepFinished"].push_back({ ToJson(attachment->testStepId), ToJson(attachment->testCaseStartedId), attachment->mediaType, attachment->contentEncoding }); + } + } + } + + const auto& allTestRunHookFinished = query.FindAllTestRunHookFinished(); + for (const auto& testRunHookFinished : allTestRunHookFinished) + { + const auto& attachments = query.FindAttachmentsBy(testRunHookFinished); + + for (const auto& attachment : attachments) + { + actual["testRunHookFinished"].push_back({ ToJson(attachment->testRunHookStartedId), attachment->mediaType, attachment->contentEncoding }); + } + } + + Verify("findAttachmentsBy", actual); + } + + TEST_P(QueryAcceptanceTest, findHookBy) + { + const auto findHookBy = [this](const auto& testSteps) + { + nlohmann::json actual = nlohmann::json::array(); + + for (const auto& testStep : testSteps) + { + const auto& hook = query.FindHookBy(testStep); + if (hook.has_value()) + { + actual.push_back(hook.value()->id); + } + } + + return actual; + }; + + nlohmann::json actual; + + actual["testStep"] = findHookBy(query.FindAllTestSteps()); + actual["testRunHookStarted"] = findHookBy(query.FindAllTestRunHookStarted()); + actual["testRunHookFinished"] = findHookBy(query.FindAllTestRunHookFinished()); + + Verify("findHookBy", actual); + } + + TEST_P(QueryAcceptanceTest, findLineageBy) + { + const auto namingStrategy = CreateNamingStrategy(NamingStrategyLength::longName, NamingStrategyFeatureName::include, NamingStrategyExampleName::number); + + const auto findLineageBy = [this, &namingStrategy](const auto& items) + { + nlohmann::json actual = nlohmann::json::array(); + + for (const auto& item : items) + { + const auto& lineageAndPickle = query.FindLineageBy(item); + if (lineageAndPickle.has_value()) + { + const auto& [lineage, pickle] = lineageAndPickle.value(); + actual.push_back(namingStrategy->Reduce(*lineage, *pickle)); + } + } + + return actual; + }; + + nlohmann::json actual; + + actual["testCaseStarted"] = findLineageBy(query.FindAllTestCaseStarted()); + actual["testCaseFinished"] = findLineageBy(query.FindAllTestCaseFinished()); + actual["pickle"] = findLineageBy(query.FindAllPickles()); + + Verify("findLineageBy", actual); + } + + TEST_P(QueryAcceptanceTest, findLocationOf) + { + nlohmann::json actual = nlohmann::json::array(); + + for (const auto& pickle : query.FindAllPickles()) + { + const auto location = query.FindLocationOf(pickle); + if (location.has_value()) + { + actual.push_back({ { "line", location.value()->line }, { "column", ToJson(location.value()->column) } }); + } + } + + Verify("findLocationOf", actual); + } + + TEST_P(QueryAcceptanceTest, findMeta) + { + const auto meta = query.FindMeta(); + + nlohmann::json actual; + if (meta.has_value()) + { + actual = meta.value()->implementation->name; + } + + Verify("findMeta", actual); + } + + TEST_P(QueryAcceptanceTest, findMostSevereTestStepResultBy) + { + const auto findMostSevereTestStepResultBy = [this](const auto& items) + { + nlohmann::json actual = nlohmann::json::array(); + + for (const auto& item : items) + { + const auto mostSevereTestStepResult = query.FindMostSevereTestStepResultBy(item); + if (mostSevereTestStepResult.has_value()) + { + actual.emplace_back(to_string(mostSevereTestStepResult.value()->status)); + } + } + + return actual; + }; + + nlohmann::json actual; + + actual["testCaseStarted"] = findMostSevereTestStepResultBy(query.FindAllTestCaseStarted()); + actual["testCaseFinished"] = findMostSevereTestStepResultBy(query.FindAllTestCaseFinished()); + + Verify("findMostSevereTestStepResultBy", actual); + } + + TEST_P(QueryAcceptanceTest, findPickleBy) + { + const auto findPickleBy = [this](const auto& items) + { + nlohmann::json actual = nlohmann::json::array(); + + for (const auto& item : items) + { + const auto pickle = query.FindPickleBy(item); + if (pickle.has_value()) + { + actual.push_back(pickle.value()->name); + } + } + + return actual; + }; + + nlohmann::json actual; + + actual["testCaseStarted"] = findPickleBy(query.FindAllTestCaseStarted()); + actual["testCaseFinished"] = findPickleBy(query.FindAllTestCaseFinished()); + actual["testStepStarted"] = findPickleBy(query.FindAllTestStepStarted()); + actual["testStepFinished"] = findPickleBy(query.FindAllTestStepFinished()); + + Verify("findPickleBy", actual); + } + + TEST_P(QueryAcceptanceTest, findPickleStepBy) + { + nlohmann::json actual = nlohmann::json::array(); + + for (const auto& testStep : query.FindAllTestSteps()) + { + const auto pickleStep = query.FindPickleStepBy(testStep); + if (pickleStep.has_value()) + { + actual.emplace_back(pickleStep.value()->text); + } + } + + Verify("findPickleStepBy", actual); + } + + TEST_P(QueryAcceptanceTest, findStepBy) + { + nlohmann::json actual = nlohmann::json::array(); + + for (const auto& pickleStep : query.FindAllPickleSteps()) + { + const auto step = query.FindStepBy(pickleStep); + if (step.has_value()) + { + actual.emplace_back(step.value()->text); + } + } + + Verify("findStepBy", actual); + } + + TEST_P(QueryAcceptanceTest, findStepDefinitionsBy) + { + nlohmann::json actual = nlohmann::json::array(); + + for (const auto& testStep : query.FindAllTestSteps()) + { + auto& actualIds = actual.emplace_back(nlohmann::json::array()); + + for (const auto& stepDefinition : query.FindStepDefinitionsBy(testStep)) + { + actualIds.emplace_back(stepDefinition->id); + } + } + + Verify("findStepDefinitionsBy", actual); + } + + TEST_P(QueryAcceptanceTest, findSuggestionsBy) + { + const auto findSuggestionsBy = [this](const auto& items) + { + nlohmann::json actual = nlohmann::json::array(); + + for (const auto& item : items) + { + for (const auto& suggestion : query.FindSuggestionsBy(item)) + { + actual.emplace_back(suggestion->id); + } + } + + return actual; + }; + + nlohmann::json actual; + + actual["pickleStep"] = findSuggestionsBy(query.FindAllPickleSteps()); + actual["pickle"] = findSuggestionsBy(query.FindAllPickles()); + + Verify("findSuggestionsBy", actual); + } + + TEST_P(QueryAcceptanceTest, findTestCaseBy) + { + const auto findTestCaseBy = [this](const auto& items) + { + nlohmann::json actual = nlohmann::json::array(); + + for (const auto& item : items) + { + const auto& testCase = query.FindTestCaseBy(item); + if (testCase.has_value()) + { + actual.push_back(testCase.value()->id); + } + } + return actual; + }; + + nlohmann::json actual; + + actual["testCaseStarted"] = findTestCaseBy(query.FindAllTestCaseStarted()); + actual["testCaseFinished"] = findTestCaseBy(query.FindAllTestCaseFinished()); + actual["testStepStarted"] = findTestCaseBy(query.FindAllTestStepStarted()); + actual["testStepFinished"] = findTestCaseBy(query.FindAllTestStepFinished()); + + Verify("findTestCaseBy", actual); + } + + TEST_P(QueryAcceptanceTest, findTestCaseDurationBy) + { + const auto findTestCaseDurationBy = [this](const auto& items) + { + nlohmann::json actual = nlohmann::json::array(); + + for (const auto& item : items) + { + const auto& testCase = query.FindTestCaseDurationBy(item); + if (testCase.has_value()) + { + testCase.value()->to_json(actual.emplace_back()); + } + } + return actual; + }; + + nlohmann::json actual; + + actual["testCaseStarted"] = findTestCaseDurationBy(query.FindAllTestCaseStarted()); + actual["testCaseFinished"] = findTestCaseDurationBy(query.FindAllTestCaseFinished()); + + Verify("findTestCaseDurationBy", actual); + } + + TEST_P(QueryAcceptanceTest, findTestCaseFinishedBy) + { + nlohmann::json actual = nlohmann::json::array(); + + for (const auto& testCaseStarted : query.FindAllTestCaseStarted()) + { + const auto& testCaseFinished = query.FindTestCaseFinishedBy(testCaseStarted); + if (testCaseFinished.has_value()) + { + actual.push_back(testCaseFinished.value()->testCaseStartedId); + } + } + + Verify("findTestCaseFinishedBy", actual); + } + + TEST_P(QueryAcceptanceTest, findTestCaseStartedBy) + { + const auto findTestCaseStartedBy = [this](const auto& items) + { + nlohmann::json actual = nlohmann::json::array(); + for (const auto& testCaseFinished : items) + { + const auto& testCaseStarted = query.FindTestCaseStartedBy(testCaseFinished); + if (testCaseStarted.has_value()) + { + actual.push_back(testCaseStarted.value()->id); + } + } + + return actual; + }; + + nlohmann::json actual; + + actual["testCaseFinished"] = findTestCaseStartedBy(query.FindAllTestCaseFinished()); + actual["testStepStarted"] = findTestCaseStartedBy(query.FindAllTestStepStarted()); + actual["testStepFinished"] = findTestCaseStartedBy(query.FindAllTestStepFinished()); + + Verify("findTestCaseStartedBy", actual); + } + + TEST_P(QueryAcceptanceTest, findTestRunDuration) + { + nlohmann::json actual; + + const auto testRunDuration = query.FindTestRunDuration(); + if (testRunDuration.has_value()) + { + testRunDuration.value()->to_json(actual); + } + + Verify("findTestRunDuration", actual); + } + + TEST_P(QueryAcceptanceTest, findTestRunFinished) + { + nlohmann::json actual; + + const auto testRunFinished = query.FindTestRunFinished(); + if (testRunFinished.has_value()) + { + testRunFinished.value()->to_json(actual); + } + + Verify("findTestRunFinished", actual); + } + + TEST_P(QueryAcceptanceTest, findTestRunHookFinishedBy) + { + nlohmann::json actual = nlohmann::json::array(); + + for (const auto& testRunHookStarted : query.FindAllTestRunHookStarted()) + { + const auto& testRunHookFinished = query.FindTestRunHookFinishedBy(testRunHookStarted); + if (testRunHookFinished.has_value()) + { + actual.emplace_back(testRunHookFinished.value()->testRunHookStartedId); + } + } + + Verify("findTestRunHookFinishedBy", actual); + } + + TEST_P(QueryAcceptanceTest, findTestRunHookStartedBy) + { + nlohmann::json actual = nlohmann::json::array(); + + for (const auto& testRunHookFinished : query.FindAllTestRunHookFinished()) + { + const auto& testRunHookStarted = query.FindTestRunHookStartedBy(testRunHookFinished); + if (testRunHookStarted.has_value()) + { + actual.emplace_back(testRunHookStarted.value()->id); + } + } + + Verify("findTestRunHookStartedBy", actual); + } + + TEST_P(QueryAcceptanceTest, findTestRunStarted) + { + nlohmann::json actual; + + const auto testRunStarted = query.FindTestRunStarted(); + if (testRunStarted.has_value()) + { + testRunStarted.value()->to_json(actual); + } + + Verify("findTestRunStarted", actual); + } + + TEST_P(QueryAcceptanceTest, findTestStepBy) + { + nlohmann::json actual{ + { "testStepStarted", nlohmann::json::array() }, + { "testStepFinished", nlohmann::json::array() }, + }; + + const auto findTestStepBy = [&](const auto& testSteps, const char* key) + { + for (const auto& testStepEvent : testSteps) + { + const auto& testStep = query.FindTestStepBy(testStepEvent); + if (testStep.has_value()) + { + actual[key].emplace_back(testStep.value()->id); + } + } + }; + + for (const auto& item : query.FindAllTestCaseStarted()) + { + findTestStepBy(query.FindTestStepsStartedBy(item), "testStepStarted"); + findTestStepBy(query.FindTestStepsFinishedBy(item), "testStepFinished"); + } + + Verify("findTestStepBy", actual); + } + + TEST_P(QueryAcceptanceTest, findTestStepFinishedAndTestStepBy) + { + nlohmann::json actual = nlohmann::json::array(); + + for (const auto& testCaseStarted : query.FindAllTestCaseStarted()) + { + for (const auto& [testStepFinished, testStep] : query.FindTestStepFinishedAndTestStepBy(testCaseStarted)) + { + actual.push_back({ testStepFinished->testStepId, testStep->id }); + } + } + + Verify("findTestStepFinishedAndTestStepBy", actual); + } + + TEST_P(QueryAcceptanceTest, findTestStepsFinishedBy) + { + const auto findTestStepsFinishedBy = [&](const auto& items) + { + auto actual = nlohmann::json::array(); + + for (const auto& item : items) + { + auto& nested = actual.emplace_back(nlohmann::json::array()); + const auto& testStepsFinished = query.FindTestStepsFinishedBy(item); + + for (const auto& testStepFinished : testStepsFinished) + { + nested.push_back(testStepFinished->testStepId); + } + } + + return actual; + }; + + nlohmann::json actual; + + actual["testCaseStarted"] = findTestStepsFinishedBy(query.FindAllTestCaseStarted()); + actual["testCaseFinished"] = findTestStepsFinishedBy(query.FindAllTestCaseFinished()); + + Verify("findTestStepsFinishedBy", actual); + } + + TEST_P(QueryAcceptanceTest, findTestStepsStartedBy) + { + const auto findTestStepsStartedBy = [&](const auto& items) + { + auto actual = nlohmann::json::array(); + + for (const auto& item : items) + { + auto& nested = actual.emplace_back(nlohmann::json::array()); + const auto& testStepsFinished = query.FindTestStepsStartedBy(item); + + for (const auto& testStepFinished : testStepsFinished) + { + nested.push_back(testStepFinished->testStepId); + } + } + + return actual; + }; + + nlohmann::json actual; + + actual["testCaseStarted"] = findTestStepsStartedBy(query.FindAllTestCaseStarted()); + actual["testCaseFinished"] = findTestStepsStartedBy(query.FindAllTestCaseFinished()); + + Verify("findTestStepsStartedBy", actual); + } + + TEST_P(QueryAcceptanceTest, findUnambiguousStepDefinitionBy) + { + nlohmann::json actual = nlohmann::json::array(); + + for (const auto& testStep : query.FindAllTestSteps()) + { + const auto& stepDefinition = query.FindUnambiguousStepDefinitionBy(testStep); + if (stepDefinition.has_value()) + { + actual.push_back(stepDefinition.value()->id); + } + } + + Verify("findUnambiguousStepDefinitionBy", actual); + } + + struct NamingStrategyAcceptanceTest : testing::TestWithParam + { + protected: + auto SetUp() -> void override + { + query = LoadQuery(GetParam().source); + } + + auto Verify(std::string_view variant, const NamingStrategy& strategy) const -> void + { + std::string actual; + + for (const auto& pickle : query.FindAllPickles()) + { + const auto lineageAndPickle = query.FindLineageBy(pickle); + if (lineageAndPickle.has_value()) + { + actual += strategy.Reduce(*lineageAndPickle.value().lineage, *lineageAndPickle.value().pickle) + "\n"; + } + } + + const auto expected = ExpectedPath(GetParam().source, ".naming-strategy." + std::string{ variant } + ".txt"); + + std::ifstream ifstream{ expected, std::ios::binary }; + EXPECT_EQ(actual, std::string(std::istreambuf_iterator{ ifstream }, std::istreambuf_iterator{})); + } + + Query query; + }; + + INSTANTIATE_TEST_SUITE_P(Acceptance, NamingStrategyAcceptanceTest, testing::ValuesIn(GetDataSets({ ".naming-strategy.", ".txt" })), DataSetName); + + TEST_P(NamingStrategyAcceptanceTest, long) + { + Verify("long", *CreateNamingStrategy(NamingStrategyLength::longName)); + } + + TEST_P(NamingStrategyAcceptanceTest, long_exclude_feature_name) + { + Verify("long-exclude-feature-name", *CreateNamingStrategy(NamingStrategyLength::longName, NamingStrategyFeatureName::exclude)); + } + + TEST_P(NamingStrategyAcceptanceTest, long_with_pickle_name) + { + Verify("long-with-pickle-name", *CreateNamingStrategy(NamingStrategyLength::longName, NamingStrategyFeatureName::include, NamingStrategyExampleName::pickle)); + } + + TEST_P(NamingStrategyAcceptanceTest, long_with_pickle_name_if_parameterized) + { + Verify("long-with-pickle-name-if-parameterized", + *CreateNamingStrategy(NamingStrategyLength::longName, NamingStrategyFeatureName::include, NamingStrategyExampleName::numberAndPickleIfParameterized)); + } + + TEST_P(NamingStrategyAcceptanceTest, short) + { + Verify("short", *CreateNamingStrategy(NamingStrategyLength::shortName)); + } + } +} diff --git a/testdata/.gitattributes b/testdata/.gitattributes new file mode 100644 index 00000000..ddddd013 --- /dev/null +++ b/testdata/.gitattributes @@ -0,0 +1,3 @@ +*.ndjson text eol=lf +*.json text eol=lf +*.txt text eol=lf diff --git a/testdata/src/attachments.findAttachmentsByTestRunHookFinished.results.json b/testdata/src/attachments.findAttachmentsByTestRunHookFinished.results.json deleted file mode 100644 index 8878e547..00000000 --- a/testdata/src/attachments.findAttachmentsByTestRunHookFinished.results.json +++ /dev/null @@ -1 +0,0 @@ -[ ] \ No newline at end of file diff --git a/testdata/src/empty.findAttachmentsByTestRunHookFinished.results.json b/testdata/src/empty.findAttachmentsByTestRunHookFinished.results.json deleted file mode 100644 index 8878e547..00000000 --- a/testdata/src/empty.findAttachmentsByTestRunHookFinished.results.json +++ /dev/null @@ -1 +0,0 @@ -[ ] \ No newline at end of file diff --git a/testdata/src/examples-tables.findAttachmentsByTestRunHookFinished.results.json b/testdata/src/examples-tables.findAttachmentsByTestRunHookFinished.results.json deleted file mode 100644 index 8878e547..00000000 --- a/testdata/src/examples-tables.findAttachmentsByTestRunHookFinished.results.json +++ /dev/null @@ -1 +0,0 @@ -[ ] \ No newline at end of file diff --git a/testdata/src/global-hooks-attachments.findAttachmentsByTestRunHookFinished.results.json b/testdata/src/global-hooks-attachments.findAttachmentsByTestRunHookFinished.results.json deleted file mode 100644 index 7508f5ef..00000000 --- a/testdata/src/global-hooks-attachments.findAttachmentsByTestRunHookFinished.results.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - [ - "8", - "text/plain", - "IDENTITY" - ], - [ - "12", - "text/plain", - "IDENTITY" - ] -] \ No newline at end of file diff --git a/testdata/src/global-hooks.findAttachmentsByTestRunHookFinished.results.json b/testdata/src/global-hooks.findAttachmentsByTestRunHookFinished.results.json deleted file mode 100644 index 8878e547..00000000 --- a/testdata/src/global-hooks.findAttachmentsByTestRunHookFinished.results.json +++ /dev/null @@ -1 +0,0 @@ -[ ] \ No newline at end of file diff --git a/testdata/src/hooks.findAttachmentsByTestRunHookFinished.results.json b/testdata/src/hooks.findAttachmentsByTestRunHookFinished.results.json deleted file mode 100644 index 8878e547..00000000 --- a/testdata/src/hooks.findAttachmentsByTestRunHookFinished.results.json +++ /dev/null @@ -1 +0,0 @@ -[ ] \ No newline at end of file diff --git a/testdata/src/minimal.findAttachmentsByTestRunHookFinished.results.json b/testdata/src/minimal.findAttachmentsByTestRunHookFinished.results.json deleted file mode 100644 index 8878e547..00000000 --- a/testdata/src/minimal.findAttachmentsByTestRunHookFinished.results.json +++ /dev/null @@ -1 +0,0 @@ -[ ] \ No newline at end of file diff --git a/testdata/src/rules.findAttachmentsByTestRunHookFinished.results.json b/testdata/src/rules.findAttachmentsByTestRunHookFinished.results.json deleted file mode 100644 index 8878e547..00000000 --- a/testdata/src/rules.findAttachmentsByTestRunHookFinished.results.json +++ /dev/null @@ -1 +0,0 @@ -[ ] \ No newline at end of file