Skip to content

wanders/outputcheck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

outputcheck

FileCheck-style testing for rust integration tests.

Example

Say you have a binary (named calculator) that reads expressions from stdin, and outputs result to stdout.

Then in tests/integration.rs write:

#[test]
fn run_output_check_tests() {
    outputcheck::run([
        "tests/outputcheck/simple.txt",
    ]);
}

and in tests/outputcheck/simple.txt:

# RUN: cargo run --binary=calculator -- --input=%s --output=/dev/stdout
1 + 2
# CHECK: Result: 3
9 * 3
# CHECK: Result: 27
10 / 0
# CHECK: <Division by zero error>

About

FileCheck-like checking for rust integrationtests

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages