https://github.com/deltartificial/tygen
Generate robust tests for Rust types ⚗️
https://github.com/deltartificial/tygen
rust test test-automation types
Last synced: about 1 month ago
JSON representation
Generate robust tests for Rust types ⚗️
- Host: GitHub
- URL: https://github.com/deltartificial/tygen
- Owner: deltartificial
- License: mit
- Created: 2025-02-15T22:24:12.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-02-16T22:10:50.000Z (4 months ago)
- Last Synced: 2025-02-16T23:19:49.204Z (4 months ago)
- Topics: rust, test, test-automation, types
- Language: Rust
- Homepage:
- Size: 53.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tygen ⚗️
A powerful Rust CLI tool for automatically generating comprehensive test suites for Rust types.
## Features
- Trait implementation testing (Debug, Clone, PartialEq)
- Serialization testing
- Memory layout analysis
- Field validation
- JSON schema validation
- Default implementation testing
- Size and alignment checks
- Option wrapping analysis
- Attribute validation## Installation
```bash
# Clone the repository
git clone https://github.com/deltartificial/tygen.git
cd tygen# Install dependencies and build
cargo build --release
```## Usage
```bash
# Basic usage
cargo run -- path/to/types.rs# Example with provided test files
cargo run -- ./example_type.rs# With custom output directory
cargo run -- path/to/types.rs -o custom/test/dir# With verbose output
cargo run -- path/to/types.rs -v
```## Configuration
The test generation can be configured through the `TestConfig` struct:
```rust
let config = TestConfig {
check_derives: true,
check_serialization: true,
check_size: true,
check_fields: true,
};
```## Project Structure
```
src/
├── analyzer/ # Type analysis and parsing
├── generator/ # Test generation logic
├── error/ # Error handling
├── cli.rs # CLI interface
├── lib.rs # Library interface
└── main.rs # Entry point
```## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is licensed under the MIT License - see the LICENSE file for details.