https://github.com/galvingao/stdiotest
stdiotest is a testing utility which tests the stdout output of a given program with specified stdin. It also supports running the tests in parallel to improve efficiency.
https://github.com/galvingao/stdiotest
Last synced: 3 months ago
JSON representation
stdiotest is a testing utility which tests the stdout output of a given program with specified stdin. It also supports running the tests in parallel to improve efficiency.
- Host: GitHub
- URL: https://github.com/galvingao/stdiotest
- Owner: GalvinGao
- Created: 2022-09-05T19:42:38.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-05T23:34:12.000Z (almost 3 years ago)
- Last Synced: 2025-03-15T04:35:53.367Z (3 months ago)
- Language: Go
- Size: 8.79 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `stdiotest`
stdiotest is a testing utility which tests the stdout output of a given program with specified stdin. It also supports running the tests in parallel to improve efficiency.
## How to use
1. Install the cli tool: `go install github.com/GalvinGao/stdiotest@latest`
2. Create a `stdiotest.yaml` file in the root of your project. The file should look like this:```yaml
test_cases:
- cmd: "./main"
exit_code: 0
stdin: "Galvin"
stdout: |
Hello, Galvin!- cmd: "./main"
exit_code: 0
stdin: "Alice"
stdout: |
Hello, Alice!- cmd: "./main"
exit_code: 1
stdin: "Bob"
stdout: |
Bob is not allowed to use this program.-```
3. Run `stdiotest run` in the root of your project.
See `stdiotest help` for more information.