diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-05-04 13:47:38 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-05-04 13:50:02 -0400 |
commit | 11688ffd4f9fa20aa8f01e1e50d9a979c6c92768 (patch) | |
tree | 526d7af51449b9ffc75367638ad6131bdc12d828 /test | |
parent | 9529aef43b964dd535410227f99fccb04a31e1be (diff) |
bugfix [1/2]: toru-path: Add a test for basic operation of toru-path
Diffstat (limited to 'test')
-rw-r--r-- | test/toru-path-test.sh | 31 | ||||
-rw-r--r-- | test/toru.d/libre/simple/PKGBUILD | 11 | ||||
-rw-r--r-- | test/toru.d/libre/split-base/PKGBUILD | 20 | ||||
-rw-r--r-- | test/toru.d/libre/split/PKGBUILD | 19 |
4 files changed, 81 insertions, 0 deletions
diff --git a/test/toru-path-test.sh b/test/toru-path-test.sh new file mode 100644 index 0000000..d215cb5 --- /dev/null +++ b/test/toru-path-test.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env roundup + +describe toru-path +. ./test-common.sh + +it_runs() { + mkdir -p "$XDG_CONFIG_HOME"/libretools + printf 'TORUPATH=%q\n' "$tmpdir" >> "$XDG_CONFIG_HOME"/libretools/libretools.conf + echo 'REPOS=(libre)' >> "$XDG_CONFIG_HOME"/libretools/libretools.conf + printf 'ABSROOT=%q\n' "$PWD/toru.d" >> "$HOME"/.abs.conf + + toru-path + + tcamgr list "$tmpdir/paths.tch"|LC_COLLATE=C sort|while read -r key; do + val="$(tcamgr get "$tmpdir/paths.tch" "$key")" + printf '«%q» -> «%q»\n' "$key" "$val" + done > "$tmpdir/paths-actual.txt" + + printf '«%q» -> «%q»\n' \ + BAR "$PWD/toru.d/libre/split-base" \ + BAZ "$PWD/toru.d/libre/split-base" \ + FOO "$PWD/toru.d/libre/split-base" \ + bar "$PWD/toru.d/libre/split" \ + baz "$PWD/toru.d/libre/split" \ + foo "$PWD/toru.d/libre/split" \ + simple "$PWD/toru.d/libre/simple" \ + split-base "$PWD/toru.d/libre/split-base" \ + > "$tmpdir/paths-expected.txt" + + diff "$tmpdir/paths-expected.txt" "$tmpdir/paths-actual.txt" +} diff --git a/test/toru.d/libre/simple/PKGBUILD b/test/toru.d/libre/simple/PKGBUILD new file mode 100644 index 0000000..e2d44d1 --- /dev/null +++ b/test/toru.d/libre/simple/PKGBUILD @@ -0,0 +1,11 @@ +pkgname='simple' +pkgver=1.0 +license=('GPL') +url='https://parabola.nu' + +pkgrel=1 +arch=(any) + +package() { + : +} diff --git a/test/toru.d/libre/split-base/PKGBUILD b/test/toru.d/libre/split-base/PKGBUILD new file mode 100644 index 0000000..ce547c5 --- /dev/null +++ b/test/toru.d/libre/split-base/PKGBUILD @@ -0,0 +1,20 @@ +pkgbase=split-base +pkgname=(FOO BAR BAZ) +pkgver=1.0 +license=('GPL') +url='https://parabola.nu' + +pkgrel=1 +arch=(any) + +package_FOO() { + : +} + +package_BAR() { + : +} + +package_BAZ() { + : +} diff --git a/test/toru.d/libre/split/PKGBUILD b/test/toru.d/libre/split/PKGBUILD new file mode 100644 index 0000000..fe25a94 --- /dev/null +++ b/test/toru.d/libre/split/PKGBUILD @@ -0,0 +1,19 @@ +pkgname=(foo bar baz) +pkgver=1.0 +license=('GPL') +url='https://parabola.nu' + +pkgrel=1 +arch=(any) + +package_foo() { + : +} + +package_bar() { + : +} + +package_baz() { + : +} |