mirror of
https://github.com/zap-proto/cs.git
synced 2026-10-30 15:05:32 +00:00
Finishes the in-flight capnp→ZAP rebrand on this branch. The prior commits
renamed identifiers/namespaces/files/projects (Capnp.Net.Runtime→Zap.Net.Runtime,
CapnpC→ZapC, .capnp→.zap) but left the human-readable brand name "Cap'n Proto"
throughout doc-comments, .csproj/.nuspec descriptions, README, MSBuild .xaml
rule display names, and the generated XML doc. This completes brand neutrality:
- Replace 154 "Cap'n Proto" / 4 "Cap'n-Proto" / 1 "Cap'n'p" prose occurrences
with "ZAP" across 32 first-party files (runtime, generator, zapc-csharp,
MSBuild integration, chocolatey nuspecs, README, docs, XML doc).
- Revert the LICENSE provenance URL to the real upstream fork
(c80k/capnproto-dotnetcore) — upstream-fork license headers must stay.
- Canonicalize project/repo URLs to github.com/zap-proto/cs (were fabricated
c80k/zap-dotnetcore) in csproj/nuspec/VERIFICATION/README badges.
- Canonicalize docs URLs zap-protocol(.github.io|/zap-cs|/zap-cpp-core)
→ zap-proto.dev / github.com/zap-proto/{cs,cpp-core}.
- Collapse redundant "zap \"ZAP\"" PackageTags to "zap".
Verified consistent (no toolchain on host): every .sln/.csproj ProjectReference
resolves; all namespaces are Zap*/ZapC*; MSBuild task chain
(GenerateZapFileCodeBehindTask, ZapFiles ItemGroup, _ZapcCsharp_TaskAssembly)
is uniformly renamed; props/targets/xaml/coverage/chocolatey carry no capnp.
Deliberately preserved as upstream-derived test data (not first-party source):
upstream Cap'n Proto schema fixtures (rpc.zap, rpc-twoparty.zap, json.zap,
rpc-csharp.zap), golden compiler-error outputs (errors.txt), and the
machine-generated DO-NOT-EDIT test.zap.{c++,h}. Their "Cap'n Proto" strings are
the literal output of the external schema compiler the compat test matches.
83 lines
3.3 KiB
Gherkin
83 lines
3.3 KiB
Gherkin
@Coverage
|
|
Feature: CodeGenerator
|
|
In order to ensure that the generator backend produces valid output
|
|
As a contributor
|
|
I want to get notified when there is any deviation from reference output
|
|
|
|
@Coverage
|
|
Scenario: Comparing backend output with reference
|
|
Given I have a binary code generator request "test.zap.bin"
|
|
And my reference output is "test.cs"
|
|
When I invoke zapc-csharp
|
|
Then the generated output must match the reference
|
|
|
|
@Coverage
|
|
Scenario Outline: Invalid binary code generator requests
|
|
Given I have a binary code generator request <bin>
|
|
When I invoke zapc-csharp
|
|
Then the invocation must fail
|
|
|
|
Examples:
|
|
| bin |
|
|
| null.bin |
|
|
| test.cs |
|
|
|
|
@Coverage
|
|
Scenario: Combining frontend and backend
|
|
Given zap.exe is installed on my system
|
|
And I have a schema "UnitTest1.zap"
|
|
When I try to generate code from that schema
|
|
Then code generation must succeed
|
|
|
|
@Coverage
|
|
Scenario: Missing frontend
|
|
Given zap.exe is not installed on my system
|
|
And I have a schema "UnitTest1.zap"
|
|
When I try to generate code from that schema
|
|
Then the invocation must fail
|
|
|
|
@Coverage
|
|
Scenario: Schema without ID
|
|
Given zap.exe is installed on my system
|
|
And I have a schema "Empty1.zap"
|
|
When I try to generate code from that schema
|
|
Then the invocation must fail
|
|
And the reason must be bad input
|
|
And the error output must contain "File does not declare an ID"
|
|
|
|
@Coverage
|
|
Scenario: Multiple errors
|
|
Given zap.exe is installed on my system
|
|
And I have a schema "invalid.zap"
|
|
When I try to generate code from that schema
|
|
Then the invocation must fail
|
|
And the reason must be bad input
|
|
And the error output must contain multiple messages
|
|
|
|
@Coverage
|
|
Scenario Outline: Valid generator output
|
|
Given I have a binary code generator request <bin>
|
|
And I enable generation of nullable reference types according to <nullablegen>
|
|
And I enable the compiler support of nullable reference types according to <nullablesupp>
|
|
When I invoke zapc-csharp
|
|
Then the invocation must succeed and attempting to compile the generated code gives <outcome>
|
|
|
|
Examples:
|
|
| bin | nullablegen | nullablesupp | outcome |
|
|
| test.zap.bin | false | false | success |
|
|
| test.zap.bin | true | false | errors |
|
|
| test.zap.bin | false | true | warnings |
|
|
| test.zap.bin | true | true | success |
|
|
| Issue19.zap.bin | false | false | success |
|
|
| Issue21.zap.bin | false | false | success |
|
|
| Issue22.zap.bin | false | false | success |
|
|
| NullableDisable.zap.bin | true | false | success |
|
|
| NullableDisable.zap.bin | true | true | warnings |
|
|
| NullableEnable.zap.bin | false | true | success |
|
|
| NullableEnable.zap.bin | false | false | errors |
|
|
| NullableDisable2.zap.bin | false | false | errors |
|
|
| NullableDisable2.zap.bin | false | true | success |
|
|
| NullableEnable2.zap.bin | false | false | errors |
|
|
| NullableEnable2.zap.bin | false | true | success |
|
|
| rpc-csharp.zap.bin | true | true | warnings |
|
|
| schema-csharp.zap.bin | false | false | success | |