やってみる

アウトプットすべく己を導くためのブログ。その試行錯誤すらたれ流す。

BashテストツールBatsをインストールし使ってみた2

 前回のはリポジトリ管理されなくなっていたので、新しいのをインストールする。

手順

git clone https://github.com/bats-core/bats-core.git
cd bats-core
sudo ./install.sh /usr/local

パス確認

which bats
/usr/local/bin/bats

バージョン確認

bats --version
Bats 1.2.1

ヘルプ

bats --help
Bats 1.2.1
Usage: bats [OPTIONS] <tests>
       bats [-h | -v]

  <tests> is the path to a Bats test file, or the path to a directory
  containing Bats test files (ending with ".bats")

  -c, --count               Count test cases without running any tests
  -f, --filter <regex>      Only run tests that match the regular expression
  -F, --formatter <type>    Switch between formatters: pretty (default),
                              tap (default w/o term), tap13, junit
  -h, --help                Display this help message
  -j, --jobs <jobs>         Number of parallel jobs (requires GNU parallel)
  --no-tempdir-cleanup      Preserve test output temporary directory
  --no-parallelize-across-files
                            Serialize test file execution instead of running
                            them in parallel (requires --jobs >1)
  --no-parallelize-within-files
                            Serialize test execution within files instead of
                            running them in parallel (requires --jobs >1)
  --report-formatter <type> Switch between reporters (same options as --formatter)
  -o, --output <dir>        Directory to write report files
  -p, --pretty              Shorthand for "--formatter pretty"
  -r, --recursive           Include tests in subdirectories
  -t, --tap                 Shorthand for "--formatter tap"
  -T, --timing              Add timing information to tests
  -v, --version             Display the version number

  For more information, see https://github.com/bats-core/bats-core

対象環境

$ uname -a
Linux raspberrypi 5.4.72-v7l+ #1356 SMP Thu Oct 22 13:57:51 BST 2020 armv7l GNU/Linux