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. Bats is most useful when testing software is 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. 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.

Features

  • For real-world examples from open-source projects using Bats
  • Learn how to set up your editor for Bats syntax highlighting
  • You can use it to test any UNIX program
  • Bats is most useful when testing software written in Bash
  • Test cases consist of standard shell commands
  • Bats makes use of Bash's errexit option

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow Bats-core

Bats-core Web Site

Other Useful Business Software
Full-stack observability with actually useful AI | Grafana Cloud Icon
Full-stack observability with actually useful AI | Grafana Cloud

Our generous forever free tier includes the full platform, including the AI Assistant, for 3 users with 10k metrics, 50GB logs, and 50GB traces.

Built on open standards like Prometheus and OpenTelemetry, Grafana Cloud includes Kubernetes Monitoring, Application Observability, Incident Response, plus the AI-powered Grafana Assistant. Get started with our generous free tier today.
Create free account
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Bats-core!

Additional Project Details

Operating Systems

Windows

Programming Language

Unix Shell

Related Categories

Unix Shell Terminals, Unix Shell Exam Software, Unix Shell Automated Testing Tool

Registered

2022-04-12