Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.

Support log file and filtering tests #173

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jinuxstyle
Copy link

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 734a049

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 d7aea2a

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 0d743bc

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 [email protected]

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.
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.
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'
@briceburg
Copy link

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
Copy link

ztombol commented Dec 9, 2016

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

@ztombol ztombol mentioned this pull request Dec 13, 2016
18 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants