当前位置: 首页 > 工具软件 > BATS > 使用案例 >

Linux Bats

羊昊苍
2023-12-01

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.

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.

See bats(7) for more information on writing Bats tests.

bats-assert
bats-support

 类似资料:

相关阅读

相关文章

相关问答