summaryrefslogtreecommitdiff
path: root/test/cases
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2018-09-29 18:34:42 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2018-10-01 20:31:57 -0400
commitb41bd912b9440b0663cb25960346a4fb4805d62a (patch)
tree092efcee116c9ac477e88654cb6b424ffe355201 /test/cases
parent00406ddaa210e0e9a6e31e0e6841b51edabc80fb (diff)
(BATS) test: Manual Roundup→BATS conversion
Diffstat (limited to 'test/cases')
-rw-r--r--test/cases/lib-messages.bats14
-rw-r--r--test/cases/librechroot.bats4
-rw-r--r--test/cases/librefetch.bats2
-rw-r--r--test/cases/libremakepkg.bats4
4 files changed, 13 insertions, 11 deletions
diff --git a/test/cases/lib-messages.bats b/test/cases/lib-messages.bats
index c992a33..69a5f09 100644
--- a/test/cases/lib-messages.bats
+++ b/test/cases/lib-messages.bats
@@ -1,14 +1,16 @@
load ../lib/common
-@test "libremessages can be included twice" (
+@test "libremessages can be included twice" {
. libremessages
. libremessages
-)
+}
-@test "libremessages can be included with set euE" (
- set -euE
- . libremessages
-)
+@test "libremessages can be included with set euE" {
+ ( # use a subshell because BATS doesn't like `set -u`
+ set -euE
+ . libremessages
+ )
+}
@test "libremessages works with no color and set euE" {
(
diff --git a/test/cases/librechroot.bats b/test/cases/librechroot.bats
index 7e8504d..7d05ebc 100644
--- a/test/cases/librechroot.bats
+++ b/test/cases/librechroot.bats
@@ -13,13 +13,13 @@ load ../lib/common
# TODO: inspect /repo/* more
}
-@test "librechroot respects exit status if out isnt a tty" (
+@test "librechroot respects exit status if out isnt a tty" {
require network sudo || skip
set -o pipefail
{ testsudo librechroot -l "$BATS_TEST_NAME" run bash -c 'exit 3' | cat; } || status=$?
[[ $status == 3 ]]
-)
+}
@test "librechroot creates ca certificates" {
require network sudo || skip
diff --git a/test/cases/librefetch.bats b/test/cases/librefetch.bats
index 47cd9bd..8f03494 100644
--- a/test/cases/librefetch.bats
+++ b/test/cases/librefetch.bats
@@ -41,7 +41,7 @@ setup() {
not test -e $tmpdir/workdir/srcdest/$srcball
}
-# This test used to be called "it_cleans_src_libre_first", but let's
+# This test used to be called "librefetch cleans src-libre first", but let's
# be honest: it checks pretty much everything related to normal
# operation.
@test "librefetch runs with mksource" {
diff --git a/test/cases/libremakepkg.bats b/test/cases/libremakepkg.bats
index 8ac46cf..d511c38 100644
--- a/test/cases/libremakepkg.bats
+++ b/test/cases/libremakepkg.bats
@@ -76,8 +76,8 @@ setup() {
testsudo libremakepkg -l "$BATS_TEST_NAME" &> "$tmpdir/out" || { status=$?; tail "$tmpdir/out"|cat -v; return $status; }
testsudo librechroot -l "$BATS_TEST_NAME" run libretools-testpkg1 'first time, pass'
- # This next line is actually a separate test, but it fits in well with this test, and chroot tests are slow..
- # it_doesnt_cache_local_packages() {
+ # This next line is actually a separate test, but it fits in well with this test, and chroot tests are slow.
+ # @test "libremakepkg doesnt cache local packages" {
not testsudo librechroot -l "$BATS_TEST_NAME" run test -e /var/cache/pacman/pkg/libretools-testpkg1-1.0-1-any.pkg.tar.?z
cd "$tmpdir/3"