Skip to content

Commit

Permalink
test/system: Track bats libs as submodules & install them better
Browse files Browse the repository at this point in the history
This will make it easier to work with system tests.

containers#842
  • Loading branch information
HarryMichal committed Jul 22, 2021
1 parent d9945a6 commit 2594199
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 12 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
src/toolbox
test/system/libs/bats-assert
test/system/libs/bats-support
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "test/system/libs/bats-support"]
path = test/system/libs/bats-support
url = https://github.com/bats-core/bats-support.git
[submodule "test/system/libs/bats-assert"]
path = test/system/libs/bats-assert
url = https://github.com/bats-core/bats-assert.git
22 changes: 20 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project(
'c',
version: '0.0.99.2',
license: 'ASL 2.0',
meson_version: '>= 0.40.0',
meson_version: '>= 0.42.0',
)

cc = meson.get_compiler('c')
Expand Down Expand Up @@ -38,7 +38,25 @@ endif

install_subdir(
'test',
install_dir: join_paths(get_option('datadir'), meson.project_name())
install_dir: join_paths(get_option('datadir'), meson.project_name()),
exclude_files: [
'system/libs/bats-assert/.git',
'system/libs/bats-assert/.gitignore',
'system/libs/bats-assert/.travis.yml',
'system/libs/bats-assert/package.json',
'system/libs/bats-support/.git',
'system/libs/bats-support/.gitignore',
'system/libs/bats-support/.travis.yml',
'system/libs/bats-support/package.json'
],
exclude_directories: [
'system/libs/bats-assert/.git',
'system/libs/bats-assert/script',
'system/libs/bats-assert/test',
'system/libs/bats-support/.git',
'system/libs/bats-support/script',
'system/libs/bats-support/test'
]
)

subdir('data')
Expand Down
11 changes: 3 additions & 8 deletions test/system/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,9 @@ tests will clear all podman state (delete all containers, images, etc).
- `toolbox`

These tests use a few standard libraries for `bats` which help with clarity
and consistency. In order to use it you need to download them to the `libs`
directory:

```
# Go to the Toolbox root folder
$ git clone https://github.com/bats-core/bats-assert test/system/libs/bats-assert
$ git clone https://github.com/bats-core/bats-support test/system/libs/bats-support
```
and consistency. The libraries are [bats-support](https://github.com/bats-core/bats-support)
and [bats-assert](https://github.com/bats-core/bats-assert). These libraries are
provided as git submodules in the `libs` directory. Make sure both are present.

## Convention

Expand Down
1 change: 1 addition & 0 deletions test/system/libs/bats-assert
Submodule bats-assert added at d750c5
1 change: 1 addition & 0 deletions test/system/libs/bats-support
Submodule bats-support added at 24a72e

0 comments on commit 2594199

Please sign in to comment.