sstephenson / bats

Bash Automated Testing System
MIT License
7.12k stars 517 forks source link

Support log file and filtering tests #173

Open jinuxstyle opened 8 years ago

jinuxstyle commented 8 years ago

This PR contains three commits which together are intended to support log to a a specified file and filtering tests based on regex pattern given by user.

commit 734a049e0b9662805273addcaa187e4ea98a4718

Support filtering tests

Support filtering tests based on the regex pattern given by user.
A new option named -f (or --filter) is added for this feature.

For example, to run tests whose name contain word foo or Foo:
$ bats --tap --filter '[Ff]oo'

commit d7aea2a76a01c7b91484982531a3f0c222b4f475

Support logging to specified file

Currently, bats puts logs to a temporary file and removes the file
at the end of the test. This is not convenient for observing the logs.
This commit makes it possible for user to specify a log file and
observe the logs during test or for post test analyzing. A new option
named -l (or --logfile) is added for this function.

commit 0d743bc516c2fda4dee1bab610e0b3d8dd062ce7

Support command line options that take values

Add support of command line options that take valuea. This paves
way for adding more features like logging to a specified file and
filtering tests based on a pattern given by user.

Signed-off-by: Jin Xu jinuxstyle@hotmail.com

briceburg commented 8 years ago

filtering is a nice convenience -- and often allows for faster development of tests. Jasmine uses the word "focused", e.g. prefixing a @test with an f (@ftest) will limit execution to that test only.

I see a lot of PRs stacking up, @sstephenson are you looking for help maintaining?

ztombol commented 7 years ago

@briceburg Yes, the project is in need of a lead maintainer. See #150.