rust_test_core 0.1.1-alpha.2

Core logic for rust_test_framework
Documentation

rust_test_framework

A data-driven testing framework for Rust.

Features

  • Data-Driven Testing (DDT): Run the same test logic with multiple inputs.
  • Procedural Macros: Easy-to-use attributes for defining test cases.
  • Clean Output: Clear results for individual test cases.

Usage

This project is currently in alpha.

Add this to your Cargo.toml:

[dev-dependencies]
rust_test_framework = "0.1.1-alpha.1"

Example usage:

use rust_test_framework::test_case_source;
use rust_test_framework::SourceType;
use serde::Deserialize;

#[derive(Deserialize)]
struct TestCase {
    a: i32,
    b: i32,
    expected: i32,
}

// This will generate a test case for each entry in `tests/data.json`
#[test_case_source(SourceType::JsonFile("tests/data.json", TestCase))]
fn test_addition(case: TestCase) {
    assert_eq!(case.a + case.b, case.expected);
}

License

Licensed under the Apache License, Version 2.0.