Go to file
openKylinBot 485f4b832a Import Debian changes 1.10.0-ok1
bats (1.10.0-ok1) nile; urgency=medium

  * Build for openKylin.
2024-05-07 15:14:04 +08:00
.devcontainer Import Upstream version 1.10.0 2024-05-07 15:14:04 +08:00
.github Import Upstream version 1.10.0 2024-05-07 15:14:04 +08:00
bin Import Upstream version 1.10.0 2024-05-07 15:14:04 +08:00
contrib Import Upstream version 1.10.0 2024-05-07 15:14:04 +08:00
debian Import Debian changes 1.10.0-ok1 2024-05-07 15:14:04 +08:00
docker Import Upstream version 1.8.2 2023-02-28 13:36:06 +08:00
docs Import Upstream version 1.10.0 2024-05-07 15:14:04 +08:00
lib/bats-core Import Upstream version 1.10.0 2024-05-07 15:14:04 +08:00
libexec/bats-core Import Upstream version 1.10.0 2024-05-07 15:14:04 +08:00
man Import Upstream version 1.10.0 2024-05-07 15:14:04 +08:00
test Import Upstream version 1.10.0 2024-05-07 15:14:04 +08:00
.editorconfig Import Upstream version 1.8.2 2023-02-28 13:36:06 +08:00
.gitattributes Import Upstream version 1.8.2 2023-02-28 13:36:06 +08:00
.gitignore Import Upstream version 1.8.2 2023-02-28 13:36:06 +08:00
.readthedocs.yml Import Upstream version 1.8.2 2023-02-28 13:36:06 +08:00
AUTHORS Import Upstream version 1.8.2 2023-02-28 13:36:06 +08:00
Dockerfile Import Upstream version 1.8.2 2023-02-28 13:36:06 +08:00
LICENSE.md Import Upstream version 1.8.2 2023-02-28 13:36:06 +08:00
README.md Import Upstream version 1.8.2 2023-02-28 13:36:06 +08:00
docker-compose.override.dist Import Upstream version 1.8.2 2023-02-28 13:36:06 +08:00
docker-compose.yml Import Upstream version 1.8.2 2023-02-28 13:36:06 +08:00
install.sh Import Upstream version 1.8.2 2023-02-28 13:36:06 +08:00
package.json Import Upstream version 1.10.0 2024-05-07 15:14:04 +08:00
shellcheck.sh Import Upstream version 1.8.2 2023-02-28 13:36:06 +08:00
uninstall.sh Import Upstream version 1.8.2 2023-02-28 13:36:06 +08:00

README.md

Bats-core: Bash Automated Testing System

Latest release npm package License: MIT Continuous integration status Read the docs status

Join the chat in bats-core/bats-core on gitter

Bats is a TAP-compliant testing framework for Bash. It provides a simple way to verify that the UNIX programs you write 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 to test any UNIX program.

Test cases consist of standard shell commands. Bats makes use of Bash's errexit (set -e) option when running test cases. If every command in the test case exits with a 0 status code (success), the test passes. In this way, each line is an assertion of truth.

Table of contents

NOTE The documentation has moved to https://bats-core.readthedocs.io

Testing

bin/bats --tap test

See also the CI settings for the current test environment and scripts.

Support

The Bats source code repository is hosted on GitHub. There you can file bugs on the issue tracker or submit tested pull requests for review.

For real-world examples from open-source projects using Bats, see Projects Using Bats on the wiki.

To learn how to set up your editor for Bats syntax highlighting, see Syntax Highlighting on the wiki.

Contributing

For now see the docs folder for project guides, work with us on the wiki or look at the other communication channels.

Contact

  • You can find and chat with us on our Gitter.

Version history

See docs/CHANGELOG.md.

Background

What's the plan and why?

Tuesday, September 19, 2017: This was forked from Bats at commit 0360811. It was created via git clone --bare and git push --mirror.

This bats-core repo is the community-maintained Bats project.

Why was this fork created?

There was an initial call 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.

© 2017-2022 bats-core organization

© 2011-2016 Sam Stephenson

Bats is released under an MIT-style license; see LICENSE.md for details.

See the parent project at GitHub or the AUTHORS file for the current project maintainer team.