bats-core

Bash Automated Testing System
授权协议 View license
开发语言 SHELL
所属分类 应用工具、 终端/远程登录
软件类型 开源软件
地区 不详
投 递 者 桑宇
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Bats-core: Bash Automated Testing System (2018)

Continuous integration status

Bats is a TAP-compliant testing framework for Bash. It provides a simpleway 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 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 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 andscripts.

Support

The Bats source code repository is hosted 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, see ProjectsUsing Bats onthe wiki.

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

Contributing

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

Contact

  • We are #bats on freenode;
  • Or leave a message on gitter.

Version history

See docs/CHANGELOG.md.

Background

What's the plan and why?

Tuesday, September 19, 2017: This was forked from Bats atcommit 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.

Copyright

© 2017-2021 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 theAUTHORS file for the current project maintainer team.

  • 创建bat脚本文件,文件中输入命令 @echo off start cmd /k "cd /D e:\publish&&dotnet xxx.dll" 命令说明: @echo off :关闭回显 cmd /k:cmd窗口不关闭 cd /D(或者cd /d也可以):进入指定文件目录(这里是.net core 项目发布包的路径) dotnet xxx.dll:启动.net core项目 以管理员身份运

相关阅读

相关文章

相关问答

相关文档