eac_git 0.18.1 → 0.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/eac_git/local/remote.rb +0 -2
- data/lib/eac_git/local/subrepo/config.rb +2 -0
- data/lib/eac_git/remote_like/ls_result.rb +1 -1
- data/lib/eac_git/remote_like.rb +0 -1
- data/lib/eac_git/rspec/stubbed_git_local_repo.rb +0 -2
- data/lib/eac_git/rspec.rb +0 -1
- data/lib/eac_git/version.rb +1 -1
- data/lib/eac_git.rb +0 -2
- data/vendor/git-subrepo/.fish.rc +20 -0
- data/vendor/git-subrepo/.gitattributes +1 -0
- data/vendor/git-subrepo/.github/workflows/test.yml +29 -0
- data/vendor/git-subrepo/.gitignore +1 -0
- data/vendor/git-subrepo/.gitrepo +7 -0
- data/vendor/git-subrepo/.rc +32 -0
- data/vendor/git-subrepo/Changes +66 -0
- data/vendor/git-subrepo/Intro.pod +2 -5
- data/vendor/git-subrepo/Makefile +45 -5
- data/vendor/git-subrepo/Meta +2 -2
- data/vendor/git-subrepo/ReadMe.pod +26 -31
- data/vendor/git-subrepo/doc/git-subrepo.swim +22 -18
- data/vendor/git-subrepo/doc/intro-to-subrepo.swim +2 -4
- data/vendor/git-subrepo/ext/bashplus/.gitrepo +12 -0
- data/vendor/git-subrepo/ext/bashplus/.travis.yml +6 -0
- data/vendor/git-subrepo/ext/bashplus/Changes +19 -0
- data/vendor/git-subrepo/ext/bashplus/License +1 -1
- data/vendor/git-subrepo/ext/bashplus/Makefile +25 -0
- data/vendor/git-subrepo/ext/bashplus/Meta +4 -4
- data/vendor/git-subrepo/ext/bashplus/ReadMe.pod +2 -2
- data/vendor/git-subrepo/ext/bashplus/bin/bash+ +8 -7
- data/vendor/git-subrepo/ext/bashplus/doc/bash+.swim +1 -1
- data/vendor/git-subrepo/ext/bashplus/lib/bash+.bash +85 -38
- data/vendor/git-subrepo/ext/bashplus/man/man1/bash+.1 +8 -8
- data/vendor/git-subrepo/ext/bashplus/man/man3/bash+.3 +8 -8
- data/vendor/git-subrepo/ext/bashplus/test/base.t +4 -5
- data/vendor/git-subrepo/ext/bashplus/test/die.t +16 -0
- data/vendor/git-subrepo/ext/bashplus/test/fcopy.t +2 -3
- data/vendor/git-subrepo/ext/bashplus/test/{test.bash → setup} +18 -8
- data/vendor/git-subrepo/ext/bashplus/test/shellcheck.t +37 -0
- data/vendor/git-subrepo/ext/bashplus/test/source-bash+-std.t +10 -11
- data/vendor/git-subrepo/ext/bashplus/test/source-bash+.t +10 -11
- data/vendor/git-subrepo/ext/bashplus/test/use.t +8 -5
- data/vendor/git-subrepo/ext/bashplus/test/version-check.t +23 -0
- data/vendor/git-subrepo/ext/test-more-bash/.gitrepo +12 -0
- data/vendor/git-subrepo/ext/test-more-bash/.travis.yml +6 -0
- data/vendor/git-subrepo/ext/test-more-bash/Changes +11 -0
- data/vendor/git-subrepo/ext/test-more-bash/License +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/Makefile +25 -0
- data/vendor/git-subrepo/ext/test-more-bash/Meta +5 -5
- data/vendor/git-subrepo/ext/test-more-bash/ReadMe.pod +9 -3
- data/vendor/git-subrepo/ext/test-more-bash/doc/test-more.swim +7 -2
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/.gitrepo +12 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/.travis.yml +6 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Changes +11 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/License +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Makefile +25 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/Meta +3 -3
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/ReadMe.pod +2 -2
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/bin/bash+ +8 -7
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/doc/bash+.swim +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/lib/bash+.bash +85 -38
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/man/man1/bash+.1 +8 -8
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/man/man3/bash+.3 +8 -8
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/base.t +4 -4
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/die.t +17 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/fcopy.t +2 -2
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/{test.bash → setup} +17 -8
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/shellcheck.t +38 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/source-bash+-std.t +10 -10
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/source-bash+.t +10 -10
- data/vendor/git-subrepo/ext/test-more-bash/ext/bashplus/test/use.t +8 -4
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/.gitrepo +12 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/.travis.yml +5 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Changes +11 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/License +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Makefile +30 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/Meta +3 -3
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/ReadMe.pod +2 -2
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/doc/test-tap.swim +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/lib/test/tap.bash +46 -42
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/man/man3/test-tap.3 +8 -8
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/bail_out.t +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/fail.t +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/fail_fast.t +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/helper.bash +1 -1
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/shellcheck.t +42 -0
- data/vendor/git-subrepo/ext/test-more-bash/ext/test-tap-bash/test/tap.t +11 -5
- data/vendor/git-subrepo/ext/test-more-bash/lib/test/more.bash +35 -15
- data/vendor/git-subrepo/ext/test-more-bash/man/man3/test-more.3 +16 -10
- data/vendor/git-subrepo/ext/test-more-bash/test/fail.t +15 -1
- data/vendor/git-subrepo/ext/test-more-bash/test/more.t +12 -4
- data/vendor/git-subrepo/ext/test-more-bash/test/setup +3 -3
- data/vendor/git-subrepo/ext/test-more-bash/test/shellcheck.t +35 -0
- data/vendor/git-subrepo/ext/test-more-bash/test/test/fail1.t +14 -1
- data/vendor/git-subrepo/lib/git-subrepo +375 -260
- data/vendor/git-subrepo/lib/git-subrepo.d/help-functions.bash +21 -22
- data/vendor/git-subrepo/man/man1/git-subrepo.1 +125 -141
- data/vendor/git-subrepo/pkg/bin/generate-completion.pl +0 -7
- data/vendor/git-subrepo/pkg/bin/generate-help-functions.pl +0 -2
- data/vendor/git-subrepo/share/completion.bash +1 -3
- data/vendor/git-subrepo/share/enable-completion.sh +3 -3
- data/vendor/git-subrepo/share/zsh-completion/_git-subrepo +2 -7
- data/vendor/git-subrepo/test/Dockerfile +112 -0
- data/vendor/git-subrepo/test/branch-all.t +6 -6
- data/vendor/git-subrepo/test/branch-rev-list-one-path.t +7 -8
- data/vendor/git-subrepo/test/branch-rev-list.t +7 -8
- data/vendor/git-subrepo/test/branch.t +9 -9
- data/vendor/git-subrepo/test/clean.t +3 -3
- data/vendor/git-subrepo/test/clone-annotated-tag.t +7 -7
- data/vendor/git-subrepo/test/clone.t +20 -25
- data/vendor/git-subrepo/test/config.t +7 -6
- data/vendor/git-subrepo/test/encode.t +17 -17
- data/vendor/git-subrepo/test/error.t +18 -18
- data/vendor/git-subrepo/test/fetch.t +4 -4
- data/vendor/git-subrepo/test/gitignore.t +8 -8
- data/vendor/git-subrepo/test/init.t +6 -7
- data/vendor/git-subrepo/test/issue29.t +3 -3
- data/vendor/git-subrepo/test/issue95.t +2 -2
- data/vendor/git-subrepo/test/issue96.t +3 -3
- data/vendor/git-subrepo/test/pull-all.t +5 -5
- data/vendor/git-subrepo/test/pull-merge.t +16 -15
- data/vendor/git-subrepo/test/pull-message.t +12 -12
- data/vendor/git-subrepo/test/pull-new-branch.t +8 -7
- data/vendor/git-subrepo/test/pull-ours.t +10 -10
- data/vendor/git-subrepo/test/pull-theirs.t +8 -8
- data/vendor/git-subrepo/test/pull-twice.t +4 -4
- data/vendor/git-subrepo/test/pull-worktree.t +5 -5
- data/vendor/git-subrepo/test/pull.t +14 -14
- data/vendor/git-subrepo/test/push-after-init.t +7 -6
- data/vendor/git-subrepo/test/push-after-push-no-changes.t +27 -0
- data/vendor/git-subrepo/test/push-force.t +7 -6
- data/vendor/git-subrepo/test/push-new-branch.t +10 -10
- data/vendor/git-subrepo/test/push-no-changes.t +3 -3
- data/vendor/git-subrepo/test/push-squash.t +7 -7
- data/vendor/git-subrepo/test/push.t +35 -34
- data/vendor/git-subrepo/test/rebase.t +63 -0
- data/vendor/git-subrepo/test/reclone.t +15 -8
- data/vendor/git-subrepo/test/setup +62 -55
- data/vendor/git-subrepo/test/shellcheck.t +37 -0
- data/vendor/git-subrepo/test/status.t +47 -27
- data/vendor/git-subrepo/test/submodule.t +4 -4
- data/vendor/git-subrepo/test/zsh.t +27 -0
- metadata +45 -19
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.\" Automatically generated by Pod::Man
|
|
1
|
+
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
|
2
2
|
.\"
|
|
3
3
|
.\" Standard preamble:
|
|
4
4
|
.\" ========================================================================
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
.ie \n(.g .ds Aq \(aq
|
|
47
47
|
.el .ds Aq '
|
|
48
48
|
.\"
|
|
49
|
-
.\" If the F register is
|
|
49
|
+
.\" If the F register is >0, we'll generate index entries on stderr for
|
|
50
50
|
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
|
|
51
51
|
.\" entries marked with X<> in POD. Of course, you'll have to process the
|
|
52
52
|
.\" output yourself in some meaningful fashion.
|
|
@@ -56,12 +56,12 @@
|
|
|
56
56
|
..
|
|
57
57
|
.nr rF 0
|
|
58
58
|
.if \n(.g .if rF .nr rF 1
|
|
59
|
-
.if (\n(rF:(\n(.g==0)) \{
|
|
60
|
-
. if \nF \{
|
|
59
|
+
.if (\n(rF:(\n(.g==0)) \{\
|
|
60
|
+
. if \nF \{\
|
|
61
61
|
. de IX
|
|
62
62
|
. tm Index:\\$1\t\\n%\t"\\$2"
|
|
63
63
|
..
|
|
64
|
-
. if !\nF==2 \{
|
|
64
|
+
. if !\nF==2 \{\
|
|
65
65
|
. nr % 0
|
|
66
66
|
. nr F 2
|
|
67
67
|
. \}
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
.rr rF
|
|
71
71
|
.\" ========================================================================
|
|
72
72
|
.\"
|
|
73
|
-
.IX Title "
|
|
74
|
-
.TH
|
|
73
|
+
.IX Title "STDIN 1"
|
|
74
|
+
.TH STDIN 1 "November 2020" "Generated by Swim v0.1.48" "Modern Bash Programming"
|
|
75
75
|
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
|
76
76
|
.\" way too many mistakes in technical documents.
|
|
77
77
|
.if n .ad l
|
|
@@ -129,6 +129,6 @@ If you are interested in chatting about this, \f(CW\*(C`/join #bpan\*(C'\fR on i
|
|
|
129
129
|
Written by Ingy döt Net <ingy@ingy.net>
|
|
130
130
|
.SH "Copyright & License"
|
|
131
131
|
.IX Header "Copyright & License"
|
|
132
|
-
Copyright 2013\-
|
|
132
|
+
Copyright 2013\-2020. Ingy döt Net.
|
|
133
133
|
.PP
|
|
134
134
|
The \s-1MIT\s0 License (\s-1MIT\s0).
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
#!/bin/bash
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
source test/
|
|
3
|
+
source test/setup
|
|
4
4
|
|
|
5
5
|
PATH=$PWD/bin:$PATH
|
|
6
6
|
source bash+ :std
|
|
7
7
|
|
|
8
|
-
ok $? '
|
|
8
|
+
ok $? "'source bash+' works"
|
|
9
9
|
|
|
10
|
-
is "$BASHPLUS_VERSION" '0.0.
|
|
10
|
+
is "$BASHPLUS_VERSION" '0.0.9' 'BASHPLUS_VERSION is 0.0.9'
|
|
11
11
|
|
|
12
12
|
done_testing 2
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
source test/setup
|
|
4
|
+
|
|
5
|
+
PATH=$PWD/bin:$PATH
|
|
6
|
+
source bash+ :std
|
|
7
|
+
|
|
8
|
+
got=$(die "Nope" 2>&1) || true
|
|
9
|
+
want="Nope
|
|
10
|
+
at line 8 in main of test/die.t"
|
|
11
|
+
is "$got" "$want" "die() msg ok"
|
|
12
|
+
|
|
13
|
+
got=$(die "Nope\n" 2>&1) || true
|
|
14
|
+
want="Nope"
|
|
15
|
+
is "$got" "$want" "die() msg ok"
|
|
16
|
+
|
|
17
|
+
done_testing 2
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
# shellcheck shell=bash
|
|
2
2
|
|
|
3
3
|
#------------------------------------------------------------------------------
|
|
4
4
|
# This is a tiny version of test-more-bash that I use here. test-more-bash uses
|
|
@@ -7,22 +7,27 @@
|
|
|
7
7
|
# how nice Bash can be.
|
|
8
8
|
#------------------------------------------------------------------------------
|
|
9
9
|
|
|
10
|
+
set -e -u -o pipefail
|
|
11
|
+
[[ $BASH_VERSION == 4.0* ]] && set +u
|
|
12
|
+
|
|
13
|
+
run=0
|
|
14
|
+
|
|
10
15
|
plan() {
|
|
11
16
|
echo "1..$1"
|
|
12
17
|
}
|
|
13
18
|
|
|
14
19
|
pass() {
|
|
15
|
-
|
|
20
|
+
(( ++run ))
|
|
16
21
|
echo "ok $run${1:+ - $1}"
|
|
17
22
|
}
|
|
18
23
|
|
|
19
24
|
fail() {
|
|
20
|
-
|
|
25
|
+
(( ++run ))
|
|
21
26
|
echo "not ok $run${1:+ - $1}"
|
|
22
27
|
}
|
|
23
28
|
|
|
24
29
|
is() {
|
|
25
|
-
if [
|
|
30
|
+
if [[ $1 == "$2" ]]; then
|
|
26
31
|
pass "$3"
|
|
27
32
|
else
|
|
28
33
|
fail "$3"
|
|
@@ -32,13 +37,15 @@ is() {
|
|
|
32
37
|
}
|
|
33
38
|
|
|
34
39
|
ok() {
|
|
35
|
-
(exit ${1:-$?})
|
|
36
|
-
pass "$2"
|
|
40
|
+
if (exit "${1:-$?}"); then
|
|
41
|
+
pass "$2"
|
|
42
|
+
else
|
|
37
43
|
fail "$2"
|
|
44
|
+
fi
|
|
38
45
|
}
|
|
39
46
|
|
|
40
47
|
like() {
|
|
41
|
-
if [[
|
|
48
|
+
if [[ $1 =~ $2 ]]; then
|
|
42
49
|
pass "$3"
|
|
43
50
|
else
|
|
44
51
|
fail "$3"
|
|
@@ -48,7 +55,7 @@ like() {
|
|
|
48
55
|
}
|
|
49
56
|
|
|
50
57
|
unlike() {
|
|
51
|
-
if [[ !
|
|
58
|
+
if [[ ! $1 =~ $2 ]]; then
|
|
52
59
|
pass "$3"
|
|
53
60
|
else
|
|
54
61
|
fail "$3"
|
|
@@ -68,3 +75,5 @@ diag() {
|
|
|
68
75
|
note() {
|
|
69
76
|
echo "# ${1//$'\n'/$'\n'# }"
|
|
70
77
|
}
|
|
78
|
+
|
|
79
|
+
#! vim: ft=sh sw=2:
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
source test/setup
|
|
4
|
+
|
|
5
|
+
PATH=$PWD/bin:$PATH
|
|
6
|
+
source bash+
|
|
7
|
+
|
|
8
|
+
if ! command -v shellcheck >/dev/null; then
|
|
9
|
+
plan skip_all "The 'shellcheck' utility is not installed"
|
|
10
|
+
fi
|
|
11
|
+
if [[ ! $(shellcheck --version) =~ 0\.7\.1 ]]; then
|
|
12
|
+
plan skip_all "This test wants shellcheck version 0.7.1"
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
IFS=$'\n' read -d '' -r -a shell_files <<< "$(
|
|
16
|
+
find bin -type f
|
|
17
|
+
find lib -type f
|
|
18
|
+
echo test/setup
|
|
19
|
+
find test -name '*.t'
|
|
20
|
+
)" || true
|
|
21
|
+
|
|
22
|
+
skips=(
|
|
23
|
+
# We want to keep these 2 here always:
|
|
24
|
+
SC1090 # Can't follow non-constant source. Use a directive to specify location.
|
|
25
|
+
SC1091 # Not following: bash+ was not specified as input (see shellcheck -x).
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
skip=$(IFS=,; echo "${skips[*]}")
|
|
29
|
+
|
|
30
|
+
for file in "${shell_files[@]}"; do
|
|
31
|
+
[[ $file == *swp ]] && continue
|
|
32
|
+
is "$(shellcheck -e "$skip" "$file")" "" \
|
|
33
|
+
"The shell file '$file' passes shellcheck"
|
|
34
|
+
done
|
|
35
|
+
|
|
36
|
+
done_testing
|
|
37
|
+
|
|
38
|
+
# vim: set ft=sh:
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
#!/bin/bash
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
source test/
|
|
3
|
+
source test/setup
|
|
4
4
|
|
|
5
5
|
PATH=$PWD/bin:$PATH
|
|
6
6
|
source bash+ :std
|
|
7
7
|
|
|
8
|
-
ok "
|
|
9
|
-
ok "
|
|
10
|
-
ok "
|
|
8
|
+
ok "$(bash+:can use)" 'use is imported'
|
|
9
|
+
ok "$(bash+:can die)" 'die is imported'
|
|
10
|
+
ok "$(bash+:can warn)" 'warn is imported'
|
|
11
11
|
|
|
12
|
-
ok "
|
|
13
|
-
ok "
|
|
14
|
-
ok "
|
|
15
|
-
ok "
|
|
16
|
-
ok "
|
|
12
|
+
ok "$(! bash+:can import)" 'import is not imported'
|
|
13
|
+
ok "$(! bash+:can main)" 'main is not imported'
|
|
14
|
+
ok "$(! bash+:can fcopy)" 'fcopy is not imported'
|
|
15
|
+
ok "$(! bash+:can findlib)" 'findlib is not imported'
|
|
16
|
+
ok "$(! bash+:can can)" 'can is not imported'
|
|
17
17
|
|
|
18
18
|
done_testing 8
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
#!/bin/bash
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
source test/
|
|
3
|
+
source test/setup
|
|
4
4
|
|
|
5
5
|
PATH=$PWD/bin:$PATH
|
|
6
6
|
source bash+
|
|
7
7
|
|
|
8
8
|
functions=(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
use
|
|
10
|
+
import
|
|
11
|
+
fcopy
|
|
12
|
+
findlib
|
|
13
|
+
die
|
|
14
|
+
warn
|
|
15
|
+
can
|
|
16
16
|
)
|
|
17
17
|
|
|
18
|
-
for f in ${functions[@]}; do
|
|
18
|
+
for f in "${functions[@]}"; do
|
|
19
19
|
is "$(type -t "bash+:$f")" function \
|
|
20
20
|
"bash+:$f is a function"
|
|
21
21
|
done
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
#!/bin/bash
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
source test/
|
|
3
|
+
source test/setup
|
|
4
4
|
|
|
5
5
|
PATH=$PWD/bin:$PATH
|
|
6
6
|
source bash+ :std can
|
|
7
7
|
|
|
8
|
+
# shellcheck disable=2034
|
|
8
9
|
BASHLIB=test/lib
|
|
9
10
|
|
|
10
11
|
use Foo::Bar
|
|
12
|
+
|
|
11
13
|
ok $? 'use Foo::Bar - works'
|
|
12
|
-
ok "
|
|
14
|
+
ok "$(can Foo::Bar:baz)" 'Function Foo::Bar:baz exists'
|
|
15
|
+
|
|
16
|
+
# shellcheck disable=2016,2154
|
|
13
17
|
is "$Foo__Bar_VERSION" 1.2.3 '$Foo__Bar_VERSION == 1.2.3'
|
|
14
18
|
|
|
15
|
-
output
|
|
19
|
+
output=$(use Foo::Foo Boo Booo)
|
|
16
20
|
ok $? 'use Foo::Foo Boo Booo - works'
|
|
17
21
|
is "$output" Boo---Booo 'Correct import called'
|
|
18
22
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
; DO NOT EDIT (unless you know what you are doing)
|
|
2
|
+
;
|
|
3
|
+
; This subdirectory is a git "subrepo", and this file is maintained by the
|
|
4
|
+
; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
|
|
5
|
+
;
|
|
6
|
+
[subrepo]
|
|
7
|
+
remote = git@github.com:ingydotnet/test-tap-bash.git
|
|
8
|
+
branch = master
|
|
9
|
+
commit = a9b33446848440a445f664a942f676d726788eff
|
|
10
|
+
parent = 24ba0cb0c97d2591cfc2c106a70b1d1f8c559e01
|
|
11
|
+
cmdver = 0.4.1
|
|
12
|
+
method = merge
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
---
|
|
2
|
+
version: 0.0.6
|
|
3
|
+
date: Tue 03 Nov 2020 05:20:54 PM EST
|
|
4
|
+
changes:
|
|
5
|
+
- Workaround for bash 4.0 bug
|
|
6
|
+
- Docker testing for all bash versions
|
|
7
|
+
---
|
|
8
|
+
version: 0.0.5
|
|
9
|
+
date: Tue 03 Nov 2020 01:15:41 PM EST
|
|
10
|
+
changes:
|
|
11
|
+
- Use more modern Bash idioms
|
|
12
|
+
---
|
|
2
13
|
version: 0.0.4
|
|
3
14
|
date: Sat Jan 23 16:32:22 PST 2016
|
|
4
15
|
changes:
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
SHELL := bash
|
|
2
|
+
|
|
1
3
|
ifeq ($(MAKECMDGOALS),install)
|
|
2
4
|
ifeq "$(shell bpan version 2>/dev/null)" ""
|
|
3
5
|
$(error 'BPAN not installed. See http://bpan.org')
|
|
@@ -12,6 +14,8 @@ INSTALL_LIB ?= $(shell bpan env BPAN_LIB)
|
|
|
12
14
|
INSTALL_DIR ?= test
|
|
13
15
|
INSTALL_MAN3 ?= $(shell bpan env BPAN_MAN3)
|
|
14
16
|
|
|
17
|
+
DOCKER_IMAGE := ingy/bash-testing:0.0.1
|
|
18
|
+
|
|
15
19
|
default: help
|
|
16
20
|
|
|
17
21
|
help:
|
|
@@ -21,6 +25,18 @@ help:
|
|
|
21
25
|
test:
|
|
22
26
|
prove $(PROVEOPT:%=% )test/
|
|
23
27
|
|
|
28
|
+
test-all: test docker-test
|
|
29
|
+
|
|
30
|
+
docker-test:
|
|
31
|
+
-$(call docker-make-test,3.2)
|
|
32
|
+
-$(call docker-make-test,4.0)
|
|
33
|
+
-$(call docker-make-test,4.1)
|
|
34
|
+
-$(call docker-make-test,4.2)
|
|
35
|
+
-$(call docker-make-test,4.3)
|
|
36
|
+
-$(call docker-make-test,4.4)
|
|
37
|
+
-$(call docker-make-test,5.0)
|
|
38
|
+
-$(call docker-make-test,5.1)
|
|
39
|
+
|
|
24
40
|
install:
|
|
25
41
|
install -C -d -m 0755 $(INSTALL_LIB)/$(INSTALL_DIR)/
|
|
26
42
|
install -C -m 0755 $(LIB) $(INSTALL_LIB)/$(INSTALL_DIR)/
|
|
@@ -35,3 +51,17 @@ ReadMe.pod: doc/test-tap.swim
|
|
|
35
51
|
|
|
36
52
|
man/man3/%.3: doc/%.swim
|
|
37
53
|
swim --to=man $< > $@
|
|
54
|
+
|
|
55
|
+
define docker-make-test
|
|
56
|
+
docker run -i -t --rm \
|
|
57
|
+
-v $(PWD):/git-subrepo \
|
|
58
|
+
-w /git-subrepo \
|
|
59
|
+
$(DOCKER_IMAGE) \
|
|
60
|
+
/bin/bash -c ' \
|
|
61
|
+
set -x && \
|
|
62
|
+
[[ -d /bash-$(1) ]] && \
|
|
63
|
+
export PATH=/bash-$(1)/bin:$$PATH && \
|
|
64
|
+
bash --version && \
|
|
65
|
+
make test \
|
|
66
|
+
'
|
|
67
|
+
endef
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
=meta: 0.0.2
|
|
2
2
|
|
|
3
3
|
name: test-tap
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.6
|
|
5
5
|
abstract: TAP Test Base for Bash
|
|
6
6
|
homepage: http://bpan.org/package/test-tap/
|
|
7
7
|
|
|
8
8
|
license: MIT
|
|
9
|
-
copyright: 2013-
|
|
9
|
+
copyright: 2013-2020
|
|
10
10
|
author:
|
|
11
11
|
name: Ingy döt Net
|
|
12
12
|
email: ingy@ingy.net
|
|
@@ -16,7 +16,7 @@ author:
|
|
|
16
16
|
homepage: http://ingy.net
|
|
17
17
|
|
|
18
18
|
requires:
|
|
19
|
-
bash: 3.2.
|
|
19
|
+
bash: 3.2.57
|
|
20
20
|
test:
|
|
21
21
|
cmd: make test
|
|
22
22
|
install:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=pod
|
|
2
2
|
|
|
3
3
|
=for comment
|
|
4
|
-
DO NOT EDIT. This Pod was generated by Swim v0.1.
|
|
4
|
+
DO NOT EDIT. This Pod was generated by Swim v0.1.48.
|
|
5
5
|
See http://github.com/ingydotnet/swim-pm#readme
|
|
6
6
|
|
|
7
7
|
=encoding utf8
|
|
@@ -59,7 +59,7 @@ Written by Ingy döt Net <ingy@ingy.net>
|
|
|
59
59
|
|
|
60
60
|
=head1 Copyright & License
|
|
61
61
|
|
|
62
|
-
Copyright 2013-
|
|
62
|
+
Copyright 2013-2020. Ingy döt Net.
|
|
63
63
|
|
|
64
64
|
The MIT License (MIT).
|
|
65
65
|
|
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
# test/tap.bash - TAP Testing Foundation for Bash
|
|
2
2
|
#
|
|
3
|
-
# Copyright (c) 2013-
|
|
3
|
+
# Copyright (c) 2013-2020. Ingy döt Net.
|
|
4
4
|
|
|
5
5
|
#------------------------------------------------------------------------------
|
|
6
6
|
Test::Tap:die() { echo "$@" >&2; trap EXIT; exit 1; }
|
|
7
7
|
#------------------------------------------------------------------------------
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
set -e -u -o pipefail
|
|
10
|
+
[[ ${BASH_VERSION-} == 4.0* ]] && set +u
|
|
11
|
+
|
|
12
|
+
# shellcheck disable=2034
|
|
13
|
+
Test__Tap_VERSION=0.0.6
|
|
10
14
|
|
|
11
15
|
Test::Tap:init() {
|
|
12
|
-
[
|
|
16
|
+
[[ ${BASH_SOURCE[0]} ]] ||
|
|
13
17
|
Test::Tap:die "Error: test-tap-bash must be run under Bash only"
|
|
14
18
|
Test__Tap_plan=0
|
|
15
19
|
Test__Tap_run=0
|
|
16
20
|
Test__Tap_failed=0
|
|
17
|
-
Test__Tap_pid=$BASHPID
|
|
21
|
+
Test__Tap_pid=${BASHPID:-0}
|
|
18
22
|
|
|
19
|
-
if [ $# -gt 0 ]; then
|
|
23
|
+
if [[ $# -gt 0 ]]; then
|
|
20
24
|
[[ $# -eq 2 ]] ||
|
|
21
25
|
Test::Tap:die 'Usage: test/tap.bash tests <number>'
|
|
22
26
|
Test::Tap:plan "$@"
|
|
@@ -27,17 +31,17 @@ Test::Tap:init() {
|
|
|
27
31
|
|
|
28
32
|
Test::Tap:plan() {
|
|
29
33
|
Test::Tap:_check-pid
|
|
30
|
-
[ $# -eq 2 ] ||
|
|
34
|
+
[[ $# -eq 2 ]] ||
|
|
31
35
|
Test::Tap:die 'Usage: plan tests <number>'
|
|
32
|
-
if [
|
|
33
|
-
[[
|
|
36
|
+
if [[ $1 = tests ]]; then
|
|
37
|
+
[[ $2 =~ ^-?[0-9]+$ ]] ||
|
|
34
38
|
Test::Tap:die 'Plan must be a number'
|
|
35
39
|
[[ $2 -gt 0 ]] ||
|
|
36
40
|
Test::Tap:die 'Plan must greater then 0'
|
|
37
41
|
Test__Tap_plan=$2
|
|
38
|
-
printf "1..%d\n" $Test__Tap_plan
|
|
39
|
-
elif [
|
|
40
|
-
printf "1..0 # SKIP
|
|
42
|
+
printf "1..%d\n" "$Test__Tap_plan"
|
|
43
|
+
elif [[ $1 == skip_all ]]; then
|
|
44
|
+
printf "1..0 # SKIP %s\n" "$2"
|
|
41
45
|
exit 0
|
|
42
46
|
else
|
|
43
47
|
Test::Tap:die 'Usage: plan tests <number>'
|
|
@@ -46,9 +50,9 @@ Test::Tap:plan() {
|
|
|
46
50
|
|
|
47
51
|
Test::Tap:pass() {
|
|
48
52
|
Test::Tap:_check-pid
|
|
49
|
-
|
|
50
|
-
local label
|
|
51
|
-
if [
|
|
53
|
+
((++Test__Tap_run))
|
|
54
|
+
local label=${1-}
|
|
55
|
+
if [[ $label ]]; then
|
|
52
56
|
echo "ok $Test__Tap_run - $label"
|
|
53
57
|
else
|
|
54
58
|
echo "ok $Test__Tap_run"
|
|
@@ -58,12 +62,12 @@ Test::Tap:pass() {
|
|
|
58
62
|
Test__Tap_CALL_STACK_LEVEL=1
|
|
59
63
|
Test::Tap:fail() {
|
|
60
64
|
Test::Tap:_check-pid
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
local file=${c[2]}
|
|
64
|
-
local line=${c[0]}
|
|
65
|
-
local label
|
|
66
|
-
if [
|
|
65
|
+
((++Test__Tap_run))
|
|
66
|
+
IFS=' ' read -r -a c <<<"$(caller $Test__Tap_CALL_STACK_LEVEL)"
|
|
67
|
+
local file=${c[2]-}
|
|
68
|
+
local line=${c[0]-}
|
|
69
|
+
local label=${1-} callback=${2-}
|
|
70
|
+
if [[ $label ]]; then
|
|
67
71
|
echo "not ok $Test__Tap_run - $label"
|
|
68
72
|
else
|
|
69
73
|
echo "not ok $Test__Tap_run"
|
|
@@ -72,35 +76,35 @@ Test::Tap:fail() {
|
|
|
72
76
|
label=${label:-"at $file line $line."}
|
|
73
77
|
echo -e "# Failed test $label" >&2
|
|
74
78
|
|
|
75
|
-
[
|
|
79
|
+
[[ $callback ]] && $callback
|
|
76
80
|
|
|
77
81
|
local rc=${TEST_TAP_BAIL_ON_FAIL:-0}
|
|
78
|
-
[[ $
|
|
82
|
+
[[ $rc -eq 0 ]] || exit "$rc"
|
|
79
83
|
}
|
|
80
84
|
|
|
81
85
|
Test::Tap:done_testing() {
|
|
82
86
|
Test::Tap:_check-pid
|
|
83
87
|
Test__Tap_plan=$Test__Tap_run
|
|
84
|
-
echo 1
|
|
88
|
+
echo 1.."${1:-$Test__Tap_run}"
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
Test::Tap:diag() {
|
|
88
92
|
Test::Tap:_check-pid
|
|
89
|
-
local msg
|
|
93
|
+
local msg=$*
|
|
90
94
|
msg="# ${msg//$'\n'/$'\n'# }"
|
|
91
95
|
echo "$msg" >&2
|
|
92
96
|
}
|
|
93
97
|
|
|
94
98
|
Test::Tap:note() {
|
|
95
99
|
Test::Tap:_check-pid
|
|
96
|
-
local msg
|
|
100
|
+
local msg=$*
|
|
97
101
|
msg="# ${msg//$'\n'/$'\n'# }"
|
|
98
102
|
echo "$msg"
|
|
99
103
|
}
|
|
100
104
|
|
|
101
105
|
Test::Tap:BAIL_OUT() {
|
|
102
106
|
Test::Tap:_check-pid
|
|
103
|
-
Test__Tap_bail_msg
|
|
107
|
+
Test__Tap_bail_msg=$*
|
|
104
108
|
: "${Test__Tap_bail_msg:=No reason given.}"
|
|
105
109
|
exit 255
|
|
106
110
|
}
|
|
@@ -113,41 +117,41 @@ Test::Tap:BAIL_ON_FAIL() {
|
|
|
113
117
|
Test::Tap:END() {
|
|
114
118
|
local rc=$?
|
|
115
119
|
Test::Tap:_check-pid
|
|
116
|
-
if [ $rc -ne 0 ]; then
|
|
117
|
-
if [
|
|
118
|
-
|
|
120
|
+
if [[ $rc -ne 0 ]]; then
|
|
121
|
+
if [[ ${Test__Tap_bail_msg-} ]] ||
|
|
122
|
+
[[ ${TEST_TAP_BAIL_ON_FAIL-} ]]; then
|
|
123
|
+
local bail=${Test__Tap_bail_msg:-"Bailing out on status=$rc"}
|
|
119
124
|
echo "Bail out! $bail"
|
|
120
125
|
exit $rc
|
|
121
126
|
fi
|
|
122
127
|
fi
|
|
123
128
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
if [ $run -gt 0 ]; then
|
|
129
|
+
if [[ $Test__Tap_plan -eq 0 ]]; then
|
|
130
|
+
if [[ $Test__Tap_run -gt 0 ]]; then
|
|
127
131
|
echo "# Tests were run but no plan was declared." >&2
|
|
128
132
|
fi
|
|
129
133
|
else
|
|
130
|
-
if [ $
|
|
134
|
+
if [[ $Test__Tap_run -eq 0 ]]; then
|
|
131
135
|
echo "# No tests run!" >&2
|
|
132
|
-
elif [ $
|
|
133
|
-
local msg="# Looks like you planned $
|
|
134
|
-
[ $
|
|
136
|
+
elif [[ $Test__Tap_run -ne $Test__Tap_plan ]]; then
|
|
137
|
+
local msg="# Looks like you planned $Test__Tap_plan tests but ran $Test__Tap_run."
|
|
138
|
+
[[ $Test__Tap_plan -eq 1 ]] && msg=${msg/tests/test}
|
|
135
139
|
echo "$msg" >&2
|
|
136
140
|
fi
|
|
137
141
|
fi
|
|
138
142
|
local exit_code=0
|
|
139
|
-
if [ $Test__Tap_failed -gt 0 ]; then
|
|
143
|
+
if [[ $Test__Tap_failed -gt 0 ]]; then
|
|
140
144
|
exit_code=$Test__Tap_failed
|
|
141
|
-
[ $exit_code -gt 254 ] && exit_code=254
|
|
142
|
-
local msg="# Looks like you failed $
|
|
143
|
-
[ $Test__Tap_failed -eq 1 ] && msg=${msg/tests/test}
|
|
145
|
+
[[ $exit_code -gt 254 ]] && exit_code=254
|
|
146
|
+
local msg="# Looks like you failed $Test__Tap_failed tests of $Test__Tap_run run."
|
|
147
|
+
[[ $Test__Tap_failed -eq 1 ]] && msg=${msg/tests/test}
|
|
144
148
|
echo "$msg" >&2
|
|
145
149
|
fi
|
|
146
150
|
exit $exit_code
|
|
147
151
|
}
|
|
148
152
|
|
|
149
153
|
Test::Tap:_check-pid() {
|
|
150
|
-
if [ ${BASHPID:-0} -ne ${Test__Tap_pid:-0} ]; then
|
|
151
|
-
die "Error: Called Test::Tap method from a subprocess" 3
|
|
154
|
+
if [[ ${BASHPID:-0} -ne ${Test__Tap_pid:-0} ]]; then
|
|
155
|
+
Test::Tap:die "Error: Called Test::Tap method from a subprocess" 3
|
|
152
156
|
fi
|
|
153
157
|
}
|