Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Bash Automated Testing System

License

NotificationsYou must be signed in to change notification settings

bats-core/bats-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latest releasenpm packageLicense: MITContinuous integration statusRead the docs status

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

Bats-core: Bash Automated Testing System

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.

Table of contents

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

Testing

bin/bats --taptest

See also theCI settings for the current test environment andscripts.

Support

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.

Contributing

For now see thedocs folder for project guides, work with us on the wikior look at the other communication channels.

Contact

  • You can find and chat with us on ourGitter.

Version history

Seedocs/CHANGELOG.md.

Background

Why was this fork created?

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.

Copyright

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.


[8]ページ先頭

©2009-2025 Movatter.jp