Skip to main content

Module codegen

Module codegen 

Source
Expand description

E2e test code generation trait and language dispatch.

§DRY layer (client)

Per-language e2e codegen historically duplicated the structural shape of every test (function header, request build, response assert) and only differed in syntax. The client submodule pulls that shape into trait + driver pairs (client::TestClientRenderer + client::http_call::render_http_test) so each language can be migrated to TestClient-driven tests by:

  1. Implementing TestClientRenderer once per language (small, mechanical).
  2. Replacing the language’s monolithic render_http_test_function with a call to client::http_call::render_http_test(out, &MyRenderer, fixture).
  3. Optionally splitting the per-language file into a directory <lang>/{mod.rs,client.rs,ws.rs,helpers.rs} when the file gets unwieldy.

Until a language migrates, it continues using the legacy monolithic renderer — both can coexist behind the per-language E2eCodegen::generate entry.

Modules§

brew
Brew (Homebrew CLI) e2e test generator.
c
C e2e test generator using assert.h and a Makefile.
client
Shared HTTP/WebSocket test-codegen abstractions.
csharp
C# e2e test generator using xUnit.
dart
Dart e2e test generator using package:test and package:http.
elixir
Elixir e2e test generator using ExUnit.
gleam
Gleam e2e test generator using gleeunit/should.
go
Go e2e test generator using testing.T.
java
Java e2e test generator using JUnit 5.
kotlin
Kotlin e2e test generator using kotlin.test and JUnit 5.
php
PHP e2e test generator using PHPUnit.
python
Python e2e test code generator.
r
R e2e test generator using testthat.
ruby
Ruby e2e test generator using RSpec.
rust
Rust e2e test code generator.
swift
Swift e2e test generator using XCTest.
typescript
TypeScript e2e test generator using vitest.
wasm
WebAssembly e2e test generator using vitest.
zig
Zig e2e test generator using std.testing.

Traits§

E2eCodegen
Trait for per-language e2e test code generation.

Functions§

all_generators
Get all available e2e code generators.
generators_for
Get e2e code generators for specific language names.