Skip to content

Commit 81e6c72

Browse files
kiwiroyreneeotten
authored andcommitted
bats-core: update to 1.13.0
1 parent f379e11 commit 81e6c72

File tree

5 files changed

+45
-71
lines changed

5 files changed

+45
-71
lines changed

sysutils/bats-core/Portfile

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
PortSystem 1.0
44
PortGroup github 1.0
55

6-
github.setup bats-core bats-core 1.4.1 v
6+
github.setup bats-core bats-core 1.13.0 v
77
revision 0
88
categories sysutils
99
platforms any
@@ -17,23 +17,25 @@ long_description \
1717

1818
github.tarball_from archive
1919

20-
checksums rmd160 86429672c062f4736d49adaaf7302e31ab853f59 \
21-
sha256 bff517da043ae24440ec8272039f396c2a7907076ac67693c0f18d4a17c08f7d \
22-
size 98964
20+
checksums rmd160 ef1ce0fd2f14396ec5d46b4503537ee4e1221097 \
21+
sha256 a85e12b8828271a152b338ca8109aa23493b57950987c8e6dff97ba492772ff3 \
22+
size 178709
2323

24-
patchfiles patch-test-bats.diff \
25-
patch-test-parallel.diff
24+
patchfiles patch-libexec-bats.diff \
25+
patch-test-timeout.diff
2626

27-
depends_run port:bash
27+
depends_run port:bash \
28+
port:parallel
2829

2930
use_configure no
3031
build {}
3132

3233
# test from bats-core github action
3334
# depends_test port:parallel
34-
test.cmd ./bin/bats --formatter tap
35-
test.env TERM=linux BATS_NO_PARALLELIZE_ACROSS_FILES=1 BATS_NUMBER_OF_PARALLEL_JOBS=2
35+
test.cmd ./bin/bats
36+
test.pre_args-prepend --formatter tap --print-output-on-failure
37+
test.env TERM=linux
3638
test.run yes
3739
destroot.cmd ./install.sh
38-
destroot.args ${destroot}${prefix}
40+
destroot.args ${destroot}${prefix} lib
3941
destroot.target-delete install
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--- libexec/bats-core/bats
2+
+++ libexec/bats-core/bats
3+
@@ -128,9 +128,11 @@ export BATS_LINE_REFERENCE_FORMAT=${BATS_LINE_REFERENCE_FORMAT-comma_line}
4+
if [[ ! -d "${BATS_TMPDIR}" ]]; then
5+
printf "Error: BATS_TMPDIR (%s) does not exist or is not a directory" "${BATS_TMPDIR}" >&2
6+
exit 1
7+
-elif [[ ! -w "${BATS_TMPDIR}" ]]; then
8+
+elif ! touch "${BATS_TMPDIR}/.bats_tmp_test_$$" 2>/dev/null; then
9+
printf "Error: BATS_TMPDIR (%s) is not writable" "${BATS_TMPDIR}" >&2
10+
exit 1
11+
+else
12+
+ rm -f "${BATS_TMPDIR}/.bats_tmp_test_$$"
13+
fi
14+
15+
arguments=()

sysutils/bats-core/files/patch-test-bats.diff

Lines changed: 0 additions & 25 deletions
This file was deleted.

sysutils/bats-core/files/patch-test-parallel.diff

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--- test/timeout.bats
2+
+++ test/timeout.bats
3+
@@ -16,6 +16,7 @@ bats_require_minimum_version 1.5.0
4+
5+
@test "test longer than timeout" {
6+
SECONDS=0
7+
+ if ! ps -ef 2>/dev/null; then skip "sandbox environment cannot execute ps"; fi
8+
reentrant_run ! env BATS_TEST_TIMEOUT=1 SLEEP=10 bats -T "$FIXTURE_ROOT/sleep2.bats"
9+
[ "${lines[0]}" == '1..1' ]
10+
[[ "${lines[1]}" == 'not ok 1 my sleep 10 in '*'ms # timeout after 1s' ]] || false
11+
@@ -26,6 +27,7 @@ bats_require_minimum_version 1.5.0
12+
13+
@test "run longer than timeout" {
14+
SECONDS=0
15+
+ if ! ps -ef 2>/dev/null; then skip "sandbox environment cannot execute ps"; fi
16+
reentrant_run ! env BATS_TEST_TIMEOUT=1 SLEEP=10 bats -T "$FIXTURE_ROOT/run sleep.bats" --print-output-on-failure
17+
[ "${lines[0]}" == '1..1' ]
18+
[[ "${lines[1]}" == 'not ok 1 my sleep 10 in '*'ms # timeout after 1s' ]] || false

0 commit comments

Comments
 (0)