Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/olets/zsh-test-runner
Straight-forward tests and coverage reports for zsh and —under zsh's emulation— csh, ksh, and sh
https://github.com/olets/zsh-test-runner
cli command-line coverage csh ksh sh shell test-framework test-reporting test-runner testing unit-testing zsh
Last synced: 16 days ago
JSON representation
Straight-forward tests and coverage reports for zsh and —under zsh's emulation— csh, ksh, and sh
- Host: GitHub
- URL: https://github.com/olets/zsh-test-runner
- Owner: olets
- License: other
- Created: 2021-03-27T13:33:06.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-16T02:55:42.000Z (10 months ago)
- Last Synced: 2024-01-16T07:52:32.578Z (10 months ago)
- Topics: cli, command-line, coverage, csh, ksh, sh, shell, test-framework, test-reporting, test-runner, testing, unit-testing, zsh
- Language: Shell
- Homepage: https://zsh-test-runner.olets.dev/
- Size: 198 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# zsh-test-runner (ztr) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/olets/zsh-test-runner)
> Straight-forward tests and coverage reports for zsh and —under zsh's emulation— csh, ksh, and sh
**What it features**: everything you need for testing zsh scripts.
- test [zsh](https://www.zsh.org/) and, to a degree, [csh](https://en.wikipedia.org/wiki/C_shell), [ksh](http://kornshell.com/), and [sh](https://en.wikipedia.org/wiki/Bourne_shell) thanks to zsh's [`emulate`](https://zsh.sourceforge.io/Doc/Release/Shell-Builtin-Commands.html) builtin
- optionally give tests descriptive names and additional notes
- run one or more tests on the command line
- run one or more tests saved in a test suite file
- optionally run a setup function before each test
- optionally run a teardown function after each test
- skip tests
- queue tests to run in a batch
- optionally run a bootstrap function before each batch
- optionally run a clean function after each batch
- access cumulative failure, pass, and skip counts as shell variables
- print coverage summaries with total count, failure count and rate, pass count and rate, and skip count
- short and gentle learning curve**What it does not feature**: its own human language-like declarative test syntax.
There's no "describe", "expect", etc. Downside is the tests don't read like a story. Upside is —because the shell already has rich support for tests— there is nothing idiomatic to learn, there are no artificial limits on what can be tested, the cost to migrating to zsh-test-runner (or from it, if you must) is very low, and there is no risk that assertions were incorrectly implemented. Just write your `[[ ]]`s, `(( ))`s, even your `test`s and `[ ]`s.
## Documentation
📖 See the guide at https://zsh-test-runner.olets.dev/
## Examples
See the [examples' README](examples/README.md).
## Changelog
See [CHANGELOG](CHANGELOG.md).
## Roadmap
See [ROADMAP](ROADMAP.md).
## Contributing
_Looking for the documentation site's source? See _
Thanks for your interest. Contributions are welcome!
> Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
Check the [Issues](https://github.com/olets/zsh-test-runner/issues) to see if your topic has been discussed before or if it is being worked on. You may also want to check the roadmap (see above).
Please read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request.
To test `ztr` run `zsh ./tests/ztr.ztr.zsh`
## License
zsh-test-runner by Henry Bley-Vroman is licensed under a license which is the unmodified text of CC BY-NC-SA 4.0 and the unmodified text of a Hippocratic License 3. It is not affiliated with Creative Commons or the Organization for Ethical Source.
Human-readable summary of (and not a substitute for) the [LICENSE](LICENSE) file:
You are free to
- Share — copy and redistribute the material in any medium or format
- Adapt — remix, transform, and build upon the materialUnder the following terms
- Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- Non-commercial — You may not use the material for commercial purposes.
- Ethics - You must abide by the ethical standards specified in the Hippocratic License 3 with Ecocide, Extractive Industries, US Tariff Act, Mass Surveillance, Military Activities, and Media modules.
- Preserve terms — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
- No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.