- Notifications
You must be signed in to change notification settings - Fork429
Bash Automated Testing System
License
bats-core/bats-core
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Bats is aTAP-compliant testing framework for Bash3.2 or above. It provides a simple way to verify that the UNIX programs youwrite behave as expected.
A Bats test file is a Bash script with special syntax for defining test cases.Under the hood, each test case is just a function with a description.
#!/usr/bin/env bats@test"addition using bc" { result="$(echo 2+2| bc)" ["$result"-eq 4 ]}@test"addition using dc" { result="$(echo 2 2+p| dc)" ["$result"-eq 4 ]}
Bats is most useful when testing software written in Bash, but you can use it totest any UNIX program.
Test cases consist of standard shell commands. Bats makes use of Bash'serrexit
(set -e
) option when running test cases. If every command in thetest case exits with a0
status code (success), the test passes. In this way,each line is an assertion of truth.
NOTE The documentation has moved tohttps://bats-core.readthedocs.io
bin/bats --taptest
See also theCI settings for the current test environment andscripts.
The Bats source code repository ishosted onGitHub. There you can file bugs on theissue tracker or submit tested pull requests for review.
For real-world examples from open-source projects using Bats, seeProjectsUsing Bats onthe wiki.
To learn how to set up your editor for Bats syntax highlighting, seeSyntaxHighlightingon the wiki.
For now see thedocs
folder for project guides, work with us on the wikior look at the other communication channels.
- You can find and chat with us on ourGitter.
Seedocs/CHANGELOG.md
.
There was an initialcall for maintainers for the original Bats repository, but write access to it could not be obtained. With development activity stalled, this fork allowed ongoing maintenance and forward progress for Bats.
Tuesday, September 19, 2017: This was forked fromBats atcommit0360811. It was created viagit clone --bare
andgit push --mirror
.
As ofThursday, April 29, 2021: the originalBats has beenarchived by the owner and is now read-only.
Thisbats-core repo is now the community-maintained Bats project.
The Bats Logo was created byVukory (Github) and sponsored bySethFalco. If you want to use our logo, have a look at ourguidelines.
© 2017-2024 bats-core organization
© 2011-2016 Sam Stephenson
Bats is released under an MIT-style license; seeLICENSE.md
for details.
See theparent project at GitHub or theAUTHORS file for the current project maintainer team.
About
Bash Automated Testing System