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

Add the ability to include other test files #116

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

Conversation

jszwedko
Copy link

Adds an include directive that operates similar to load but allows
you to include other bats test files rather than just bash scripts which allows for a simple way to DRY up similar tests.

See the added tests for a simple example of how this functionality might be used.

I can add documentation for this, but wanted to get feedback on the implementation first.

Thank you!

Adds an `include` directive that operates similar to `load` but allows
you to include other bats test files rather than just bash scripts.

Allows for a simple way to DRY up similar tests.
@jszwedko
Copy link
Author

Addresses #99

So that it is available to subprocesses (including preprocessing)
@jszwedko
Copy link
Author

Any feedback @sstephenson ?

@rjernst
Copy link

rjernst commented Apr 14, 2016

Any update here? This has sat around for 6 months, and is really useful...

@sstephenson
Copy link
Owner

sstephenson commented Apr 14, 2016

Any update here? This has sat around for 6 months, and is really useful...

I’m aware there are lots of issues that need attention, but Bats is a personal project and I don’t have any time for it right now. I am looking for a full-time maintainer. Maybe that’s you?

@ztombol ztombol mentioned this pull request Dec 13, 2016
18 tasks
Sylvain303 added a commit to Sylvain303/bats that referenced this pull request Mar 23, 2017
@nkakouros
Copy link

I just found this PR. I have a similar PR here

yarikoptic pushed a commit to neurodebian/bats that referenced this pull request Aug 6, 2019
yarikoptic pushed a commit to neurodebian/bats that referenced this pull request Aug 6, 2019
Since I'm paranoid that we might need to resolve an issue specific to
4.3.11(1)-release (or whatever the Bash version is in the stock Travis
Linux image). Also, I didn't want to hold up sstephenson#116 any longer with more
tiny requests.
yarikoptic added a commit to neurodebian/bats that referenced this pull request Aug 6, 2019
Bats 1.1.0 - 2018-07-08

This is the first release with new features relative to the original Bats 0.4.0.

Added:
* The `-r, --recursive` flag to scan directory arguments recursively for
  `*.bats` files (sstephenson#109)
* The `contrib/rpm/bats.spec` file to build RPMs (sstephenson#111)

Changed:
* Travis exercises latest versions of Bash from 3.2 through 4.4 (sstephenson#116, sstephenson#117)
* Error output highlights invalid command line options (sstephenson#45, sstephenson#46, sstephenson#118)
* Replaced `echo` with `printf` (sstephenson#120)

Fixed:
* Fixed `BATS_ERROR_STATUS` getting lost when `bats_error_trap` fired multiple
  times under Bash 4.2.x (sstephenson#110)
* Updated `bin/bats` symlink resolution, handling the case on CentOS where
  `/bin` is a symlink to `/usr/bin` (sstephenson#113, sstephenson#115)

* tag 'v1.1.0': (198 commits)
  Bats 1.1.0
  bats: Replace echo with printf
  Extract `abort()` function
  travis: Remove `bats -c` wrapper
  travis: Enable build with default Linux image Bash
  Add Bash version test to Travis job.
  Revert "Re-add Bash version check to Docker image build"
  Re-add Bash version check to Docker image build
  Move timing test to Docker run for Linux jobs
  Remove version check from Docker image build
  Bash version via build matrix instead of script loop
  Fix merge error.
  Add return code storage for Bash version loop
  Add Bash version output during 'docker build'
  Clean up Docker image tags
  Add default value for Bash version
  Cover more Bash versions with Docker
  BATS_ROOT: Elide options to reset shell options
  BATS_ROOT: Restore comment noting issue sstephenson#113
  BATS_ROOT: Use `set -P`, remove `PWD` resolution
  ...
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.

4 participants